mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
Methods for controlling grabExcessHorisontalSpace and grapExcessVerticalSpace grid layout attributes.
This commit is contained in:
parent
dbf3690c8b
commit
46ac14620b
25 changed files with 56 additions and 73 deletions
|
@ -379,8 +379,8 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
|
|||
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fDiscoveredContainerList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fDiscoveredContainerList.getTreeControl(null));
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fDiscoveredContainerList }, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fDiscoveredContainerList.getTreeControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fDiscoveredContainerList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
|
|
@ -130,7 +130,7 @@ public class ExclusionInclusionEntryDialog extends StatusDialog {
|
|||
LayoutUtil.setWidthHint(fExclusionPatternDialog.getLabelControl(null), widthHint);
|
||||
LayoutUtil.setHorizontalSpan(fExclusionPatternDialog.getLabelControl(null), 2);
|
||||
LayoutUtil.setWidthHint(fExclusionPatternDialog.getTextControl(null), widthHint);
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternDialog.getTextControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternDialog.getTextControl(null), true);
|
||||
fExclusionPatternDialog.postSetFocusOnDialogField(parent.getDisplay());
|
||||
applyDialogFont(composite);
|
||||
return composite;
|
||||
|
|
|
@ -96,10 +96,10 @@ public class FileScopePreferencePage extends PreferencePage {
|
|||
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
fInclusionPatternList.doFillIntoGrid(inner, 3);
|
||||
LayoutUtil.setHorizontalSpan(fInclusionPatternList.getLabelControl(null), 2);
|
||||
LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null), true);
|
||||
fExclusionPatternList.doFillIntoGrid(inner, 3);
|
||||
LayoutUtil.setHorizontalSpan(fExclusionPatternList.getLabelControl(null), 2);
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null), true);
|
||||
setControl(inner);
|
||||
Dialog.applyDialogFont(inner);
|
||||
return inner;
|
||||
|
|
|
@ -40,7 +40,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
|||
public class CHHistoryListAction extends Action {
|
||||
|
||||
private class HistoryListDialog extends StatusDialog {
|
||||
|
||||
private ListDialogField<ICElement> fHistoryList;
|
||||
private IStatus fHistoryStatus;
|
||||
private ICElement fResult;
|
||||
|
@ -82,7 +81,6 @@ public class CHHistoryListAction extends Action {
|
|||
fHistoryList.selectElements(sel);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @see Dialog#createDialogArea(Composite)
|
||||
*/
|
||||
|
@ -99,7 +97,7 @@ public class CHHistoryListAction extends Action {
|
|||
|
||||
LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList }, true, 0, 0);
|
||||
LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
|
||||
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null), true);
|
||||
|
||||
applyDialogFont(composite);
|
||||
return composite;
|
||||
|
@ -118,7 +116,6 @@ public class CHHistoryListAction extends Action {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void doSelectionChanged() {
|
||||
StatusInfo status= new StatusInfo();
|
||||
List<ICElement> selected= fHistoryList.getSelectedElements();
|
||||
|
@ -181,6 +178,5 @@ public class CHHistoryListAction extends Action {
|
|||
fView.setInput(dialog.getResult());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.eclipse.swt.widgets.Composite;
|
|||
*/
|
||||
@Deprecated
|
||||
public class CPathContainerDefaultPage extends NewElementWizardPage implements IPathEntryContainerPage {
|
||||
|
||||
private StringDialogField fEntryField;
|
||||
private ArrayList<IPath> fUsedPaths;
|
||||
|
||||
|
@ -90,7 +89,7 @@ public class CPathContainerDefaultPage extends NewElementWizardPage implements I
|
|||
composite.setLayout(layout);
|
||||
|
||||
fEntryField.doFillIntoGrid(composite, 2);
|
||||
LayoutUtil.setHorizontalGrabbing(fEntryField.getTextControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fEntryField.getTextControl(null), true);
|
||||
|
||||
fEntryField.setFocus();
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField;
|
|||
*/
|
||||
@Deprecated
|
||||
public class CPathContainerEntryPage extends CPathBasePage {
|
||||
|
||||
private ListDialogField<CPElement> fCPathList;
|
||||
private ICProject fCurrCProject;
|
||||
|
||||
|
@ -115,7 +114,7 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
|||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fContainersList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fContainersList.getTreeControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fContainersList.getTreeControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fContainersList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
|
|
@ -76,7 +76,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField;
|
|||
*/
|
||||
@Deprecated
|
||||
public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage {
|
||||
|
||||
private TreeListDialogField<CPElementGroup> fIncludeSymPathsList;
|
||||
private SelectionButtonDialogField fShowInheritedPaths;
|
||||
private ICProject fCurrCProject;
|
||||
|
@ -115,7 +114,6 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
|
|||
private CPElementGroup fTopGroup;
|
||||
|
||||
private class IncludeSymbolAdapter implements IDialogFieldListener, ITreeListAdapter<CPElementGroup> {
|
||||
|
||||
private final Object[] EMPTY_ARR = new Object[0];
|
||||
|
||||
// -------- IListAdapter --------
|
||||
|
@ -210,7 +208,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
|
|||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fIncludeSymPathsList, fShowInheritedPaths}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fIncludeSymPathsList.getTreeControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fIncludeSymPathsList.getTreeControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fIncludeSymPathsList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
@ -324,7 +322,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
|
|||
private void addPathToResourceGroup(CPElement element, CPElementGroup parent, CPElementGroup group) {
|
||||
IPath resPath = element.getPath();
|
||||
IPath[] exclusions = (IPath[])element.getAttribute(CPElement.EXCLUSION);
|
||||
if ( (group != parent || !group.getResource().equals(element.getResource()))
|
||||
if ((group != parent || !group.getResource().equals(element.getResource()))
|
||||
&& resPath.isPrefixOf(group.getPath())
|
||||
&& (resPath.equals(group.getPath()) || !CoreModelUtil.isExcludedPath(
|
||||
group.getResource().getFullPath().removeFirstSegments(resPath.segmentCount()), exclusions))) {
|
||||
|
@ -436,7 +434,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
|
|||
} else if (elem instanceof CPElementAttribute) {
|
||||
CPElementAttribute attrib = (CPElementAttribute)elem;
|
||||
if (attrib.getKey().equals(CPElement.EXCLUSION)) {
|
||||
if ( ((IPath[])attrib.getValue()).length > 0) {
|
||||
if (((IPath[])attrib.getValue()).length > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -451,7 +449,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
|
|||
CPElement element = (CPElement)elem;
|
||||
CPElementGroup parent = element.getParent();
|
||||
if (removePathFromResourceGroups(element, fIncludeSymPathsList.getElements()) == null) {
|
||||
updatePathOnResourceGroups( element.getInherited(), fIncludeSymPathsList.getElements());
|
||||
updatePathOnResourceGroups(element.getInherited(), fIncludeSymPathsList.getElements());
|
||||
}
|
||||
fIncludeSymPathsList.refresh();
|
||||
fIncludeSymPathsList.selectElements(new StructuredSelection(parent));
|
||||
|
|
|
@ -257,7 +257,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
|||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fIncludeSymPathsList, fShowInheritedPaths}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fIncludeSymPathsList.getTreeControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fIncludeSymPathsList.getTreeControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fIncludeSymPathsList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
|
|
@ -63,7 +63,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField;
|
|||
*/
|
||||
@Deprecated
|
||||
public class CPathLibraryEntryPage extends CPathBasePage {
|
||||
|
||||
private ListDialogField<CPElement> fCPathList;
|
||||
private ICProject fCurrCProject;
|
||||
private IPath fProjPath;
|
||||
|
@ -172,7 +171,7 @@ public class CPathLibraryEntryPage extends CPathBasePage {
|
|||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[] {fLibrariesList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fLibrariesList.getTreeControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fLibrariesList.getTreeControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fLibrariesList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
@ -185,7 +184,6 @@ public class CPathLibraryEntryPage extends CPathBasePage {
|
|||
}
|
||||
|
||||
private class LibrariesAdapter implements IDialogFieldListener, ITreeListAdapter<CPElement> {
|
||||
|
||||
private final Object[] EMPTY_ARR= new Object[0];
|
||||
|
||||
// -------- IListAdapter --------
|
||||
|
@ -559,5 +557,4 @@ public class CPathLibraryEntryPage extends CPathBasePage {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class CPathOrderExportPage extends CPathBasePage {
|
|||
setControl(composite);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fCPathList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fCPathList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fCPathList.getListControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fCPathList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
|
|
@ -136,7 +136,7 @@ public class CPathOutputEntryPage extends CPathBasePage {
|
|||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fOutputList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fOutputList.getTreeControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fOutputList.getTreeControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fOutputList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
|
|
@ -106,7 +106,7 @@ public class CPathProjectsEntryPage extends CPathBasePage {
|
|||
setControl(composite);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fProjectsList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fProjectsList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fProjectsList.getListControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fProjectsList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
|
|
@ -134,7 +134,7 @@ public class CPathSourceEntryPage extends CPathBasePage {
|
|||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fFoldersList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fFoldersList.getTreeControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fFoldersList.getTreeControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||
fFoldersList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
|
|
@ -124,7 +124,7 @@ public class ExclusionPatternEntryDialog extends StatusDialog {
|
|||
LayoutUtil.setHorizontalSpan(fExclusionPatternDialog.getLabelControl(null), 2);
|
||||
|
||||
LayoutUtil.setWidthHint(fExclusionPatternDialog.getTextControl(null), widthHint);
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternDialog.getTextControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternDialog.getTextControl(null), true);
|
||||
|
||||
fExclusionPatternDialog.postSetFocusOnDialogField(parent.getDisplay());
|
||||
applyDialogFont(composite);
|
||||
|
|
|
@ -75,7 +75,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
|
|||
*/
|
||||
@Deprecated
|
||||
public class SourceAttachmentBlock {
|
||||
|
||||
private IStatusChangeListener fContext;
|
||||
|
||||
private StringButtonDialogField fFileNameField;
|
||||
|
@ -203,7 +202,7 @@ public class SourceAttachmentBlock {
|
|||
// archive name field
|
||||
fFileNameField.doFillIntoGrid(composite, 4);
|
||||
LayoutUtil.setWidthHint(fFileNameField.getTextControl(null), widthHint);
|
||||
LayoutUtil.setHorizontalGrabbing(fFileNameField.getTextControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fFileNameField.getTextControl(null), true);
|
||||
|
||||
// aditional 'browse workspace' button for normal jars
|
||||
DialogField.createEmptySpace(composite, 3);
|
||||
|
@ -219,7 +218,6 @@ public class SourceAttachmentBlock {
|
|||
}
|
||||
|
||||
private class SourceAttachmentAdapter implements IStringButtonAdapter, IDialogFieldListener {
|
||||
|
||||
// -------- IStringButtonAdapter --------
|
||||
public void changeControlPressed(DialogField field) {
|
||||
attachmentChangeControlPressed(field);
|
||||
|
@ -482,5 +480,4 @@ public class SourceAttachmentBlock {
|
|||
});
|
||||
return result[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
|||
public class IBHistoryListAction extends Action {
|
||||
|
||||
private class HistoryListDialog extends StatusDialog {
|
||||
|
||||
private ListDialogField<ITranslationUnit> fHistoryList;
|
||||
private IStatus fHistoryStatus;
|
||||
private ITranslationUnit fResult;
|
||||
|
@ -83,7 +82,6 @@ public class IBHistoryListAction extends Action {
|
|||
fHistoryList.selectElements(sel);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @see Dialog#createDialogArea(Composite)
|
||||
*/
|
||||
|
@ -100,7 +98,7 @@ public class IBHistoryListAction extends Action {
|
|||
|
||||
LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList }, true, 0, 0);
|
||||
LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
|
||||
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null), true);
|
||||
|
||||
applyDialogFont(composite);
|
||||
return composite;
|
||||
|
@ -119,7 +117,6 @@ public class IBHistoryListAction extends Action {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void doSelectionChanged() {
|
||||
StatusInfo status= new StatusInfo();
|
||||
List<ITranslationUnit> selected= fHistoryList.getSelectedElements();
|
||||
|
@ -160,7 +157,6 @@ public class IBHistoryListAction extends Action {
|
|||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
super.create();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private IBViewPart fView;
|
||||
|
@ -182,6 +178,5 @@ public class IBHistoryListAction extends Action {
|
|||
fView.setInput(dialog.getResult());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
|||
fUseProjectSettings.setDialogFieldListener(listener);
|
||||
fUseProjectSettings.setLabelText(PreferencesMessages.PropertyAndPreferencePage_useprojectsettings_label);
|
||||
fUseProjectSettings.doFillIntoGrid(composite, 1);
|
||||
LayoutUtil.setHorizontalGrabbing(fUseProjectSettings.getSelectionButton(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fUseProjectSettings.getSelectionButton(null), true);
|
||||
|
||||
if (offerLink()) {
|
||||
fChangeWorkspaceSettings= createLink(composite, PreferencesMessages.PropertyAndPreferencePage_useworkspacesettings_change);
|
||||
|
|
|
@ -128,7 +128,7 @@ public class TodoTaskInputDialog extends StatusDialog {
|
|||
fNameDialogField.doFillIntoGrid(inner, 2);
|
||||
fPriorityDialogField.doFillIntoGrid(inner, 2);
|
||||
|
||||
LayoutUtil.setHorizontalGrabbing(fNameDialogField.getTextControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fNameDialogField.getTextControl(null), true);
|
||||
LayoutUtil.setWidthHint(fNameDialogField.getTextControl(null), convertWidthInCharsToPixels(45));
|
||||
|
||||
fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());
|
||||
|
|
|
@ -40,7 +40,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
|||
public class THHistoryListAction extends Action {
|
||||
|
||||
private class HistoryListDialog extends StatusDialog {
|
||||
|
||||
private ListDialogField<ICElement> fHistoryList;
|
||||
private IStatus fHistoryStatus;
|
||||
private ICElement fResult;
|
||||
|
@ -82,7 +81,6 @@ public class THHistoryListAction extends Action {
|
|||
fHistoryList.selectElements(sel);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @see Dialog#createDialogArea(Composite)
|
||||
*/
|
||||
|
@ -99,7 +97,7 @@ public class THHistoryListAction extends Action {
|
|||
|
||||
LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList }, true, 0, 0);
|
||||
LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
|
||||
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null), true);
|
||||
|
||||
applyDialogFont(composite);
|
||||
return composite;
|
||||
|
@ -118,7 +116,6 @@ public class THHistoryListAction extends Action {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void doSelectionChanged() {
|
||||
StatusInfo status= new StatusInfo();
|
||||
List<?> selected= fHistoryList.getSelectedElements();
|
||||
|
@ -159,7 +156,6 @@ public class THHistoryListAction extends Action {
|
|||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
super.create();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private THViewPart fView;
|
||||
|
@ -181,6 +177,5 @@ public class THHistoryListAction extends Action {
|
|||
fView.setInput(dialog.getResult(), null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2001, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2001, 2011 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -8,6 +8,7 @@
|
|||
* Contributors:
|
||||
* Rational Software - initial implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.wizards.dialogfields;
|
||||
|
||||
|
@ -19,7 +20,6 @@ import org.eclipse.swt.widgets.Control;
|
|||
import org.eclipse.swt.widgets.Layout;
|
||||
|
||||
public class LayoutUtil {
|
||||
|
||||
/**
|
||||
* Calculates the number of columns needed by field editors
|
||||
*/
|
||||
|
@ -153,9 +153,28 @@ public class LayoutUtil {
|
|||
* Makes a control grab all available horizontal space. Assumes that GridData is used.
|
||||
*/
|
||||
public static void setHorizontalGrabbing(Control control) {
|
||||
setHorizontalGrabbing(control, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a control grab all available horizontal space. Assumes that GridData is used.
|
||||
* @param value <code>true</code> to grab, <code>false</code> not to grab
|
||||
*/
|
||||
public static void setHorizontalGrabbing(Control control, boolean value) {
|
||||
Object ld= control.getLayoutData();
|
||||
if (ld instanceof GridData) {
|
||||
((GridData) ld).grabExcessHorizontalSpace= true;
|
||||
((GridData) ld).grabExcessHorizontalSpace= value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a control grab all available horizontal space. Assumes that GridData is used.
|
||||
* @param value <code>true</code> to grab, <code>false</code> not to grab
|
||||
*/
|
||||
public static void setVerticalGrabbing(Control control, boolean value) {
|
||||
Object ld= control.getLayoutData();
|
||||
if (ld instanceof GridData) {
|
||||
((GridData) ld).grabExcessVerticalSpace= value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFie
|
|||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
|
||||
|
||||
public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
||||
|
||||
private static final String PAGE_NAME= "NewSourceFolderWizardPage"; //$NON-NLS-1$
|
||||
|
||||
private StringButtonDialogField fProjectField;
|
||||
|
@ -186,7 +185,6 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
|||
fRootDialogField.setText(""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
||||
// -------- UI Creation ---------
|
||||
|
||||
/*
|
||||
|
@ -209,7 +207,7 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
|||
|
||||
int maxFieldWidth= convertWidthInCharsToPixels(40);
|
||||
LayoutUtil.setWidthHint(fProjectField.getTextControl(null), maxFieldWidth);
|
||||
LayoutUtil.setHorizontalGrabbing(fProjectField.getTextControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fProjectField.getTextControl(null), true);
|
||||
LayoutUtil.setWidthHint(fRootDialogField.getTextControl(null), maxFieldWidth);
|
||||
|
||||
// Bug #220003 : consistency between New Source Folder dialog and Source Location Property tab.
|
||||
|
@ -245,6 +243,7 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
|||
packRootDialogFieldChanged(field);
|
||||
}
|
||||
}
|
||||
|
||||
protected void packRootChangeControlPressed(DialogField field) {
|
||||
if (field == fRootDialogField) {
|
||||
IPath initialPath= new Path(fRootDialogField.getText());
|
||||
|
@ -276,7 +275,6 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
|||
updateStatus(new IStatus[] { fProjectStatus, fRootStatus });
|
||||
}
|
||||
|
||||
|
||||
private void updateProjectStatus() {
|
||||
fCurrCProject= null;
|
||||
fIsProjectAsSourceFolder= false;
|
||||
|
@ -522,5 +520,4 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ import org.eclipse.swt.widgets.Composite;
|
|||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
|
||||
|
||||
private static final String PREFIX = "ErrorParserBlock"; //$NON-NLS-1$
|
||||
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
|
||||
private static final String DESC = PREFIX + ".desc"; //$NON-NLS-1$
|
||||
|
@ -280,7 +279,7 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
|
|||
fErrorParserList.setUncheckAllButtonIndex(4);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fErrorParserList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fErrorParserList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fErrorParserList.getListControl(null), true);
|
||||
|
||||
initializeValues();
|
||||
}
|
||||
|
|
|
@ -58,7 +58,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
|||
*/
|
||||
@Deprecated
|
||||
public class BinaryParserBlock extends AbstractBinaryParserPage {
|
||||
|
||||
private static final int DEFAULT_HEIGHT = 160;
|
||||
private static final String PREFIX = "BinaryParserBlock"; //$NON-NLS-1$
|
||||
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
|
||||
|
@ -75,8 +74,8 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
protected List<BinaryParserConfiguration> initialSelected;
|
||||
|
||||
protected class BinaryParserConfiguration {
|
||||
|
||||
IExtension fExtension;
|
||||
|
||||
public BinaryParserConfiguration(IExtension extension) {
|
||||
fExtension = extension;
|
||||
}
|
||||
|
@ -104,7 +103,6 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
}
|
||||
|
||||
protected class BinaryParserLabelProvider extends LabelProvider {
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
return ((BinaryParserConfiguration) element).getName();
|
||||
|
@ -129,7 +127,6 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
|
||||
public void doubleClicked(ListDialogField<BinaryParserConfiguration> field) {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
binaryList = new CheckedListDialogField<BinaryParserConfiguration>(listAdapter, buttonLabels, new BinaryParserLabelProvider()) {
|
||||
|
@ -198,7 +195,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
|
||||
Composite listComposite = ControlFactory.createComposite(composite, 1);
|
||||
LayoutUtil.doDefaultLayout(listComposite, new DialogField[]{binaryList}, true);
|
||||
LayoutUtil.setHorizontalGrabbing(binaryList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(binaryList.getListControl(null), true);
|
||||
|
||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(15);
|
||||
binaryList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
@ -218,7 +215,6 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
// fire a change event, to quick start.
|
||||
handleBinaryParserChanged();
|
||||
parent.layout(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -50,7 +50,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil;
|
|||
*/
|
||||
public class CHelpConfigurationPropertyPage extends PropertyPage implements
|
||||
IWorkbenchPreferencePage {
|
||||
|
||||
private CHelpSettingsDisplay fCHelpSettingsDisplay;
|
||||
|
||||
private class CHelpBookListLabelProvider extends LabelProvider {
|
||||
|
@ -103,7 +102,7 @@ public class CHelpConfigurationPropertyPage extends PropertyPage implements
|
|||
Composite composite= new Composite(parent, SWT.NONE);
|
||||
|
||||
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fCHelpBookList }, true);
|
||||
LayoutUtil.setHorizontalGrabbing(fCHelpBookList.getListControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fCHelpBookList.getListControl(null), true);
|
||||
|
||||
int buttonBarWidth= converter.convertWidthInCharsToPixels(24);
|
||||
fCHelpBookList.setButtonsMinWidth(buttonBarWidth);
|
||||
|
@ -189,5 +188,4 @@ public class CHelpConfigurationPropertyPage extends PropertyPage implements
|
|||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,7 +53,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
|
|||
* @noextend This class is not intended to be subclassed by clients.
|
||||
*/
|
||||
public class ExPatternEntryDialog extends StatusDialog {
|
||||
|
||||
private StringButtonDialogField fExclusionPatternDialog;
|
||||
private StatusInfo fExclusionPatternStatus;
|
||||
|
||||
|
@ -124,7 +123,7 @@ public class ExPatternEntryDialog extends StatusDialog {
|
|||
LayoutUtil.setHorizontalSpan(fExclusionPatternDialog.getLabelControl(null), 2);
|
||||
|
||||
LayoutUtil.setWidthHint(fExclusionPatternDialog.getTextControl(null), widthHint);
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternDialog.getTextControl(null));
|
||||
LayoutUtil.setHorizontalGrabbing(fExclusionPatternDialog.getTextControl(null), true);
|
||||
|
||||
fExclusionPatternDialog.postSetFocusOnDialogField(parent.getDisplay());
|
||||
applyDialogFont(composite);
|
||||
|
@ -237,5 +236,4 @@ public class ExPatternEntryDialog extends StatusDialog {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue