List of usage examples for org.eclipse.jface.dialogs IDialogConstants VERTICAL_SPACING
int VERTICAL_SPACING
To view the source code for org.eclipse.jface.dialogs IDialogConstants VERTICAL_SPACING.
Click Source Link
From source file:org.rssowl.ui.internal.dialogs.SearchMarkDialog.java
License:Open Source License
@Override protected Control createButtonBar(Composite parent) { GridLayout layout = new GridLayout(1, false); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); Composite buttonBar = new Composite(parent, SWT.NONE); buttonBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); buttonBar.setLayout(layout);/* w ww . j ava 2s . com*/ /* Status Label */ Link previewLink = new Link(buttonBar, SWT.NONE); previewLink.setText(Messages.SearchMarkDialog_PREVIEW_RESULTS); applyDialogFont(previewLink); previewLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); previewLink.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { onPreview(); } }); /* OK */ Button okButton = createButton(buttonBar, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); ((GridData) okButton.getLayoutData()).horizontalAlignment = SWT.END; /* Cancel */ createButton(buttonBar, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); return buttonBar; }
From source file:org.rssowl.ui.internal.dialogs.SearchNewsDialog.java
License:Open Source License
@Override protected Control createButtonBar(Composite parent) { GridLayout layout = new GridLayout(1, false); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); Composite buttonBar = new Composite(parent, SWT.NONE); buttonBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); buttonBar.setLayout(layout);/*from w w w . j a va 2s .c o m*/ /* Status Label */ fStatusLabel = new Link(buttonBar, SWT.NONE); fStatusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); fStatusLabel.setText(""); //$NON-NLS-1$ applyDialogFont(fStatusLabel); fStatusLabel.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { onSave(); } }); /* Search */ Button searchButton = createButton(buttonBar, BUTTON_SEARCH, Messages.SearchNewsDialog_SEARCH, true); ((GridData) searchButton.getLayoutData()).horizontalAlignment = SWT.END; ((GridData) searchButton.getLayoutData()).grabExcessHorizontalSpace = false; /* Clear */ createButton(buttonBar, BUTTON_CLEAR, Messages.SearchNewsDialog_CLEAR, false); /* Close */ Button closeButton = createButton(buttonBar, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, false); closeButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { close(); } }); return buttonBar; }
From source file:org.rubypeople.rdt.internal.ui.filters.CustomFiltersDialog.java
License:Open Source License
/** * Overrides method in Dialog/*ww w. ja va 2 s . com*/ * * @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.rubypeople.rdt.internal.ui.preferences.formatter.CreateProfileDialog.java
License:Open Source License
public Control createDialogArea(Composite parent) { final int numColumns = 2; GridData gd;/* w ww. j a v a 2 s .c o m*/ final GridLayout layout = new GridLayout(numColumns, false); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); final Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(layout); // Create "Profile name:" label gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = numColumns; gd.widthHint = convertWidthInCharsToPixels(60); final Label nameLabel = new Label(composite, SWT.WRAP); nameLabel.setText(FormatterMessages.CreateProfileDialog_profile_name_label_text); nameLabel.setLayoutData(gd); // Create text field to enter name gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = numColumns; fNameText = new Text(composite, SWT.SINGLE | SWT.BORDER); fNameText.setLayoutData(gd); fNameText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { doValidation(); } }); // Create "Initialize settings ..." label gd = new GridData(); gd.horizontalSpan = numColumns; Label profileLabel = new Label(composite, SWT.WRAP); profileLabel.setText(FormatterMessages.CreateProfileDialog_base_profile_label_text); profileLabel.setLayoutData(gd); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = numColumns; fProfileCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY); fProfileCombo.setLayoutData(gd); // "Open the edit dialog now" checkbox gd = new GridData(); gd.horizontalSpan = numColumns; fEditCheckbox = new Button(composite, SWT.CHECK); fEditCheckbox.setText(FormatterMessages.CreateProfileDialog_open_edit_dialog_checkbox_text); fEditCheckbox.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { fOpenEditDialog = ((Button) e.widget).getSelection(); } public void widgetDefaultSelected(SelectionEvent e) { } }); final IDialogSettings dialogSettings = RubyPlugin.getDefault().getDialogSettings();// .get(PREF_OPEN_EDIT_DIALOG); if (dialogSettings.get(PREF_OPEN_EDIT_DIALOG) != null) { fOpenEditDialog = dialogSettings.getBoolean(PREF_OPEN_EDIT_DIALOG); } else { fOpenEditDialog = true; } fEditCheckbox.setSelection(fOpenEditDialog); fProfileCombo.setItems(fSortedNames); fProfileCombo.setText(fProfileManager.getProfile(ProfileManager.DEFAULT_PROFILE).getName()); updateStatus(fEmpty); applyDialogFont(composite); fNameText.setFocus(); return composite; }
From source file:org.rubypeople.rdt.internal.ui.preferences.formatter.RenameProfileDialog.java
License:Open Source License
public Control createDialogArea(Composite parent) { final int numColumns = 2; 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); layout.numColumns = numColumns;//w w w. ja va 2s . co m final Composite composite = new Composite(parent, SWT.NULL); composite.setLayout(layout); // Create "Please enter a new name:" label GridData gd = new GridData(); gd.horizontalSpan = numColumns; gd.widthHint = convertWidthInCharsToPixels(60); fNameLabel = new Label(composite, SWT.NONE); fNameLabel.setText(FormatterMessages.RenameProfileDialog_dialog_label_enter_a_new_name); fNameLabel.setLayoutData(gd); // Create text field to enter name gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = numColumns; fNameText = new Text(composite, SWT.SINGLE | SWT.BORDER); if (fProfile instanceof SharedProfile) { fNameText.setText(fProfile.getName()); } fNameText.setSelection(0, fProfile.getName().length()); fNameText.setLayoutData(gd); fNameText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { doValidation(); } }); fNameText.setText(fProfile.getName()); fNameText.selectAll(); applyDialogFont(composite); return composite; }
From source file:org.sasylf.util.QuickFixPage.java
License:Open Source License
/** * Create the table buttons for the receiver. * /* www . j av a2 s. c om*/ * @param control * @return {@link Composite} */ private Composite createTableButtons(Composite control) { Composite buttonComposite = new Composite(control, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); buttonComposite.setLayout(layout); Button selectAll = new Button(buttonComposite, SWT.PUSH); selectAll.setText("Select All"); selectAll.setLayoutData(new GridData(SWT.FILL, SWT.NONE, false, false)); selectAll.addSelectionListener(new SelectionAdapter() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ public void widgetSelected(SelectionEvent arg0) { markersTable.setAllChecked(true); setPageComplete(!resolutionsList.getSelection().isEmpty()); } }); Button deselectAll = new Button(buttonComposite, SWT.PUSH); deselectAll.setText("Deselect All"); deselectAll.setLayoutData(new GridData(SWT.FILL, SWT.NONE, false, false)); deselectAll.addSelectionListener(new SelectionAdapter() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ public void widgetSelected(SelectionEvent arg0) { markersTable.setAllChecked(false); setPageComplete(false); } }); return buttonComposite; }
From source file:org.seasar.uruma.ui.dialogs.UrumaErrorDialog.java
License:Apache License
@Override protected Control createDialogArea(final Composite parent) { createMessageArea(parent);/* ww w . ja v a 2 s. c om*/ // 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); layout.numColumns = 2; composite.setLayout(layout); GridData childData = new GridData(SWT.FILL, SWT.FILL, true, false); childData.horizontalSpan = 2; composite.setLayoutData(childData); composite.setFont(parent.getFont()); return composite; }
From source file:org.springsource.ide.eclipse.commons.frameworks.ui.internal.plugins.CommandDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { setTitle(getTitle());// w w w. ja v a 2s.co m setMessage(getMessage()); // FIXME setTitleImage(GrailsUiActivator.getImageDescriptor("icons/full/wizban/grails_wizban.png").createImage()); Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().margins(getDefaultCompositeHMargin(), getDefaultCompositeVMargin()) .spacing(convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING), convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING)) .applyTo(composite); Dialog.applyDialogFont(composite); GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); createCommandArea(composite); return composite; }
From source file:org.summer.dsl.ui.codetemplates.ui.preferences.EditTemplateDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite ancestor) { Composite parent = new Composite(ancestor, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2;// w w w . j a v a 2s . c o m layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); parent.setLayout(layout); parent.setLayoutData(new GridData(GridData.FILL_BOTH)); ModifyListener listener = new ModifyListener() { public void modifyText(ModifyEvent e) { doTextWidgetChanged(e.widget); } }; if (fIsNameModifiable) { createLabel(parent, TemplateDialogMessages.EditTemplateDialog_name); Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); layout = new GridLayout(); layout.numColumns = 4; layout.marginWidth = 0; layout.marginHeight = 0; composite.setLayout(layout); fNameText = createText(composite); createLabel(composite, TemplateDialogMessages.EditTemplateDialog_context); fContextCombo = new Combo(composite, SWT.READ_ONLY); fContextCombo.setVisibleItemCount(30); // default for (int i = 0; i < fContextTypes.length; i++) { fContextCombo.add(fContextTypes[i][1]); } fContextCombo.addModifyListener(listener); fAutoInsertCheckbox = createCheckbox(composite, TemplateDialogMessages.EditTemplateDialog_autoinsert); fAutoInsertCheckbox.setSelection(fTemplate.isAutoInsertable()); } createLabel(parent, TemplateDialogMessages.EditTemplateDialog_description); int descFlags = fIsNameModifiable ? SWT.BORDER : SWT.BORDER | SWT.READ_ONLY; fDescriptionText = new Text(parent, descFlags); fDescriptionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fDescriptionText.addModifyListener(listener); Label patternLabel = createLabel(parent, TemplateDialogMessages.EditTemplateDialog_pattern); patternLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); fPatternEditor = createEditor(parent); Label filler = new Label(parent, SWT.NONE); filler.setLayoutData(new GridData()); Composite composite = new Composite(parent, SWT.NONE); layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; composite.setLayout(layout); composite.setLayoutData(new GridData()); fInsertVariableButton = new Button(composite, SWT.NONE); fInsertVariableButton.setLayoutData(getButtonGridData()); fInsertVariableButton.setText(TemplateDialogMessages.EditTemplateDialog_insert_variable); fInsertVariableButton.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { fPatternEditor.getTextWidget().setFocus(); fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); } public void widgetDefaultSelected(SelectionEvent e) { } }); fDescriptionText.setText(fTemplate.getDescription()); if (fIsNameModifiable) { fNameText.setText(fTemplate.getName()); fNameText.addModifyListener(listener); fContextCombo.select(getIndex(fTemplate.getContextTypeId())); } else { fPatternEditor.getControl().setFocus(); } applyDialogFont(parent); return composite; }
From source file:org.summer.sdt.internal.ui.dialogs.SortMembersMessageDialog.java
License:Open Source License
@Override protected Control createMessageArea(Composite parent) { initializeDialogUnits(parent);/*from w w w.j av a 2s. c o m*/ Composite messageComposite = new Composite(parent, SWT.NONE); messageComposite.setFont(parent.getFont()); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginHeight = 0; layout.marginWidth = 0; layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); messageComposite.setLayout(layout); messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); createLinkControl(messageComposite); fNotSortAllRadio.doFillIntoGrid(messageComposite, 1); LayoutUtil.setHorizontalIndent(fNotSortAllRadio.getSelectionButton(null)); fSortAllRadio.doFillIntoGrid(messageComposite, 1); LayoutUtil.setHorizontalIndent(fSortAllRadio.getSelectionButton(null)); final Composite warningComposite = new Composite(messageComposite, SWT.NONE); layout = new GridLayout(); layout.numColumns = 2; layout.marginWidth = 0; layout.marginHeight = 0; warningComposite.setLayout(layout); warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); warningComposite.setFont(messageComposite.getFont()); Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); final Label imageLabel1 = new Label(warningComposite, SWT.LEFT | SWT.WRAP); imageLabel1.setImage(image); imageLabel1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1)); final Label label = new Label(warningComposite, SWT.WRAP); label.setText(DialogsMessages.SortMembersMessageDialog_sort_warning_label); GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1); gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(gridData); label.setFont(warningComposite.getFont()); fNotSortAllRadio.setDialogFieldListener(new IDialogFieldListener() { public void dialogFieldChanged(DialogField field) { imageLabel1.setEnabled(!fNotSortAllRadio.isSelected()); label.setEnabled(!fNotSortAllRadio.isSelected()); } }); imageLabel1.setEnabled(!fNotSortAllRadio.isSelected()); label.setEnabled(!fNotSortAllRadio.isSelected()); return messageComposite; }