List of usage examples for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_MARGIN
int HORIZONTAL_MARGIN
To view the source code for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_MARGIN.
Click Source Link
From source file:com.aptana.ui.dialogs.PasswordPromptDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite dialogArea = (Composite) super.createDialogArea(parent); titleImage = UIPlugin.getImageDescriptor("/icons/full/security.png").createImage(); //$NON-NLS-1$ dialogArea.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if (titleImage != null) { setTitleImage(null);/* w w w .j a va 2s . c om*/ titleImage.dispose(); titleImage = null; } } }); setTitleImage(titleImage); setTitle(title); setMessage(message); Composite container = new Composite(dialogArea, SWT.NONE); container.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); container.setLayout(GridLayoutFactory.swtDefaults() .margins(convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN), convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN)) .spacing(convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING), convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING)) .numColumns(2).create()); /* row 1 */ Label label = new Label(container, SWT.NONE); label.setLayoutData(GridDataFactory.swtDefaults().create()); label.setText(StringUtil.makeFormLabel(Messages.PasswordPromptDialog_UserName)); loginText = new Text(container, SWT.SINGLE | SWT.BORDER); loginText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); if (login != null) { loginText.setText(login); } loginText.setEnabled(false); /* row 2 */ label = new Label(container, SWT.NONE); label.setLayoutData(GridDataFactory.swtDefaults().create()); label.setText(StringUtil.makeFormLabel(Messages.PasswordPromptDialog_Password)); passwordText = new Text(container, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER); passwordText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); if (password != null) { passwordText.setText(String.copyValueOf(password)); } if (savePasswordPrompt) { /* row 3 */ new Label(container, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create()); savePasswordButton = new Button(container, SWT.CHECK); savePasswordButton.setLayoutData(GridDataFactory.fillDefaults().create()); savePasswordButton.setText(Messages.PasswordPromptDialog_SavePassword); savePasswordButton.setSelection(savePassword); } return dialogArea; }
From source file:com.aptana.webserver.ui.internal.ExternalWebServerPropertyDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite dialogArea = (Composite) super.createDialogArea(parent); setTitle(Messages.SimpleWebServerPropertyDialog_Title); getShell().setText(Messages.SimpleWebServerPropertyDialog_ShellTitle); 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 ww .java 2 s . c om*/ /* row 1 */ 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.SimpleWebServerPropertyDialog_Name_Label)); 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()); /* row 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.SimpleWebServerPropertyDialog_BaseURL_Label)); baseUrlText = new Text(composite, SWT.SINGLE | SWT.BORDER); baseUrlText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(baseUrlText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .span(2, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).create()); baseUrlText.setText("http://"); //$NON-NLS-1$ /* row 2 */ 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.SimpleWebServerPropertyDialog_DocRoot_Label)); documentRootText = new Text(composite, SWT.SINGLE | SWT.BORDER); documentRootText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(documentRootText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .grab(true, false).create()); Button browseButton = new Button(composite, SWT.PUSH); browseButton.setText('&' + StringUtil.ellipsify(CoreStrings.BROWSE)); browseButton.setLayoutData(GridDataFactory.fillDefaults() .hint(Math.max( new PixelConverter(browseButton) .convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH), browseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x), SWT.DEFAULT) .create()); /* -- */ browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { browseFileSystem(); } }); /* row 3 - start command */ 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.ExternalWebServerPropertyDialog_StartCommandLabel)); startCommandText = new Text(composite, SWT.SINGLE | SWT.BORDER); startCommandText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(baseUrlText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .span(2, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).create()); /* row 4 - stop command */ 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.ExternalWebServerPropertyDialog_StopCommandLabel)); stopCommandText = new Text(composite, SWT.SINGLE | SWT.BORDER); stopCommandText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(baseUrlText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .span(2, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).create()); // Set up existing values... if (source != null) { String name = source.getName(); nameText.setText((name != null) ? name : StringUtil.EMPTY); URL url = source.getBaseURL(); if (url != null) { baseUrlText.setText(url.toExternalForm()); } IPath path = source.getDocumentRootPath(); if (path != null) { documentRootText.setText(path.toOSString()); } String startCommand = source.getStartCommand(); startCommandText.setText((startCommand != null) ? startCommand : StringUtil.EMPTY); String stopCommand = source.getStopCommand(); stopCommandText.setText((stopCommand != null) ? stopCommand : StringUtil.EMPTY); } addListeners(); return dialogArea; }
From source file:com.aptana.webserver.ui.internal.SimpleWebServerPropertyDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite dialogArea = (Composite) super.createDialogArea(parent); setTitle(Messages.SimpleWebServerPropertyDialog_Title); getShell().setText(Messages.SimpleWebServerPropertyDialog_ShellTitle); 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 ww. j a v a 2 s . c om /* row 1 */ 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.SimpleWebServerPropertyDialog_Name_Label)); 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()); /* row 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.SimpleWebServerPropertyDialog_BaseURL_Label)); baseUrlText = new Text(composite, SWT.SINGLE | SWT.BORDER); baseUrlText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(baseUrlText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .span(2, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).create()); baseUrlText.setText("http://"); //$NON-NLS-1$ /* row 2 */ 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.SimpleWebServerPropertyDialog_DocRoot_Label)); documentRootText = new Text(composite, SWT.SINGLE | SWT.BORDER); documentRootText.setLayoutData(GridDataFactory.swtDefaults() .hint(new PixelConverter(documentRootText) .convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .grab(true, false).create()); Button browseButton = new Button(composite, SWT.PUSH); browseButton.setText('&' + StringUtil.ellipsify(CoreStrings.BROWSE)); browseButton.setLayoutData(GridDataFactory.fillDefaults() .hint(Math.max( new PixelConverter(browseButton) .convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH), browseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x), SWT.DEFAULT) .create()); /* -- */ browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { browseFileSystem(); } }); if (source != null) { String name = source.getName(); nameText.setText((name != null) ? name : StringUtil.EMPTY); URL url = source.getBaseURL(); if (url != null) { baseUrlText.setText(url.toExternalForm()); } IPath path = source.getDocumentRootPath(); if (path != null) { documentRootText.setText(path.toOSString()); } } addListeners(); return dialogArea; }
From source file:com.arc.intro.NewWorkspaceDialog.java
License:Open Source License
/** * The main area of the dialog is just a row with the current selection information and a drop-down of the most * recently used workspaces.//from w ww.ja v a 2 s . co m */ private void createWorkspaceBrowseRow(Composite parent) { Composite panel = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(3, 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); panel.setLayout(layout); panel.setLayoutData(new GridData(GridData.FILL_BOTH)); panel.setFont(parent.getFont()); Label label = new Label(panel, SWT.NONE); label.setText("Specify a directory:"); // text = new Combo(panel, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN); text = new Text(panel, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN); text.setFocus(); //text.setEnabled(false); text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL)); // setInitialTextValues(text); Button browseButton = new Button(panel, SWT.PUSH); browseButton.setText("Browse..."); setButtonLayoutData(browseButton); GridData data = (GridData) browseButton.getLayoutData(); data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END; browseButton.setLayoutData(data); browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setText("Select Workspace Directory"); dialog.setMessage("Select the workspace directory to use."); dialog.setFilterPath(getInitialBrowsePath()); String dir = dialog.open(); if (dir != null) text.setText(dir); } }); }
From source file:com.arc.intro.NewWorkspaceDialog.java
License:Open Source License
private void createExtraTextInfoMsgPanel(Composite parent) { Composite panel = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); panel.setLayout(layout);// w w w .j av a 2s . c o m panel.setLayoutData(new GridData(GridData.FILL_BOTH)); panel.setFont(parent.getFont()); Label label = new Label(panel, SWT.NONE); label.setText( ToolchainPlugin.getTheProductName() + " will automatically restart to complete this operation."); }
From source file:com.arc.intro.OpenWorkspaceDialog.java
License:Open Source License
/** * The main area of the dialog is just a row with the current selection information and a drop-down of the most * recently used workspaces./* w w w . jav a 2s .co m*/ */ private void createWorkspaceBrowseRow(Composite parent) { Composite panel = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(3, 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); panel.setLayout(layout); panel.setLayoutData(new GridData(GridData.FILL_BOTH)); panel.setFont(parent.getFont()); Label label = new Label(panel, SWT.NONE); label.setText("Select a workspace"); text = new Combo(panel, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN); text.setFocus(); text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL)); setInitialTextValues(text); Button browseButton = new Button(panel, SWT.PUSH); browseButton.setText("Browse..."); setButtonLayoutData(browseButton); GridData data = (GridData) browseButton.getLayoutData(); data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END; browseButton.setLayoutData(data); browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setText("Select Workspace Directory"); dialog.setMessage("Select the workspace directory to use."); dialog.setFilterPath(getInitialBrowsePath()); String dir = dialog.open(); if (dir != null) text.setText(dir); } }); }
From source file:com.centurylink.mdw.plugin.designer.editors.ViewLayoutEditAttributeDialog.java
License:Apache License
protected Composite baseCreateDialogArea(Composite parent) { // copied from Dialog Composite dialogArea = 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); dialogArea.setLayout(layout);/* www .ja v a 2 s . c o m*/ dialogArea.setLayoutData(new GridData(GridData.FILL_BOTH)); applyDialogFont(dialogArea); return dialogArea; }
From source file:com.cisco.yangide.ext.model.editor.dialog.AddImportDialog.java
License:Open Source License
private void createPrefixArea(Composite content) { Composite appendix = new Composite(content, 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;//from w w w . ja v a 2 s. c o m appendix.setLayout(layout); appendix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); CLabel label = new CLabel(appendix, SWT.NONE); label.setText("Prefix"); prefix = new Text(appendix, SWT.BORDER); prefixModifyListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { updateStatus(getOverallStatus()); } }; prefix.addModifyListener(prefixModifyListener); prefix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); }
From source file:com.cisco.yangide.ext.model.editor.dialog.ChooseParentModuleDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite content = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, true).applyTo(content); GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content); super.createDialogArea(content); Composite appendix = new Composite(content, 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;/*from ww w . j av a 2 s . c o m*/ appendix.setLayout(layout); appendix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); CLabel label = new CLabel(appendix, SWT.NONE); label.setText("Prefix"); prefix = new Text(appendix, SWT.BORDER); prefix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); init(); return content; }
From source file:com.clustercontrol.dialog.CommonDialog.java
License:Open Source License
/** * OK?/*from w w w . ja v a2 s .c o m*/ */ @Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); // create a layout with spacing and margins appropriate for the font // size. GridLayout layout = new GridLayout(); layout.numColumns = 0; // this is incremented by createButton layout.makeColumnsEqualWidth = true; layout.marginTop = 0; layout.marginBottom = 5; layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = 0; composite.setLayout(layout); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER); composite.setLayoutData(data); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }