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:de.tub.tfs.henshin.tggeditor.dialogs.resource.ResourcesDialog.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 = 0;// 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 w w . j av a 2s. co m composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parentComposite.getFont()); Listener listener = new Listener() { public void handleEvent(Event event) { setDialogComplete(validate()); } }; resourceGroup = new FileSelectionGroup(composite, listener, type == SWT.SAVE, "File name:"); return parentComposite; }
From source file:descent.internal.ui.preferences.formatter.CreateProfileDialog.java
License:Open Source License
public Control createDialogArea(Composite parent) { final int numColumns = 2; GridData gd;/*from ww w. j a v a2 s .com*/ 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 = JavaPlugin.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.getDefaultProfile().getName()); updateStatus(fEmpty); applyDialogFont(composite); fNameText.setFocus(); return composite; }
From source file:descent.internal.ui.preferences.formatter.ModifyDialogTabPage.java
License:Open Source License
/** * Create the contents of this tab page. Subclasses cannot override this, * instead they must implement <code>doCreatePreferences</code>. <code>doCreatePreview</code> may also * be overridden as necessary.// ww w . j ava2s. co m * @param parent The parent composite * @return Created content control */ public final Composite createContents(Composite parent) { final int numColumns = 4; if (fPixelConverter == null) { fPixelConverter = new PixelConverter(parent); } final SashForm fSashForm = new SashForm(parent, SWT.HORIZONTAL); fSashForm.setFont(parent.getFont()); final ScrolledComposite scrollPane = new ScrolledComposite(fSashForm, SWT.V_SCROLL); scrollPane.setExpandHorizontal(true); scrollPane.setExpandVertical(true); final Composite settingsPane = new Composite(scrollPane, SWT.NONE); settingsPane.setFont(fSashForm.getFont()); scrollPane.setContent(settingsPane); final GridLayout layout = new GridLayout(numColumns, false); layout.verticalSpacing = (int) (1.5 * fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING)); layout.horizontalSpacing = fPixelConverter .convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.marginHeight = fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); settingsPane.setLayout(layout); doCreatePreferences(settingsPane, numColumns); scrollPane.setMinSize(settingsPane.computeSize(SWT.DEFAULT, SWT.DEFAULT)); final Composite previewPane = new Composite(fSashForm, SWT.NONE); previewPane.setLayout(createGridLayout(numColumns, true)); previewPane.setFont(fSashForm.getFont()); doCreatePreviewPane(previewPane, numColumns); initializePage(); fSashForm.setWeights(new int[] { 3, 3 }); return fSashForm; }
From source file:descent.internal.ui.refactoring.MessageWizardPage.java
License:Open Source License
public void createControl(Composite parent) { initializeDialogUnits(parent);//from w w w. j a va2 s. co m Composite result = new Composite(parent, SWT.NONE); setControl(result); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN) * 3 / 2; layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING) * 2; layout.numColumns = 2; result.setLayout(layout); Image image = getMessageImage(); if (image != null) { Label label = new Label(result, SWT.NULL); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING)); } String message = getMessageString(); if (message != null) { Label messageLabel = new Label(result, SWT.WRAP); messageLabel.setText(message); GridData data = new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); messageLabel.setLayoutData(data); messageLabel.setFont(result.getFont()); } Dialog.applyDialogFont(result); }
From source file:descent.internal.ui.wizards.JavaProjectWizardFirstPage.java
License:Open Source License
/** * Initialize a grid layout with the default Dialog settings. *///from w ww . java 2 s . c om protected GridLayout initGridLayout(GridLayout layout, boolean margins) { layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); if (margins) { layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); } else { layout.marginWidth = 0; layout.marginHeight = 0; } return layout; }
From source file:eclipse.testframework.ui.util.VerifyDialog.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); composite.setSize(SIZING_WIDTH, SWT.DEFAULT); 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 w w. j a v a2 s .c o m*/ composite.setLayoutData(new GridData(GridData.FILL_BOTH)); createTestSelectionGroup(composite); createCheckListGroup(composite); _queryLabel = new Label(composite, SWT.NONE); _queryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); initializeTest(); return composite; }
From source file:edu.duke.cs.ambient.internal.ui.actions.AmbientArgumentsDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { IDialogSettings dset = AmbientPlugin.getDefault().getDialogSettings(); IDialogSettings dSection = dset.getSection(DSECTIONNAME); if (dSection == null) { dSection = dset.addNewSection(DSECTIONNAME); dSection.put(ARGUMENTS, ""); }/*from w w w . ja v a 2s . c o m*/ // 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); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parentComposite.getFont()); argsText = new Text(composite, SWT.SINGLE | SWT.BORDER); argsText.setFocus(); argsText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); argsText.setText(dSection.get(ARGUMENTS)); argsText.selectAll(); return parentComposite; }
From source file:ext.org.eclipse.jdt.internal.ui.actions.GenerateConstructorUsingFieldsSelectionDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent);/*from ww w . j av a2s . c o m*/ Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); GridData gd = null; 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 classConstructorComposite = addSuperClassConstructorChoices(composite); gd = new GridData(GridData.FILL_BOTH); classConstructorComposite.setLayoutData(gd); Composite inner = new Composite(composite, SWT.NONE); GridLayout innerLayout = new GridLayout(); innerLayout.numColumns = 2; innerLayout.marginHeight = 0; innerLayout.marginWidth = 0; inner.setLayout(innerLayout); Label messageLabel = createMessageArea(inner); if (messageLabel != null) { gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 2; messageLabel.setLayoutData(gd); } CheckboxTreeViewer treeViewer = createTreeViewer(inner); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = convertWidthInCharsToPixels(fWidth); gd.heightHint = convertHeightInCharsToPixels(fHeight); treeViewer.getControl().setLayoutData(gd); treeViewer.addSelectionChangedListener(fTreeViewerAdapter); Composite buttonComposite = createSelectionButtons(inner); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL); buttonComposite.setLayoutData(gd); gd = new GridData(GridData.FILL_BOTH); inner.setLayoutData(gd); Composite entryComposite = createInsertPositionCombo(composite); entryComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Composite commentComposite = createCommentSelection(composite); commentComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Composite overrideSuperComposite = createOmitSuper(composite); overrideSuperComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Control linkControl = createLinkControl(composite); if (linkControl != null) linkControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); gd = new GridData(GridData.FILL_BOTH); composite.setLayoutData(gd); applyDialogFont(composite); return composite; }
From source file:ext.org.eclipse.jdt.internal.ui.dialogs.SortMembersMessageDialog.java
License:Open Source License
@Override protected Control createMessageArea(Composite parent) { initializeDialogUnits(parent);/* w w w . ja v 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); int indent = convertWidthInCharsToPixels(3); fNotSortAllRadio.doFillIntoGrid(messageComposite, 1); LayoutUtil.setHorizontalIndent(fNotSortAllRadio.getSelectionButton(null), indent); fSortAllRadio.doFillIntoGrid(messageComposite, 1); LayoutUtil.setHorizontalIndent(fSortAllRadio.getSelectionButton(null), indent); 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; }
From source file:ext.org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent);//from ww w . ja v a 2 s . c o m Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); GridData gd = null; 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); Label messageLabel = createMessageArea(composite); if (messageLabel != null) { gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 2; messageLabel.setLayoutData(gd); } Composite inner = new Composite(composite, SWT.NONE); GridLayout innerLayout = new GridLayout(); innerLayout.numColumns = 2; innerLayout.marginHeight = 0; innerLayout.marginWidth = 0; inner.setLayout(innerLayout); inner.setFont(parent.getFont()); CheckboxTreeViewer treeViewer = createTreeViewer(inner); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = convertWidthInCharsToPixels(fWidth); gd.heightHint = convertHeightInCharsToPixels(fHeight); treeViewer.getControl().setLayoutData(gd); Composite buttonComposite = createSelectionButtons(inner); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL); buttonComposite.setLayoutData(gd); gd = new GridData(GridData.FILL_BOTH); inner.setLayoutData(gd); fInsertPositionComposite = createInsertPositionCombo(composite); fInsertPositionComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Composite commentComposite = createCommentSelection(composite); commentComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Control linkControl = createLinkControl(composite); if (linkControl != null) linkControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); gd = new GridData(GridData.FILL_BOTH); composite.setLayoutData(gd); applyDialogFont(composite); return composite; }