Java Code Examples for org.eclipse.swt.layout.GridData#GRAB_HORIZONTAL
The following examples show how to use
org.eclipse.swt.layout.GridData#GRAB_HORIZONTAL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SWTButtonWidget.java From atdl4j with MIT License | 6 votes |
public Widget createWidget(Composite parent, int style) { // button button = new Button( parent, style | ( control instanceof RadioButtonT ? SWT.RADIO : SWT.CHECK ) ); GridData gd = new GridData( GridData.GRAB_HORIZONTAL ); gd.horizontalSpan = 2; button.setLayoutData( gd ); if ( control.getLabel() != null ) button.setText( control.getLabel() ); if ( getTooltip() != null ) button.setToolTipText( getTooltip() ); Boolean tempInitValue = (Boolean) ControlHelper.getInitValue( control, getAtdl4jOptions() ); if ( tempInitValue != null ) { setValue( tempInitValue ); } return parent; }
Example 2
Source File: LogFileTypeDialog.java From LogViewer with Eclipse Public License 2.0 | 6 votes |
protected Control createDialogArea(Composite parent) { String fileTypeName = "File"; // create composite Composite composite = (Composite) super.createDialogArea(parent); // create combo typeCombo = new Combo(composite,SWT.LEFT); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); typeCombo.setLayoutData(data); // fill IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); typeCombo.add(fileTypeName); value = fileTypeName; for (int i=0;i<consoles.length;i++) { typeCombo.add("Console: " + consoles[i].getName()); } applyDialogFont(composite); return composite; }
Example 3
Source File: DataSetComputedColumnsPage.java From birt with Eclipse Public License 1.0 | 6 votes |
/** * * @param parent */ private void createParameterContainer( Composite parent ) { parameterContainer = new Composite( parent, SWT.NONE ); GridData gridData = new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ); gridData.horizontalIndent = 0; gridData.horizontalSpan = 3; gridData.exclude = true; parameterContainer.setLayoutData( gridData ); GridLayout layout = new GridLayout( ); // layout.horizontalSpacing = layout.verticalSpacing = 0; layout.marginWidth = layout.marginHeight = 0; layout.numColumns = 3; parameterContainer.setLayout( layout ); }
Example 4
Source File: CloudForgeComposite.java From APICloud-Studio with GNU General Public License v3.0 | 6 votes |
private void createControls() { Composite cloudForgeComposite = new Composite(this, SWT.NULL); GridLayout layout = new GridLayout(); layout.numColumns = 1; cloudForgeComposite.setLayout(layout); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL); cloudForgeComposite.setLayoutData(data); ImageHyperlink cloudForgeLink = new ImageHyperlink(cloudForgeComposite, SWT.NONE); cloudForgeLink.setImage(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_CLOUDFORGE).createImage()); cloudForgeLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent evt) { try { PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(SIGNUP_URL)); } catch (Exception e) { MessageDialog.openError(getShell(), "Sign-up for CloudForge", e.getMessage()); } } }); cloudForgeLink.setToolTipText(SIGNUP_URL); }
Example 5
Source File: TexlipsePreferencePage.java From texlipse with Eclipse Public License 1.0 | 5 votes |
/** * Add a horizontal line to the page. * @param span number of horizontal columns to span * @param parent parent container */ public static void addSeparator(int span, Composite parent) { Label empty = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR); GridData lgd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); lgd.horizontalSpan = span; empty.setLayoutData(lgd); }
Example 6
Source File: ScriptEditor.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
@Override protected Control createDialogArea(Composite parent){ Composite ret = new Composite(parent, SWT.NONE); GridData full = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); ret.setLayoutData(full); ret.setLayout(new FillLayout()); text = new Text(ret, SWT.MULTI | SWT.BORDER); text.setText(StringTool.unNull(script)); return ret; }
Example 7
Source File: TabPageIndentation.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
private void configurePreview(Composite composite, int numColumns) { SWTFactory.createLabel(composite, Messages.IndentationTabPage_Preview+':', numColumns); fPreview = new FormatterPreview(composite, "indent_preview.mod", XdsSourceType.Modula); //$NON-NLS-1$ final GridData gd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = numColumns; gd.widthHint = 0; gd.heightHint = 0; fPreview.getTextWidget().setLayoutData(gd); fPreview.setProfile(fp); }
Example 8
Source File: TextMatePreferencePage.java From tm4e with Eclipse Public License 1.0 | 5 votes |
private void addRelatedLink(Composite parent, String pageId, String message) { PreferenceLinkArea contentTypeArea = new PreferenceLinkArea(parent, SWT.NONE, pageId, message, (IWorkbenchPreferenceContainer) getContainer(), null); GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); contentTypeArea.getControl().setLayoutData(data); }
Example 9
Source File: TabPageNewLines.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
private void configurePreview(Composite composite, int numColumns) { SWTFactory.createLabel(composite, Messages.IndentationTabPage_Preview+':', numColumns); fPreview = new FormatterPreview(composite, "newlines_preview.mod", XdsSourceType.Modula); //$NON-NLS-1$ final GridData gd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = numColumns; gd.widthHint = 0; gd.heightHint = 0; fPreview.getTextWidget().setLayoutData(gd); fPreview.setProfile(fp); }
Example 10
Source File: FindbugsPropertyPage.java From spotbugs with GNU Lesser General Public License v2.1 | 5 votes |
private void createConfigurationTabFolder(Composite composite) { tabFolder = new TabFolder(composite, SWT.TOP); GridData layoutData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL | GridData.FILL_VERTICAL | GridData.GRAB_VERTICAL); layoutData.verticalIndent = -5; tabFolder.setLayoutData(layoutData); reportConfigurationTab = createReportConfigurationTab(tabFolder); filterFilesTab = createFilterFilesTab(tabFolder); workspaceSettingsTab = createWorkspaceSettings(tabFolder); detectorTab = createDetectorConfigurationTab(tabFolder); }
Example 11
Source File: InputDialogWithLongMessage.java From Pydev with Eclipse Public License 1.0 | 5 votes |
@Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); // create message if (message != null) { Text messageText = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL); messageText.setText(message); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); messageText.setLayoutData(data); messageText.setFont(parent.getFont()); } text = new Text(composite, getInputTextStyle()); text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); text.addModifyListener(e -> validateInput()); errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP); errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); errorMessageText.setBackground(errorMessageText.getDisplay() .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); // Set the error message text // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292 setErrorMessage(errorMessage); applyDialogFont(composite); return composite; }
Example 12
Source File: HtmlDialog.java From nebula with Eclipse Public License 2.0 | 5 votes |
@Override protected Control createDialogArea(Composite parent) { Composite c = (Composite) super.createDialogArea(parent); b = new Browser(c, SWT.BORDER); GridData gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); b.setLayoutData(gd); b.setText(html); b.setSize(500, 500); if (listener != null) { b.addLocationListener(listener); } b.setMenu(pageOverviewGetPopup()); return c; }
Example 13
Source File: UrlCombo.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
private void createCombo() { GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; setLayout(layout); combo = new Combo(this, SWT.BORDER); GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); gridData.widthHint = URL_WIDTH_HINT; combo.setLayoutData(gridData); }
Example 14
Source File: WizardSaveAsPage.java From birt with Eclipse Public License 1.0 | 4 votes |
/** * Creates this object's visual components. * * @param parent * org.eclipse.swt.widgets.Composite * @param heightHint * height hint for the container selection widget group */ protected void createContents( Composite parent, String resourceLabelString, int heightHint ) { Font font = parent.getFont( ); // server name group Composite composite = new Composite( parent, SWT.NONE ); GridLayout layout = new GridLayout( ); layout.marginWidth = 0; layout.marginHeight = 0; composite.setLayout( layout ); composite.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) ); composite.setFont( font ); // container group if ( heightHint == SWT.DEFAULT ) containerGroup = new ContainerSelectionGroup( composite, this, true, null, showClosedProjects ); else containerGroup = new ContainerSelectionGroup( composite, this, true, null, showClosedProjects, heightHint ); // resource name group Composite nameGroup = new Composite( composite, SWT.NONE ); layout = new GridLayout( ); layout.numColumns = 2; layout.marginWidth = 0; nameGroup.setLayout( layout ); nameGroup.setLayoutData( new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL ) ); nameGroup.setFont( font ); Label label = new Label( nameGroup, SWT.NONE ); label.setText( resourceLabelString ); label.setFont( font ); // resource name entry field resourceNameField = new Text( nameGroup, SWT.BORDER ); resourceNameField.addListener( SWT.Modify, this ); GridData data = new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL ); data.widthHint = SIZING_TEXT_FIELD_WIDTH; resourceNameField.setLayoutData( data ); resourceNameField.setFont( font ); validateControls( ); }
Example 15
Source File: GroupSelectionDialog.java From spotbugs with GNU Lesser General Public License v2.1 | 4 votes |
@Override protected Control createDialogArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); int columns = 2; composite.setLayout(new GridLayout(columns, false)); GridData layoutData = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_HORIZONTAL); layoutData.minimumHeight = 200; layoutData.minimumWidth = 250; layoutData.heightHint = 200; layoutData.widthHint = 250; composite.setLayoutData(layoutData); checkList = CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.BORDER | SWT.RESIZE | SWT.V_SCROLL | SWT.H_SCROLL); Table table = checkList.getTable(); table.setHeaderVisible(true); table.setLinesVisible(false); table.setLayoutData(new GridData(GridData.FILL_BOTH)); TableColumn nameColumn = new TableColumn(table, SWT.NONE); nameColumn.setText("Group Visibility / Sort Order"); nameColumn.setResizable(true); nameColumn.setWidth(170); checkList.setContentProvider(new ArrayContentProvider()); // ITableLabelProvider labelProvider= new SeparateTableLabelProvider(); // checkList.setLabelProvider(labelProvider); checkList.setInput(allowedGroups); checkList.setCheckedElements(preSelectedGroups.toArray()); checkList.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(CheckStateChangedEvent event) { boolean checked = event.getChecked(); GroupType element = (GroupType) event.getElement(); selectionMap.put(element, Boolean.valueOf(checked)); } }); table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleTableSelection(); } }); createButtonList(composite); return composite; }
Example 16
Source File: SDViewerPage.java From tracecompass with Eclipse Public License 2.0 | 4 votes |
@Override protected Control createContents(Composite parent) { GridLayout gl = new GridLayout(); gl.marginHeight = 0; gl.marginWidth = 0; parent.setLayout(gl); Composite page = new Composite(parent, SWT.NONE); GridLayout pageLayout = new GridLayout(); pageLayout.numColumns = 2; GridData pageLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); page.setLayoutData(pageLayoutdata); page.setLayout(pageLayout); fTooltip = new BooleanFieldEditor(ISDPreferences.PREF_TOOLTIP, Messages.SequenceDiagram_ShowTooltips, page); fTooltip.setPreferenceStore(fPreferences.getPreferenceStore()); fTooltip.load(); // link font with zoom pref fLink = new BooleanFieldEditor(ISDPreferences.PREF_LINK_FONT, Messages.SequenceDiagram_IncreaseFontSizeWhenZooming, page); fLink.setPreferenceStore(fPreferences.getPreferenceStore()); fLink.load(); fNoExternalTime = new BooleanFieldEditor(ISDPreferences.PREF_EXCLUDE_EXTERNAL_TIME, Messages.SequenceDiagram_ExcludeExternalTime, page); fNoExternalTime.setPreferenceStore(fPreferences.getPreferenceStore()); fNoExternalTime.load(); // use gradient color pref fUseGrad = new BooleanFieldEditor(ISDPreferences.PREF_USE_GRADIENT, Messages.SequenceDiagram_UseGradientColor, page); fUseGrad.setPreferenceStore(fPreferences.getPreferenceStore()); fUseGrad.load(); Label separator = new Label(page, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE); GridData sepData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL); separator.setLayoutData(sepData); Composite prefPage = new Composite(page, SWT.NONE); GridLayout prefPageLayout = new GridLayout(); prefPage.setLayoutData(pageLayoutdata); prefPageLayout.numColumns = 1; prefPage.setLayout(prefPageLayout); // swimLane width pref fLifelineWidth = new IntegerFieldEditor(ISDPreferences.PREF_LIFELINE_WIDTH, Messages.SequenceDiagram_LifelineWidth, prefPage); fLifelineWidth.setPreferenceStore(fPreferences.getPreferenceStore()); fLifelineWidth.setValidRange(119, 500); fLifelineWidth.load(); // not very nice new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE); new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE); // Font list pref fClassItemList = new List(prefPage, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); GridData tabItemLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); fClassItemList.setLayoutData(tabItemLayoutdata); String[] fontList2 = SDViewPref.getFontList2(); for (int i = 0; i < fontList2.length; i++) { fClassItemList.add(fontList2[i]); } fClassItemList.setSelection(0); fClassItemList.addSelectionListener(this); fButtonArea = new Composite(prefPage, SWT.NONE); GridData tabItemLayoutdata2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL/* |GridData.GRAB_HORIZONTAL */| GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); fButtonArea.setLayoutData(tabItemLayoutdata2); GridLayout buttonAreaLayout = new GridLayout(); buttonAreaLayout.numColumns = 1; fButtonArea.setLayout(buttonAreaLayout); // font selector initialise for the lifeline font pref String[] fontList = SDViewPref.getFontList(); fFont = new FontFieldEditor(fontList[0], "",//$NON-NLS-1$ Messages.SequenceDiagram_AaBbYyZz, fButtonArea); fFont.getPreviewControl().setSize(500, 500); fFont.setPreferenceStore(fPreferences.getPreferenceStore()); fFont.load(); fBackGroundColor = new ColorFieldEditor(fontList[0] + SDViewPref.BACK_COLOR_POSTFIX, Messages.SequenceDiagram_Background, fButtonArea); fBackGroundColor.setPreferenceStore(fPreferences.getPreferenceStore()); fBackGroundColor.load(); fLineColor = new ColorFieldEditor(fontList[0] + SDViewPref.FORE_COLOR_POSTFIX, Messages.SequenceDiagram_Lines, fButtonArea); fLineColor.setPreferenceStore(fPreferences.getPreferenceStore()); fLineColor.load(); fTextColor = new ColorFieldEditor(fontList[0] + SDViewPref.TEXT_COLOR_POSTFIX, Messages.SequenceDiagram_Text, fButtonArea); fTextColor.setPreferenceStore(fPreferences.getPreferenceStore()); fTextColor.load(); swapPref(true); Dialog.applyDialogFont(page); return page; }
Example 17
Source File: UpdateTMWizardPage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
public void createContent(Composite parent) { TableViewer tableViewer = new TableViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION); final Table table = tableViewer.getTable(); GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); tableData.heightHint = 160; table.setLayoutData(tableData); table.setLinesVisible(true); table.setHeaderVisible(true); TableColumn columnNumber = new TableColumn(table, SWT.LEFT); columnNumber.setText(Messages.getString("wizard.UpdateTMWizardPage.columnNumber")); columnNumber.setWidth(50); TableColumn columnPath = new TableColumn(table, SWT.LEFT); columnPath.setText(Messages.getString("wizard.UpdateTMWizardPage.columnPath")); columnPath.setWidth(400); tableViewer.setLabelProvider(new TableViewerLabelProvider()); tableViewer.setContentProvider(new ArrayContentProvider()); tableViewer.setInput(getTableInfo()); Group groupStatus = new Group(parent, SWT.None); groupStatus.setLayout(new GridLayout()); groupStatus.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); groupStatus.setText(Messages.getString("dialog.UpdateTMDialog.lbl")); btnDraft = new Button(groupStatus, SWT.CHECK); btnDraft.setText(Messages.getString("dialog.UpdateTMDialog.btnDraft")); btnTranslated = new Button(groupStatus, SWT.CHECK); btnTranslated.setText(Messages.getString("dialog.UpdateTMDialog.btnTranslated")); btnTranslated.setSelection(true); btnApproved = new Button(groupStatus, SWT.CHECK); btnApproved.setText(Messages.getString("dialog.UpdateTMDialog.btnApproved")); btnApproved.setSelection(true); btnSignedOff = new Button(groupStatus, SWT.CHECK); btnSignedOff.setText(Messages.getString("dialog.UpdateTMDialog.btnSignedOff")); btnSignedOff.setSelection(true); btnLocked = new Button(groupStatus, SWT.CHECK); btnLocked.setText(Messages.getString("dialog.UpdateTMWizardPage.btnLocked")); }
Example 18
Source File: AbstractJarDestinationWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
@Override protected void createDestinationGroup(Composite parent) { initializeDialogUnits(parent); // destination specification group Composite destinationSelectionGroup= new Composite(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.numColumns= 3; destinationSelectionGroup.setLayout(layout); destinationSelectionGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); String label= getDestinationLabel(); if (label != null) { new Label(destinationSelectionGroup, SWT.NONE).setText(label); } else { layout.marginWidth= 0; layout.marginHeight= 0; } // destination name entry field fDestinationNamesCombo= new Combo(destinationSelectionGroup, SWT.SINGLE | SWT.BORDER); SWTUtil.setDefaultVisibleItemCount(fDestinationNamesCombo); fDestinationNamesCombo.addListener(SWT.Modify, this); fDestinationNamesCombo.addListener(SWT.Selection, this); GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.widthHint= SIZING_TEXT_FIELD_WIDTH; data.horizontalSpan= label == null ? 2 : 1; fDestinationNamesCombo.setLayoutData(data); if (label == null) { SWTUtil.setAccessibilityText(fDestinationNamesCombo, JarPackagerMessages.AbstractJarDestinationWizardPage_destinationCombo_AccessibilityText); } // destination browse button fDestinationBrowseButton= new Button(destinationSelectionGroup, SWT.PUSH); fDestinationBrowseButton.setText(JarPackagerMessages.JarPackageWizardPage_browseButton_text); fDestinationBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); SWTUtil.setButtonDimensionHint(fDestinationBrowseButton); fDestinationBrowseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleDestinationBrowseButtonPressed(); } }); }
Example 19
Source File: OptionsPage.java From APICloud-Studio with GNU General Public License v3.0 | 4 votes |
public void createControl(Composite parent) { Composite composite= new Composite(parent, SWT.NULL); GridLayout layout= new GridLayout(); composite.setLayout(layout); composite.setLayoutData(new GridData()); setControl(composite); // set F1 help PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.PATCH_OPTIONS_PAGE); //Unified Format Options Group unifiedGroup = new Group(composite, SWT.None); layout = new GridLayout(); unifiedGroup.setLayout(layout); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); unifiedGroup.setLayoutData(data); unifiedGroup.setText(Policy.bind("OptionsPage.patchRoot")); //$NON-NLS-1$ workspaceRelativeOption = new Button(unifiedGroup, SWT.RADIO); workspaceRelativeOption.setText(Policy.bind("OptionsPage.workspace")); //$NON-NLS-1$ workspaceRelativeOption.setSelection(true); projectRelativeOption = new Button(unifiedGroup, SWT.RADIO); projectRelativeOption.setText(Policy.bind("OptionsPage.project")); //$NON-NLS-1$ selectionRelativeOption = new Button(unifiedGroup, SWT.RADIO); selectionRelativeOption.setText(Policy.bind("OptionsPage.selection")); //$NON-NLS-1$ Dialog.applyDialogFont(parent); //check to see if this is a multi select patch, if so disable IResource[] tempResources = ((GenerateDiffFileWizard)this.getWizard()).getResources(); Set projects = new HashSet(); for (int i = 0; i < tempResources.length; i++) { projects.add(tempResources[i].getProject()); } if (projects.size() > 1) { projectRelativeOption.setEnabled(false); selectionRelativeOption.setEnabled(false); } workspaceRelativeOption.setSelection(true); }
Example 20
Source File: CompositeTableSnippet6.java From nebula with Eclipse Public License 2.0 | 4 votes |
private GridData spanGD() { GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); gd.horizontalSpan=2; return gd; }