1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Vertical scroll bar for paths and symbols page, bug 235301.

This commit is contained in:
Markus Schorn 2008-06-26 10:43:12 +00:00
parent b23fa116f6
commit c198a352ec
4 changed files with 40 additions and 24 deletions

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Intel Corporation - initial API and implementation * Intel Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.ui.newui; package org.eclipse.cdt.ui.newui;
@ -48,6 +49,7 @@ import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.dialogs.ISelectionStatusValidator; import org.eclipse.ui.dialogs.ISelectionStatusValidator;
import org.eclipse.ui.model.WorkbenchContentProvider; import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.views.navigator.ResourceComparator; import org.eclipse.ui.views.navigator.ResourceComparator;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
@ -112,7 +114,10 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
protected static final String ENUM = "enum"; //$NON-NLS-1$ protected static final String ENUM = "enum"; //$NON-NLS-1$
protected static final String SSET = "set"; //$NON-NLS-1$ protected static final String SSET = "set"; //$NON-NLS-1$
private CLabel background; private PageBook pageBook; // to select between background and usercomp.
private CLabel background;
private Composite userdata;
protected Composite usercomp; // space where user can create widgets protected Composite usercomp; // space where user can create widgets
protected Composite buttoncomp; // space for buttons on the right protected Composite buttoncomp; // space for buttons on the right
private Button[] buttons; // buttons in buttoncomp private Button[] buttons; // buttons in buttoncomp
@ -136,15 +141,24 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
*/ */
protected void createControls(Composite parent) { protected void createControls(Composite parent) {
parent.setLayout(new FillLayout()); parent.setLayout(new FillLayout());
background = new CLabel(parent, SWT.CENTER | SWT.SHADOW_NONE); pageBook = new PageBook(parent, SWT.NULL);
background = new CLabel(pageBook, SWT.CENTER | SWT.SHADOW_NONE);
background.setText(EMPTY_STR); background.setText(EMPTY_STR);
background.setLayout(new GridLayout(2, false));
usercomp = new Composite(background, SWT.NONE); GridData gd;
usercomp.setLayoutData(new GridData(GridData.FILL_BOTH)); userdata= new Composite(pageBook, SWT.NONE);
buttoncomp = new Composite(background, SWT.NONE); userdata.setLayout(new GridLayout(2, false));
GridData d = new GridData(GridData.END);
d.widthHint = 1; usercomp = new Composite(userdata, SWT.NONE);
buttoncomp.setLayoutData(d); usercomp.setLayoutData(gd= new GridData(GridData.FILL_BOTH));
gd.widthHint= 150;
buttoncomp = new Composite(userdata, SWT.NONE);
buttoncomp.setLayoutData(gd= new GridData(GridData.END));
gd.widthHint= 150;
pageBook.showPage(userdata);
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpId); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpId);
} }
@ -628,9 +642,12 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
* @param msg - text to be shown instead of panes * @param msg - text to be shown instead of panes
*/ */
protected void setAllVisible(boolean visible, String msg) { protected void setAllVisible(boolean visible, String msg) {
setBackgroundText(visible ? EMPTY_STR : msg); if (!visible) {
usercomp.setVisible(visible); setBackgroundText(msg);
buttoncomp.setVisible(visible); pageBook.showPage(background);
} else {
pageBook.showPage(userdata);
}
if (page != null) { if (page != null) {
Button b = page.getAButton(); Button b = page.getAButton();
if (b != null) if (b != null)

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Intel Corporation - initial API and implementation * Intel Corporation - initial API and implementation
* IBM Corporation * IBM Corporation
* Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.ui.newui; package org.eclipse.cdt.ui.newui;
@ -121,7 +122,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
addTree(sashForm).setLayoutData(new GridData(GridData.FILL_VERTICAL)); addTree(sashForm).setLayoutData(new GridData(GridData.FILL_VERTICAL));
table = new Table(sashForm, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.FULL_SELECTION); table = new Table(sashForm, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.FULL_SELECTION);
gd = new GridData(GridData.FILL_BOTH); gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 255; gd.widthHint = 150;
table.setLayoutData(gd); table.setLayoutData(gd);
table.setHeaderVisible(isHeaderVisible()); table.setHeaderVisible(isHeaderVisible());
table.setLinesVisible(true); table.setLinesVisible(true);

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Intel Corporation - initial API and implementation * Intel Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.ui.newui; package org.eclipse.cdt.ui.newui;
@ -243,6 +244,7 @@ implements
Group configGroup = ControlFactory.createGroup(composite, EMPTY_STR, 1); Group configGroup = ControlFactory.createGroup(composite, EMPTY_STR, 1);
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.grabExcessHorizontalSpace = true; gd.grabExcessHorizontalSpace = true;
gd.widthHint= 150;
configGroup.setLayoutData(gd); configGroup.setLayoutData(gd);
configGroup.setLayout(new GridLayout(3, false)); configGroup.setLayout(new GridLayout(3, false));
@ -256,12 +258,7 @@ implements
handleConfigSelection(); handleConfigSelection();
} }
}); });
gd = new GridData(GridData.FILL); gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.horizontalAlignment = GridData.FILL;
gd.verticalAlignment = GridData.FILL;
configSelector.setLayoutData(gd); configSelector.setLayoutData(gd);
if (!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG)) { if (!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG)) {
@ -328,9 +325,10 @@ implements
} }
public void createWidgets(Composite c) { public void createWidgets(Composite c) {
GridData gd;
parentComposite = new Composite(c, SWT.NONE); parentComposite = new Composite(c, SWT.NONE);
parentComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); parentComposite.setLayoutData(gd= new GridData(GridData.FILL_BOTH));
gd.widthHint= 200;
itabs.clear(); itabs.clear();
if (!isSingle()) { if (!isSingle()) {
parentComposite.setLayout(new FillLayout()); parentComposite.setLayout(new FillLayout());

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Intel Corporation - initial API and implementation * Intel Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.ui.newui; package org.eclipse.cdt.ui.newui;
@ -250,12 +251,11 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
@Override @Override
public void updateData(ICResourceDescription _cfgd) { public void updateData(ICResourceDescription _cfgd) {
if (page.isMultiCfg()) { if (page.isMultiCfg()) {
usercomp.setVisible(false); setAllVisible(false, ""); //$NON-NLS-1$
return; return;
} }
if ( !usercomp.getVisible())
usercomp.setVisible(true);
setAllVisible(true, null);
cfgd = _cfgd; cfgd = _cfgd;
src = new ArrayList<_Entry>(); src = new ArrayList<_Entry>();
for (ICExclusionPatternPathEntry e : getEntries(cfgd)) for (ICExclusionPatternPathEntry e : getEntries(cfgd))