1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02: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:
Mat Booth 2021-11-01 16:59:12 +00:00 committed by Jonah Graham
parent ef30e37327
commit ed1e05876c
6 changed files with 36 additions and 44 deletions
dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching
jtag/org.eclipse.cdt.debug.gdbjtag.ui
META-INF
src/org/eclipse/cdt/debug/gdbjtag/ui
launchbar/org.eclipse.launchbar.ui
META-INF
src/org/eclipse/launchbar/ui/internal

View file

@ -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 * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * 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.SelectionEvent;
import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
@ -88,8 +87,6 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
protected Button fStopInMain; protected Button fStopInMain;
protected Text fStopInMainSymbol; protected Text fStopInMainSymbol;
private ScrolledComposite fContainer;
private Composite fContents; private Composite fContents;
private IContentChangeListener fContentListener = new IContentChangeListener() { private IContentChangeListener fContentListener = new IContentChangeListener() {
@ -115,14 +112,8 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
@Override @Override
public void createControl(Composite parent) { public void createControl(Composite parent) {
fContainer = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); fContents = new Composite(parent, SWT.NONE);
fContainer.setLayoutData(new GridData(GridData.FILL_BOTH)); setControl(fContents);
fContainer.setLayout(new FillLayout());
fContainer.setExpandHorizontal(true);
fContainer.setExpandVertical(true);
fContents = new Composite(fContainer, SWT.NONE);
setControl(fContainer);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB); ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB);
int numberOfColumns = fAttachMode ? 2 : 1; int numberOfColumns = fAttachMode ? 2 : 1;
@ -137,8 +128,6 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
createOptionsComposite(fContents); createOptionsComposite(fContents);
createDebuggerGroup(fContents, 2); createDebuggerGroup(fContents, 2);
fContainer.setContent(fContents);
} }
protected void initDebuggerTypes(String selection) { protected void initDebuggerTypes(String selection) {
@ -378,7 +367,8 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
} }
protected void contentsChanged() { 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() { protected void loadDynamicDebugArea() {

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.ui;singleton:=true 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-Activator: org.eclipse.cdt.debug.gdbjtag.ui.Activator
Bundle-Localization: plugin Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui, Require-Bundle: org.eclipse.ui,

View file

@ -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 * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * 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.GridDataFactory;
import org.eclipse.jface.layout.PixelConverter; import org.eclipse.jface.layout.PixelConverter;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.custom.StackLayout; import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;
@ -105,13 +104,8 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
@Override @Override
public void createControl(Composite parent) { public void createControl(Composite parent) {
ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); Composite comp = new Composite(parent, SWT.NONE);
sc.setExpandHorizontal(true); setControl(comp);
sc.setExpandVertical(true);
setControl(sc);
Composite comp = new Composite(sc, SWT.NONE);
sc.setContent(comp);
GridLayout layout = new GridLayout(2, false); GridLayout layout = new GridLayout(2, false);
comp.setLayout(layout); comp.setLayout(layout);

View file

@ -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 * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * 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.dialogs.IDialogConstants;
import org.eclipse.jface.layout.PixelConverter; import org.eclipse.jface.layout.PixelConverter;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
@ -117,21 +116,14 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
@Override @Override
public void createControl(Composite parent) { public void createControl(Composite parent) {
ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); Composite comp = new Composite(parent, SWT.NONE);
sc.setExpandHorizontal(true); setControl(comp);
sc.setExpandVertical(true);
setControl(sc);
Composite comp = new Composite(sc, SWT.NONE);
sc.setContent(comp);
GridLayout layout = new GridLayout(); GridLayout layout = new GridLayout();
comp.setLayout(layout); comp.setLayout(layout);
createInitGroup(comp); createInitGroup(comp);
createLoadGroup(comp); createLoadGroup(comp);
createRunGroup(comp); createRunGroup(comp);
sc.setMinSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));
} }
private void browseButtonSelected(String title, Text text) { private void browseButtonSelected(String title, Text text) {

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true 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-Activator: org.eclipse.launchbar.ui.internal.Activator
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,

View file

@ -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; package org.eclipse.launchbar.ui.internal;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@ -26,6 +36,7 @@ import org.eclipse.launchbar.ui.ILaunchBarUIManager;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
@ -198,13 +209,18 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau
tabItem.setText(tab.getName()); tabItem.setText(tab.getName());
tabItem.setImage(tab.getImage()); tabItem.setImage(tab.getImage());
Composite tabComp = new Composite(tabFolder, SWT.NONE); ScrolledComposite sc = new ScrolledComposite(tabItem.getParent(), SWT.V_SCROLL | SWT.H_SCROLL);
tabComp.setLayout(new GridLayout()); sc.setFont(tabItem.getParent().getFont());
tabItem.setControl(tabComp); sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
tab.createControl(tabComp); sc.setShowFocusedControl(true);
Control configControl = tab.getControl(); tab.createControl(sc);
configControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Control control = tab.getControl();
if (control != null) {
sc.setContent(control);
sc.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT));
tabItem.setControl(control.getParent());
}
return tabItem; return tabItem;
} }