List of usage examples for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH
int MINIMUM_MESSAGE_AREA_WIDTH
To view the source code for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH.
Click Source Link
From source file:org.csstudio.ui.util.dialogs.ResourceSelectionDialog.java
License:Open Source License
/** * {@inheritDoc}//from w w w.j av a 2 s . c om */ @Override protected Control createDialogArea(final Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(new GridLayout(1, false)); if (_message != null) { Label label = new Label(composite, SWT.WRAP); label.setText(_message); GridData data = new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.horizontalSpan = 2; data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); } // The New Project and New Folder actions will be shown if there are // no file extensions, i.e. if the dialog is opened to select a folder. boolean showNewContainerActions = (_fileExtensions == null || _fileExtensions.length == 0); _resourceSelectionGroup = new ResourceSelectionGroup(composite, this, _fileExtensions, showNewContainerActions); new Label(composite, SWT.NONE).setText("Resource Path:"); _resourcePathText = new Text(composite, SWT.SINGLE | SWT.LEAD | SWT.BORDER); _resourcePathText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); if (_path != null && !_path.isEmpty()) { _resourcePathText.setText(_path.toString()); _resourceSelectionGroup.setSelectedResource(_path); } return composite; }
From source file:org.datanucleus.ide.eclipse.wizard.schematool.SchemaToolPropertyInputDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); GridLayout layout = new GridLayout(); layout.numColumns = 2;/*from ww w.j a v a2 s. co m*/ layout.marginWidth = layout.marginHeight = 10; layout.horizontalSpacing = 20; composite.setLayout(layout); Label label = new Label(composite, SWT.NULL); label.setText("Property:"); propertyText = new Text(composite, SWT.SINGLE | SWT.BORDER); GridData gd = new GridData(SWT.FILL, SWT.NULL, true, false); gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); propertyText.setLayoutData(gd); label = new Label(composite, SWT.NULL); label.setText("Value:"); valueText = new Text(composite, SWT.SINGLE | SWT.BORDER); valueText.setLayoutData(new GridData(SWT.FILL, SWT.NULL, true, false)); applyDialogFont(composite); return composite; }
From source file:org.deidentifier.arx.gui.view.impl.menu.DialogComboDoubleSelection.java
License:Apache License
@Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); // create message if (message != null) { Label label = new Label(composite, SWT.WRAP); label.setText(message);/* w w w. ja va2 s .co m*/ GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); label.setFont(parent.getFont()); } combo1 = new Combo(composite, SWT.NONE); combo1.setItems(choices1); combo1.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); combo1.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { validateInput(); } }); combo2 = new Combo(composite, SWT.NONE); combo2.setItems(choices2); combo2.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); combo2.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { validateInput(); } }); errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP); errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); // Set the error message text // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292 setErrorMessage(errorMessage); applyDialogFont(composite); return composite; }
From source file:org.deidentifier.arx.gui.view.impl.menu.DialogComboSelection.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); // create message if (message != null) { Label label = new Label(composite, SWT.WRAP); label.setText(message);/* ww w.jav a 2s . c om*/ GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); label.setFont(parent.getFont()); } combo = new Combo(composite, SWT.NONE); combo.setItems(choices); combo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); combo.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { validateInput(); } }); errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP); errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); // Set the error message text // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292 setErrorMessage(errorMessage); applyDialogFont(composite); return composite; }
From source file:org.ebayopensource.vjet.eclipse.internal.debug.ui.actions.ChangeJsVariableValueInputDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { Font font = parent.getFont(); // create composite Composite composite = (Composite) super.createDialogArea(parent); // create message if (message != null) { Label label = new Label(composite, SWT.WRAP); label.setText(message);/*w ww .j a v a2 s. c o m*/ GridData data = new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); label.setFont(font); } text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); GridData gridData = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); gridData.heightHint = 50; gridData.widthHint = 100; text.setLayoutData(gridData); text.setFont(font); text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { if (okButton.isEnabled()) { return; } errorMessageLabel.setText(""); errorMessageLabel.getParent().update(); okButton.setEnabled(true); } }); errorMessageLabel = new Label(composite, SWT.NONE); errorMessageLabel.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); errorMessageLabel.setFont(font); return composite; }
From source file:org.eclipse.ajdt.internal.ui.ajde.AJDTErrorDialog.java
License:Open Source License
/** * Create the area the message will be shown in. * @param composite The composite to parent from. * @return Control//from w ww. j av a 2s. com */ protected Control createMessageArea(Composite composite) { // create composite // create image Image image = getImage(); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); imageLabel.setLayoutData( new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING)); } // create message if (message != null) { messageLabel = new Link(composite, getMessageLabelStyle()); messageLabel.setText(message); messageLabel.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { try { URL url = new URL(event.text); PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(url); } catch (MalformedURLException e) { } catch (PartInitException e) { } } }); 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); } return composite; }
From source file:org.eclipse.andmore.android.common.utilities.EclipseUtils.java
License:Apache License
private static int showInformationDialog(final String dialogTitle, final String dialogMessage, final String detailsMessage, final String[] buttonLabels, final int dialogImageType) { final int[] returnCode = new int[1]; PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { @Override//from ww w. j ava 2 s . com public void run() { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); Rectangle parentSize; if (shell.getParent() != null) { parentSize = shell.getParent().getBounds(); } else { parentSize = shell.getBounds(); } MessageDialog dlg; String[] internButtonLabels = buttonLabels; if (internButtonLabels == null) { internButtonLabels = new String[] { "OK" }; } if (detailsMessage == null) { dlg = new MessageDialog(shell, dialogTitle, null, dialogMessage, dialogImageType, internButtonLabels, 0); } else { dlg = new MessageDialog(shell, dialogTitle, null, dialogMessage, dialogImageType, internButtonLabels, 0) { @Override protected Control createCustomArea(Composite parent) { final Composite main = new Composite(parent, parent.getStyle()); GridLayout layout = new GridLayout(); main.setLayout(layout); GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); main.setLayoutData(data); final Button detailsButton = new Button(main, SWT.PUSH); detailsButton.setText(UtilitiesNLS.UI_EclipseUtils_OpenDetails); data = new GridData(SWT.RIGHT, SWT.CENTER, true, false); detailsButton.setLayoutData(data); detailsButton.addSelectionListener(new SelectionAdapter() { private Label detailsText; @Override public void widgetSelected(SelectionEvent e) { if ((detailsText != null) && !detailsText.isDisposed()) { detailsButton.setText(UtilitiesNLS.UI_EclipseUtils_OpenDetails); detailsText.dispose(); } else { detailsButton.setText(UtilitiesNLS.UI_EclipseUtils_CloseDetails); detailsText = new Label(main, SWT.WRAP | SWT.BORDER); detailsText.setText(detailsMessage); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); detailsText.setLayoutData(data); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING) .grab(true, false) .hint(convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(detailsText); } getShell().pack(); } }); return main; } }; } Rectangle dialogSize = shell.getBounds(); int x = ((parentSize.width - dialogSize.width) / 2) + parentSize.x; int y = ((parentSize.height - dialogSize.height) / 2) + parentSize.y; shell.setLocation(x, y); returnCode[0] = dlg.open(); } }); return returnCode[0]; }
From source file:org.eclipse.be.build.ui.wizards.StatusPage.java
License:Open Source License
private void createMessageArea(Composite composite) { // create composite // create image int iconId = getIconID(); Image image = iconId == -1 ? null : composite.getShell().getDisplay().getSystemImage(iconId); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image);//from w ww. j a va2 s . c o m GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.BEGINNING).applyTo(imageLabel); } // create message String msg = getMessageAreaMessage(); if (msg != null) { messageLabel = new Label(composite, SWT.WRAP); messageLabel.setText(msg); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(messageLabel); } }
From source file:org.eclipse.bpel.ui.dialogs.EditMessagePropertyDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); GridLayout layout = (GridLayout) composite.getLayout(); layout.makeColumnsEqualWidth = false; layout.numColumns = 3;/*from w ww .j a va 2s. c o m*/ Listener enablementListener = new Listener() { public void handleEvent(Event e) { updateEnablement(); } }; // create widgets Label topLabel = new Label(composite, SWT.NONE); if (isNew) { topLabel.setText(Messages.EditMessagePropertyDialog_9); } else { topLabel.setText(Messages.EditMessagePropertyDialog_10); } Label propertyNameLabel = new Label(composite, SWT.NONE); propertyNameLabel.setText(Messages.EditMessagePropertyDialog_14); propertyNameText = new Text(composite, SWT.BORDER); if (property != null) { String s = property.getName(); propertyNameText.setText((s == null) ? "" : s); //$NON-NLS-1$ } // TODO: if the property name changes we need to update the aliases as well propertyNameText.addListener(SWT.Modify, enablementListener); Label typeNameLabel = new Label(composite, SWT.NONE); typeNameLabel.setText(Messages.EditMessagePropertyDialog_Type_1); typeNameText = new Label(composite, SWT.NONE); browseTypeButton = new Button(composite, SWT.PUSH); browseTypeButton.setText(Messages.EditMessagePropertyDialog_18); browseTypeButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { browsePropertyType(); } }); Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.BOLD); Label aliasesLabel = new Label(composite, SWT.NONE); aliasesLabel.setText(Messages.EditMessagePropertyDialog_20); Composite c2 = new Composite(composite, SWT.NONE); newAliasButton = new Button(c2, SWT.PUSH); newAliasButton.setText(Messages.EditMessagePropertyDialog_21); newAliasButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { createAlias(); } }); editAliasButton = new Button(c2, SWT.PUSH); editAliasButton.setText(Messages.EditMessagePropertyDialog_22); editAliasButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { IStructuredSelection sel = (IStructuredSelection) aliasesTableViewer.getSelection(); PropertyAlias alias = (PropertyAlias) sel.getFirstElement(); editAlias(alias); } }); removeAliasButton = new Button(c2, SWT.PUSH); removeAliasButton.setText(Messages.EditMessagePropertyDialog_23); removeAliasButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { IStructuredSelection sel = (IStructuredSelection) aliasesTableViewer.getSelection(); PropertyAlias alias = (PropertyAlias) sel.getFirstElement(); Definition definition = property.getEnclosingDefinition(); if (definition != null) { definition.getEExtensibilityElements().remove(alias); } else { newAliasesList.remove(alias); } updatePropertyAliasTable(); } }); aliasesTable = new Table(composite, SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.BORDER); aliasesTable.setLinesVisible(true); aliasesTable.setHeaderVisible(true); aliasesTableProvider = new ColumnTableProvider(); aliasesTableProvider.add(new MessageTypeColumn()); aliasesTableProvider.add(new MessagePartColumn()); aliasesTableViewer = new TableViewer(aliasesTable); aliasesTableProvider.createTableLayout(aliasesTable); aliasesTableViewer.setLabelProvider(aliasesTableProvider); // Content provider that combines aliases from the actual model and newAliasesList. aliasesTableViewer.setContentProvider(new PropertyAliasContentProvider() { @Override public Object[] getElements(Object input) { Object[] superResult = super.getElements(input); Object[] result = new Object[superResult.length + newAliasesList.size()]; System.arraycopy(superResult, 0, result, 0, superResult.length); int i = superResult.length; for (Iterator it = newAliasesList.iterator(); it.hasNext();) { result[i++] = it.next(); } return result; } }); aliasesTableViewer.setColumnProperties(aliasesTableProvider.getColumnProperties()); aliasesFilter = new PropertyAliasFilter(); aliasesTableViewer.addFilter(aliasesFilter); aliasesTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { updateEnablement(); } }); // update type widgets updateTypeWidgets(); updatePropertyAliasTable(); updateTypeFileText(); // layout widgets GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 3; data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); topLabel.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); propertyNameLabel.setLayoutData(data); data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; propertyNameText.setLayoutData(data); data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 3; separator.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); typeNameLabel.setLayoutData(data); data = new GridData(GridData.FILL_HORIZONTAL); typeNameText.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_END); browseTypeButton.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); aliasesLabel.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_END); data.horizontalSpan = 2; c2.setLayoutData(data); layout = new GridLayout(3, false); layout.marginWidth = 0; layout.marginHeight = 0; c2.setLayout(layout); data = new GridData(GridData.HORIZONTAL_ALIGN_END); newAliasButton.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_END); editAliasButton.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_END); removeAliasButton.setLayoutData(data); data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 3; data.verticalSpan = 3; data.heightHint = 70; aliasesTable.setLayoutData(data); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.PROPERTY_DIALOG); return composite; }
From source file:org.eclipse.bpel.ui.dialogs.EditPropertyAliasDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); GridLayout layout = (GridLayout) composite.getLayout(); layout.makeColumnsEqualWidth = false; layout.numColumns = 2;/*from ww w . j a v a 2s .c om*/ // create widgets Label topLabel = new Label(composite, SWT.NONE); if (createAlias) { topLabel.setText(Messages.EditPropertyAliasDialog_3); } else { topLabel.setText(Messages.EditPropertyAliasDialog_4); } variableTypeSelector = new DialogVariableTypeSelector(composite, SWT.NONE, bpelEditor, getShell(), new PropertyAliasDialogCallback(), wf); variableTypeSelector.setVariableType(null); Label partLabel = new Label(composite, SWT.NONE); partLabel.setText(Messages.EditPropertyAliasDialog_8); messagePartTree = new Tree(composite, SWT.BORDER); messagePartViewer = new TreeViewer(messagePartTree); messagePartViewer.setContentProvider(new PartTreeContentProvider(true)); messagePartViewer.setLabelProvider(new ModelTreeLabelProvider()); messagePartViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { updateEnablement(); } }); // layout widgets GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); topLabel.setLayoutData(data); data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; variableTypeSelector.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); partLabel.setLayoutData(data); data = new GridData(GridData.FILL_HORIZONTAL); data.verticalSpan = 3; data.heightHint = 70; messagePartTree.setLayoutData(data); updateWidgets(); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.PROPERTY_ALIAS_DIALOG); return composite; }