List of usage examples for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING
int HORIZONTAL_SPACING
To view the source code for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING.
Click Source Link
From source file:org.eclipse.datatools.connectivity.sqm.core.internal.ui.dialogs.FilterListSelectionDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { Composite parentComposite = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(1, false); parentComposite.setLayout(gridLayout); GridData data = new GridData(GridData.FILL_BOTH); parentComposite.setLayoutData(data); Composite filterComposite = new Composite(parentComposite, SWT.NONE); GridLayout filterCompositeGridLayout = new GridLayout(1, false); filterCompositeGridLayout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); filterCompositeGridLayout.horizontalSpacing = convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_SPACING); filterComposite.setLayout(filterCompositeGridLayout); filterComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); Label filterLabel = new Label(filterComposite, SWT.NULL); filterLabel.setText(ResourceLoader.getResourceLoader() .queryString("DATATOOLS.CORE.UI.DIALOGS.FILTERLISTSELECTIONDIALOG.FILTERLABEL")); //$NON-NLS-1$ filterText = new Text(filterComposite, SWT.SINGLE | SWT.BORDER); filterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); filterText.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { refreshFilter(filterText.getText()); }// ww w. j a va 2 s. c o m }); super.createDialogArea(parentComposite); return parentComposite; }
From source file:org.eclipse.datatools.sqltools.internal.sqlscrapbook.connection.FilesConnectionInfoDialog.java
License:Open Source License
/** * Add the selection and deselection buttons to the dialog. * @param composite org.eclipse.swt.widgets.Composite *//*from ww w. j a v a2s . c om*/ private void addSelectionButtons(Composite composite) { Composite buttonComposite = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 0; layout.marginWidth = 0; layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); buttonComposite.setLayout(layout); buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true, false)); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, Messages.SELECT_ALL_TITLE, false); SelectionListener listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fTableViewer.setAllChecked(true); checkOK(); } }; selectButton.addSelectionListener(listener); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, Messages.DESELECT_ALL_TITLE, false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fTableViewer.setAllChecked(false); checkOK(); } }; deselectButton.addSelectionListener(listener); _upButton = createButton(buttonComposite, IDialogConstants.CLIENT_ID, Messages.UP_TITLE, false); _downButton = createButton(buttonComposite, IDialogConstants.CLIENT_ID, Messages.DOWN_TITLE, false); _upButton.setEnabled(false); _downButton.setEnabled(false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { moveButtonAction(true); checkOK(); checkUpDownStatus(); } }; _upButton.addSelectionListener(listener); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { moveButtonAction(false); checkOK(); checkUpDownStatus(); } }; _downButton.addSelectionListener(listener); fTableViewer.getTable().addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { checkUpDownStatus(); } }); }
From source file:org.eclipse.datatools.sqltools.result.internal.ui.export.SaveResultSetDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { getShell().setData(HelpUtil.CONTEXT_PROVIDER_KEY, this); HelpUtil.setHelp(parent, HelpUtil.getContextId(IHelpConstants.DIALOG_SAVE_RESULTSET, ResultsViewUIPlugin.getDefault().getBundle().getSymbolicName())); // top level composite Composite parentComposite = (Composite) super.createDialogArea(parent); // create a composite with standard margins and spacing Composite composite = new Composite(parentComposite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout);/* w w w . j a v a2 s . com*/ composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parentComposite.getFont()); Listener listener = new Listener() { public void handleEvent(Event event) { setDialogComplete(validatePage()); } }; if (_resultset != null) { _resourceGroup = new SaveResultGroup(composite, listener, Messages.SaveResultSetDialog_filename, //$NON-NLS-1$ "file", _resultset, _listener); //$NON-NLS-1$ } else if (_resultInstance != null) { _resourceGroup = new SaveResultGroup(composite, listener, Messages.SaveResultSetDialog_filename, //$NON-NLS-1$ "file", _resultInstance, _listener); //$NON-NLS-1$ } _resourceGroup.setAllowExistingResources(true); return parentComposite; }
From source file:org.eclipse.datatools.sqltools.schemaobjecteditor.ui.internal.ui.SaveAsDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { // top level composite Composite parentComposite = (Composite) super.createDialogArea(parent); // create a composite with standard margins and spacing Composite composite = new Composite(parentComposite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout);//from w ww. j av a 2s .c om composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parentComposite.getFont()); Listener listener = new Listener() { public void handleEvent(Event event) { setDialogComplete(validatePage()); } }; _resourceGroup = new ResourceAndContainerGroup(composite, listener, "", "file", _listener); //$NON-NLS-1$ //$NON-NLS-2$ _resourceGroup.setAllowExistingResources(true); return parentComposite; }
From source file:org.eclipse.debug.internal.ui.sourcelookup.browsers.DirectorySourceContainerDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { Image image = (fNewContainer) ? DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_ADD_SRC_DIR_WIZ) : DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_EDIT_SRC_DIR_WIZ); setTitle(SourceLookupUIMessages.DirectorySourceContainerDialog_2); setMessage(SourceLookupUIMessages.DirectorySourceContainerDialog_3); setTitleImage(image);/* w w w . j ava 2 s . co m*/ Composite parentComposite = (Composite) super.createDialogArea(parent); Font font = parentComposite.getFont(); Composite composite = new Composite(parentComposite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(font); Composite dirComposite = new Composite(composite, SWT.NONE); layout = new GridLayout(2, false); dirComposite.setLayout(layout); dirComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dirComposite.setFont(font); Label label = new Label(dirComposite, SWT.NONE); label.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_4); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; label.setLayoutData(data); label.setFont(font); fDirText = new Text(dirComposite, SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 1; fDirText.setLayoutData(data); fDirText.setFont(font); fDirText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validate(); } }); Button button = new Button(dirComposite, SWT.PUSH); button.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_5); data = new GridData(); int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); data.widthHint = Math.max(widthHint, minSize.x); button.setLayoutData(data); button.setFont(JFaceResources.getDialogFont()); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { browse(); } }); fSubfoldersButton = new Button(composite, SWT.CHECK); fSubfoldersButton.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_6); return parentComposite; }
From source file:org.eclipse.debug.ui.sourcelookup.SourceLookupDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { // create a composite with standard margins and spacing setTitle(SourceLookupUIMessages.manageSourceDialog_description); setTitleImage(DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_EDIT_SRC_LOC_WIZ)); setMessage(SourceLookupUIMessages.SourceLookupDialog_add_edit_remove); Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout);//from www . j a v a2 s. com GridData data = new GridData(GridData.FILL_BOTH); composite.setLayoutData(data); composite.setFont(parent.getFont()); fPanel = new SourceLookupPanel(); fPanel.createControl(composite); fPanel.initializeFrom(fDirector); Dialog.applyDialogFont(composite); ILaunchConfiguration config = fDirector.getLaunchConfiguration(); if (config != null && config.isReadOnly()) { setErrorMessage(SourceLookupUIMessages.SourceLookupDialog_0 + config.getName() + SourceLookupUIMessages.SourceLookupDialog_1); } PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IDebugHelpContextIds.EDIT_SOURCELOOKUP_DIALOG); return composite; }
From source file:org.eclipse.dltk.internal.ui.callhierarchy.FiltersDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { Composite superComposite = (Composite) super.createDialogArea(parent); Composite composite = new Composite(superComposite, SWT.NONE); composite.setFont(superComposite.getFont()); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout);/*w w w.ja v a 2s . c om*/ createNamesArea(composite); new Label(composite, SWT.NONE); // Filler createMaxCallDepthArea(composite); updateUIFromFilter(); return composite; }
From source file:org.eclipse.dltk.internal.ui.filters.CustomFiltersDialog.java
License:Open Source License
/** * Overrides method in Dialog//from w w w . ja v a 2 s . c o m * * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite) */ protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent); // create a composite with standard margins and spacing Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parent.getFont()); Composite group = composite; // Checkbox fEnableUserDefinedPatterns = new Button(group, SWT.CHECK); fEnableUserDefinedPatterns.setFocus(); fEnableUserDefinedPatterns.setText(FilterMessages.CustomFiltersDialog_enableUserDefinedPattern); // Pattern field fUserDefinedPatterns = new Text(group, SWT.SINGLE | SWT.BORDER); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.widthHint = convertWidthInCharsToPixels(59); fUserDefinedPatterns.setLayoutData(data); String patterns = convertToString(fPatterns, SEPARATOR); fUserDefinedPatterns.setText(patterns); // Info text final Label info = new Label(group, SWT.LEFT); info.setText(FilterMessages.CustomFiltersDialog_patternInfo); // Enabling / disabling of pattern group fEnableUserDefinedPatterns.setSelection(fEnablePatterns); fUserDefinedPatterns.setEnabled(fEnablePatterns); info.setEnabled(fEnablePatterns); fEnableUserDefinedPatterns.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { boolean state = fEnableUserDefinedPatterns.getSelection(); fUserDefinedPatterns.setEnabled(state); info.setEnabled(fEnableUserDefinedPatterns.getSelection()); if (state) fUserDefinedPatterns.setFocus(); } }); // Filters provided by extension point if (fBuiltInFilters.length > 0) createCheckBoxList(group); applyDialogFont(parent); return parent; }
From source file:org.eclipse.dltk.mod.internal.ui.filters.CustomFiltersDialog.java
License:Open Source License
/** * Overrides method in Dialog//from w w w. j a va 2s .co m * * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite) */ protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent); // create a composite with standard margins and spacing Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parent.getFont()); Composite group = composite; // Checkbox fEnableUserDefinedPatterns = new Button(group, SWT.CHECK); fEnableUserDefinedPatterns.setFocus(); fEnableUserDefinedPatterns.setText(FilterMessages.CustomFiltersDialog_enableUserDefinedPattern); // Pattern field fUserDefinedPatterns = new Text(group, SWT.SINGLE | SWT.BORDER); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.widthHint = convertWidthInCharsToPixels(59); fUserDefinedPatterns.setLayoutData(data); String patterns = convertToString(fPatterns, SEPARATOR); fUserDefinedPatterns.setText(patterns); // Info text final Label info = new Label(group, SWT.LEFT); info.setText(FilterMessages.CustomFiltersDialog_patternInfo); // Enabling / disabling of pattern group fEnableUserDefinedPatterns.setSelection(fEnablePatterns); fUserDefinedPatterns.setEnabled(fEnablePatterns); info.setEnabled(fEnablePatterns); fEnableUserDefinedPatterns.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { boolean state = fEnableUserDefinedPatterns.getSelection(); fUserDefinedPatterns.setEnabled(state); info.setEnabled(fEnableUserDefinedPatterns.getSelection()); if (state) fUserDefinedPatterns.setFocus(); } }); // Filters provided by extension point if (fBuiltInFilters.length > 0) createCheckBoxList(group); applyDialogFont(parent); return parent; }
From source file:org.eclipse.dltk.mod.ui.preferences.NewScriptProjectPreferencePage.java
License:Open Source License
protected Control createContents(Composite parent) { initializeDialogUnits(parent);/*from ww w . j av a 2 s .c o m*/ Composite result = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = 0; layout.verticalSpacing = convertVerticalDLUsToPixels(10); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.numColumns = 2; result.setLayout(layout); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; Group sourceFolderGroup = new Group(result, SWT.NONE); layout = new GridLayout(); layout.numColumns = 2; sourceFolderGroup.setLayout(layout); sourceFolderGroup.setLayoutData(gd); sourceFolderGroup.setText(PreferencesMessages.NewScriptProjectPreferencePage_sourcefolder_label); int indent = 0; fProjectAsSourceFolder = addRadioButton(sourceFolderGroup, PreferencesMessages.NewScriptProjectPreferencePage_sourcefolder_project, SRCBIN_FOLDERS_IN_NEWPROJ, IPreferenceStore.FALSE, indent); fProjectAsSourceFolder.addSelectionListener(fSelectionListener); fFoldersAsSourceFolder = addRadioButton(sourceFolderGroup, PreferencesMessages.NewScriptProjectPreferencePage_sourcefolder_folder, SRCBIN_FOLDERS_IN_NEWPROJ, IPreferenceStore.TRUE, indent); fFoldersAsSourceFolder.addSelectionListener(fSelectionListener); indent = convertWidthInCharsToPixels(4); fSrcFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE); fSrcFolderNameLabel.setText(PreferencesMessages.NewScriptProjectPreferencePage_folders_src); fSrcFolderNameText = addTextControl(sourceFolderGroup, fSrcFolderNameLabel, SRC_SRCNAME, indent); fSrcFolderNameText.addModifyListener(fModifyListener); // String[] InterpreterEnvironmentNames= getInterpreterEnvironmentNames(); // if (InterpreterEnvironmentNames.length > 0) { // Label InterpreterEnvironmentSelectionLabel= new Label(result, SWT.NONE); // InterpreterEnvironmentSelectionLabel.setText(PreferencesMessages.NewScriptProjectPreferencePage_InterpreterEnvironmentlibrary_label); // InterpreterEnvironmentSelectionLabel.setLayoutData(new GridData()); // // int index= getPreferenceStore().getInt(CLASSPATH_InterpreterEnvironmentLIBRARY_INDEX); // fInterpreterEnvironmentCombo= new Combo(result, SWT.READ_ONLY); // fInterpreterEnvironmentCombo.setItems(InterpreterEnvironmentNames); // fInterpreterEnvironmentCombo.select(index); // fInterpreterEnvironmentCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); // } validateFolders(); Dialog.applyDialogFont(result); return result; }