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.org.eclipse.core.utils.platform.dialogs.message.AbstractMessageAndButtonDialog.java
License:Open Source License
protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent);/*from w w w . j av a2 s . com*/ // create the top level composite for the dialog GridLayout layout = new GridLayout(); layout.numColumns = 2; 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.makeColumnsEqualWidth = false; parent.setLayout(layout); parent.setLayoutData(new GridData(GridData.FILL_BOTH)); createDialogAndButtonArea(parent); return parent; }
From source file:org.parallelj.extensions.data.generator.wizard.dialog.PackageSelectionDialog.java
License:Open Source License
/** * this method will return the modified parent container * /*from ww w . j a v a2 s. c o m*/ * @param container * @return */ protected Composite modifyParentContainer(Composite container) { GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(0); layout.marginWidth = convertHorizontalDLUsToPixels(0); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(2); layout.marginRight = 2; container.setLayout(layout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); applyDialogFont(container); return container; }
From source file:org.pwsafe.passwordsafeswt.dialog.AboutDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { 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 w ww .j av a2 s . c o m composite.setLayoutData(new GridData(GridData.FILL_BOTH)); createMyContents(composite); applyDialogFont(composite); return composite; }
From source file:org.radrails.rails.internal.ui.dialogs.RailsServerDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite dialogArea = (Composite) super.createDialogArea(parent); setTitle(Messages.RailsServerDialog_Title); getShell().setText(Messages.RailsServerDialog_Message); Composite composite = new Composite(dialogArea, SWT.NONE); composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); PixelConverter converter = new PixelConverter(composite); composite.setLayout(GridLayoutFactory.swtDefaults() .margins(converter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN), converter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN)) .spacing(converter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING), converter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING)) .numColumns(3).create());//from w w w . j a v a 2 s . c o m /* name of the server */ Label label = new Label(composite, SWT.NONE); label.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(label).convertHorizontalDLUsToPixels(LABEL_WIDTH), SWT.DEFAULT).create()); label.setText(StringUtil.makeFormLabel(Messages.RailsServerDialog_NameLabel)); nameText = new Text(composite, SWT.SINGLE | SWT.BORDER); nameText.setLayoutData(GridDataFactory.fillDefaults() .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT).span(2, 1) .grab(true, false).create()); /* Project we're running server for */ label = new Label(composite, SWT.NONE); label.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(label).convertHorizontalDLUsToPixels(LABEL_WIDTH), SWT.DEFAULT).create()); label.setText(StringUtil.makeFormLabel(Messages.RailsServerDialog_ProjectLabel)); projectCombo = new Combo(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY); projectCombo.setLayoutData(GridDataFactory.fillDefaults() .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT).span(2, 1) .grab(true, false).create()); // Populate combo with all the rails projects for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { try { if (project.isOpen() && project.hasNature(RailsProjectNature.ID)) { projectCombo.add(project.getName()); } } catch (CoreException e) { IdeLog.logError(RailsUIPlugin.getDefault(), e); } } if (projectCombo.getItemCount() > 0) { projectCombo.setText(projectCombo.getItems()[0]); } /* host/ip to bind to: 0.0.0.0, 127.0.0.1? */ label = new Label(composite, SWT.NONE); label.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(label).convertHorizontalDLUsToPixels(LABEL_WIDTH), SWT.DEFAULT).create()); label.setText(StringUtil.makeFormLabel(Messages.RailsServerDialog_BindingLabel)); hostNameText = new Text(composite, SWT.SINGLE | SWT.BORDER); hostNameText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(hostNameText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .span(2, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).create()); hostNameText.setText(RailsServer.DEFAULT_BINDING); /* Port: default is 3000 */ label = new Label(composite, SWT.NONE); label.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(label).convertHorizontalDLUsToPixels(LABEL_WIDTH), SWT.DEFAULT).create()); label.setText(StringUtil.makeFormLabel(Messages.RailsServerDialog_PortLabel)); portText = new Text(composite, SWT.SINGLE | SWT.BORDER); portText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(portText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .grab(true, false).create()); portText.setText(Integer.toString(RailsServer.DEFAULT_PORT)); // Set up values to reflect server we're editing. if (source != null) { String name = source.getName(); nameText.setText((name != null) ? name : StringUtil.EMPTY); String host = source.getHostname(); hostNameText.setText((host != null) ? host : RailsServer.DEFAULT_BINDING); portText.setText(Integer.toString(source.getPort())); IProject project = source.getProject(); if (project != null) { projectCombo.setText(project.getName()); } } addListeners(); return dialogArea; }
From source file:org.robovm.eclipse.internal.TemplateChooser.java
License:Open Source License
private GridLayout initGridLayout(GridLayout layout) { layout.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_SPACING); layout.marginWidth = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_MARGIN); return layout; }
From source file:org.rssowl.ui.internal.dialogs.ActivityDialog.java
License:Open Source License
@SuppressWarnings("restriction") private void updateViewerSize() { Point size = fViewer.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT); size.x += IDialogConstants.HORIZONTAL_SPACING; size.y += IDialogConstants.VERTICAL_SPACING; ((ScrolledComposite) fViewer.getControl()).setMinSize(size); }
From source file:org.rssowl.ui.internal.dialogs.ActivityDialog.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 w w . j a v a2 s . c o m /* Keep or Hide Completed Downloads */ fHideCompletedCheck = new Button(buttonBar, SWT.CHECK); fHideCompletedCheck.setText(Messages.ActivityDialog_REMOVE_COMPLETED); fHideCompletedCheck.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fHideCompletedCheck.setSelection(fPreferences.getBoolean(DefaultPreferences.HIDE_COMPLETED_DOWNLOADS)); fHideCompletedCheck.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { final boolean hideCompleted = fHideCompletedCheck.getSelection(); refreshProgressViewer(hideCompleted); JobRunner.runInBackgroundThread(new Runnable() { public void run() { fPreferences.putBoolean(DefaultPreferences.HIDE_COMPLETED_DOWNLOADS, hideCompleted); } }); } }); /* OK */ createButton(buttonBar, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); return buttonBar; }
From source file:org.rssowl.ui.internal.dialogs.CustomizeToolbarDialog.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 ww w . ja v a 2s . co m*/ /* Info Container */ Composite infoContainer = new Composite(buttonBar, SWT.None); infoContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); infoContainer.setLayout(LayoutUtils.createGridLayout(2, 0, 0)); ((GridLayout) infoContainer.getLayout()).marginRight = 10; Label infoImg = new Label(infoContainer, SWT.NONE); infoImg.setImage(OwlUI.getImage(fResources, "icons/obj16/info.gif")); //$NON-NLS-1$ infoImg.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); Label infoText = new Label(infoContainer, SWT.WRAP); infoText.setText(Messages.CustomizeToolbarDialog_USE_MOUSE_INFO); infoText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); applyDialogFont(infoContainer); /* Create Ok / Cancel Buttons */ createButtonsForButtonBar(buttonBar); return buttonBar; }
From source file:org.rssowl.ui.internal.dialogs.NewsFilterDialog.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);// www . j a v a 2 s . co m /* Preview Link */ Link previewLink = new Link(buttonBar, SWT.NONE); previewLink.setText(Messages.NewsFilterDialog_PREVIEW_SEARCH); applyDialogFont(previewLink); previewLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); previewLink.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { onPreview(); } }); /* Create Buttons */ createButtonsForButtonBar(buttonBar); return buttonBar; }
From source file:org.rssowl.ui.internal.dialogs.PreviewFeedDialog.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 w w . j a va 2 s . c om /* Status Label */ fStatusLabel = new Link(buttonBar, SWT.NONE); applyDialogFont(fStatusLabel); fStatusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); if (StringUtils.isSet(fBookmark.getName())) fStatusLabel.setText(fBookmark.getName()); /* 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; }