mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-03-28 14:56:28 +01:00
Bug 576987 - Unable to scroll when editing a launch config
The current situation is that: * launch configuration dialog tabs scroll correctly in the standard Eclipse platform dialog, but not at all in the Launchbar-specific dialog * some CDT-supplied launch configuration dialog tabs try to manage their own scrolling behaviour to fix scrolling in the Launchbar-specific dialog but this breaks scrolling for that tab in the standard Eclipse platform dialog. This change fixes the launchbar-specific editor dialog to use a scrolled composite instead of a regular composite on which to layout the content of each tab -- This gives the launchbar's configuration editing dialog exactly the same scrolling behaviour as the standard Eclipse platform configuration editing dialog. And also fixes any CDT-supplied tabs that try to manage their own scrolling behaviour so now all tabs have the same behaviour when viewed in the Launchbar-specific dialog as they do when viewed in the standard Eclipse platform dialog. Change-Id: I0d7364a24ca48bb125cae9518728b4c93b93545d Signed-off-by: Mat Booth <mat.booth@gmail.com>
This commit is contained in:
parent
ef30e37327
commit
ed1e05876c
6 changed files with 36 additions and 44 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008, 2016 QNX Software Systems and others.
|
||||
* Copyright (c) 2008, 2021 QNX Software Systems and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -44,7 +44,6 @@ import org.eclipse.swt.events.SelectionAdapter;
|
|||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
@ -88,8 +87,6 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
|
|||
protected Button fStopInMain;
|
||||
protected Text fStopInMainSymbol;
|
||||
|
||||
private ScrolledComposite fContainer;
|
||||
|
||||
private Composite fContents;
|
||||
|
||||
private IContentChangeListener fContentListener = new IContentChangeListener() {
|
||||
|
@ -115,14 +112,8 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
|
|||
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
fContainer = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
fContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
fContainer.setLayout(new FillLayout());
|
||||
fContainer.setExpandHorizontal(true);
|
||||
fContainer.setExpandVertical(true);
|
||||
|
||||
fContents = new Composite(fContainer, SWT.NONE);
|
||||
setControl(fContainer);
|
||||
fContents = new Composite(parent, SWT.NONE);
|
||||
setControl(fContents);
|
||||
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
|
||||
ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB);
|
||||
int numberOfColumns = fAttachMode ? 2 : 1;
|
||||
|
@ -137,8 +128,6 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
|
|||
|
||||
createOptionsComposite(fContents);
|
||||
createDebuggerGroup(fContents, 2);
|
||||
|
||||
fContainer.setContent(fContents);
|
||||
}
|
||||
|
||||
protected void initDebuggerTypes(String selection) {
|
||||
|
@ -378,7 +367,8 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
|
|||
}
|
||||
|
||||
protected void contentsChanged() {
|
||||
fContainer.setMinSize(fContents.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
ScrolledComposite parent = (ScrolledComposite) fContents.getParent();
|
||||
parent.setMinSize(fContents.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
}
|
||||
|
||||
protected void loadDynamicDebugArea() {
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.ui;singleton:=true
|
||||
Bundle-Version: 9.0.100.qualifier
|
||||
Bundle-Version: 9.0.200.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.ui.Activator
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2020 QNX Software Systems and others.
|
||||
* Copyright (c) 2007, 2021 QNX Software Systems and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -53,7 +53,6 @@ import org.eclipse.debug.ui.StringVariableSelectionDialog;
|
|||
import org.eclipse.jface.layout.GridDataFactory;
|
||||
import org.eclipse.jface.layout.PixelConverter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.ScrolledComposite;
|
||||
import org.eclipse.swt.custom.StackLayout;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
|
@ -105,13 +104,8 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
sc.setExpandHorizontal(true);
|
||||
sc.setExpandVertical(true);
|
||||
setControl(sc);
|
||||
|
||||
Composite comp = new Composite(sc, SWT.NONE);
|
||||
sc.setContent(comp);
|
||||
Composite comp = new Composite(parent, SWT.NONE);
|
||||
setControl(comp);
|
||||
GridLayout layout = new GridLayout(2, false);
|
||||
comp.setLayout(layout);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 - 2020 QNX Software Systems and others.
|
||||
* Copyright (c) 2007 - 2021 QNX Software Systems and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -35,7 +35,6 @@ import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
|||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.layout.PixelConverter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.ScrolledComposite;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
|
@ -117,21 +116,14 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
|||
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
sc.setExpandHorizontal(true);
|
||||
sc.setExpandVertical(true);
|
||||
setControl(sc);
|
||||
|
||||
Composite comp = new Composite(sc, SWT.NONE);
|
||||
sc.setContent(comp);
|
||||
Composite comp = new Composite(parent, SWT.NONE);
|
||||
setControl(comp);
|
||||
GridLayout layout = new GridLayout();
|
||||
comp.setLayout(layout);
|
||||
|
||||
createInitGroup(comp);
|
||||
createLoadGroup(comp);
|
||||
createRunGroup(comp);
|
||||
|
||||
sc.setMinSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
}
|
||||
|
||||
private void browseButtonSelected(String title, Text text) {
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true
|
||||
Bundle-Version: 2.4.200.qualifier
|
||||
Bundle-Version: 2.4.300.qualifier
|
||||
Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator
|
||||
Bundle-Vendor: %providerName
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2016, 2021 QNX Software Systems and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*******************************************************************************/
|
||||
package org.eclipse.launchbar.ui.internal;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
@ -26,6 +36,7 @@ import org.eclipse.launchbar.ui.ILaunchBarUIManager;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CTabFolder;
|
||||
import org.eclipse.swt.custom.CTabItem;
|
||||
import org.eclipse.swt.custom.ScrolledComposite;
|
||||
import org.eclipse.swt.events.FocusAdapter;
|
||||
import org.eclipse.swt.events.FocusEvent;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
|
@ -198,13 +209,18 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau
|
|||
tabItem.setText(tab.getName());
|
||||
tabItem.setImage(tab.getImage());
|
||||
|
||||
Composite tabComp = new Composite(tabFolder, SWT.NONE);
|
||||
tabComp.setLayout(new GridLayout());
|
||||
tabItem.setControl(tabComp);
|
||||
|
||||
tab.createControl(tabComp);
|
||||
Control configControl = tab.getControl();
|
||||
configControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
ScrolledComposite sc = new ScrolledComposite(tabItem.getParent(), SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
sc.setFont(tabItem.getParent().getFont());
|
||||
sc.setExpandHorizontal(true);
|
||||
sc.setExpandVertical(true);
|
||||
sc.setShowFocusedControl(true);
|
||||
tab.createControl(sc);
|
||||
Control control = tab.getControl();
|
||||
if (control != null) {
|
||||
sc.setContent(control);
|
||||
sc.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
tabItem.setControl(control.getParent());
|
||||
}
|
||||
|
||||
return tabItem;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue