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:com.sap.netweaver.porta.ide.eclipse.server.ui.dialogs.NoWSGateDialog.java
License:Open Source License
private Link createLink(Composite parent, String text) { Link link = new Link(parent, getMessageLabelStyle()); link.setText("<a>" + text + "</a>"); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(link);//from w w w . j a v a 2 s .com link.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { getButton(getDefaultButtonIndex()).setFocus(); } }); return link; }
From source file:com.seitenbau.eclipse.plugin.datenmodell.generator.visualizer.preferences.IgnoreInputDialog.java
License:Open Source License
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);/*from w w w. jav a2s .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()); } text = new Text(composite, getInputTextStyle()); text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); text.addModifyListener(new ModifyListener() { 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:com.simplifide.core.errorparser.newui.InputStatusDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); Label label = new Label(composite, SWT.WRAP); label.setText(message);/*from ww w . j ava2 s .c o 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()); text = new Text(composite, getInputTextStyle()); text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validateInput(); } }); text.setFocus(); if (value != null) { text.setText(value); text.selectAll(); } applyDialogFont(composite); return composite; }
From source file:com.symbian.smt.gui.smtwidgets.XmlFileSelectionDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); GridLayout layout = (GridLayout) composite.getLayout(); layout.numColumns = 2;/* w ww. j av a2 s . c o m*/ // create message if (message != null) { Label label = new Label(composite, SWT.WRAP); label.setText(message); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_CENTER, true, true, 2, 1); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); label.setFont(parent.getFont()); } inputText = new Text(composite, getInputTextStyle()); inputText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); inputText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validateInput(); } }); browseButton = new Button(composite, SWT.PUSH); browseButton.setText(BROWSE_BUTTON); browseButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent event) { } public void widgetSelected(SelectionEvent event) { FileDialog fd = new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN | SWT.APPLICATION_MODAL); fd.setText("Select the desired resource file name"); if (extensionFilter != null) { fd.setFilterExtensions(extensionFilter); } String selected = fd.open(); if (selected != null) { inputText.setText(selected); } } }); GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); gd.horizontalSpan = 2; gd.minimumHeight = 40; errorMessageText = new Text(composite, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP); errorMessageText.setLayoutData(gd); errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); // Set the error message text setErrorMessage(errorMessage); applyDialogFont(composite); return composite; }
From source file:com.windowtester.codegen.ui.controller.TaggedInputDialog.java
License:Open Source License
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);//from www . j a v a 2 s.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()); } text = new Text(composite, SWT.SINGLE | SWT.BORDER); text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validateInput(); } }); errorMessageText = new Text(composite, SWT.READ_ONLY); errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); applyDialogFont(composite); return composite; }
From source file:com.windowtester.eclipse.ui.dialogs.AbstractDetailsDialog.java
License:Open Source License
/** * Creates and returns the contents of the upper part * of the dialog (above the button bar). * /*w w w . j a va2s . co m*/ * @param parent the parent of the dialog area * @return the dialog area (above the button bar) */ protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); if (image != null) { ((GridLayout) composite.getLayout()).numColumns = 2; Label label = new Label(composite, 0); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING)); } // create message Label label = new Label(composite, SWT.WRAP); if (message != null) label.setText(message); GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); label.setFont(parent.getFont()); return composite; }
From source file:de.jcup.egradle.eclipse.ide.MissingRootProjectDialog.java
License:Apache License
@Override protected Control createMessageArea(Composite composite) { Image image = getImage();/*from ww w.java 2 s . co m*/ if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel); } if (message != null) { Link link = new Link(composite, getMessageLabelStyle()); StringBuilder sb = new StringBuilder(); sb.append(detailmessage); sb.append("\n\n"); sb.append("You can do following:\n\n"); sb.append("- For existing projects execute <a>Change EGradle root project</a>\n"); sb.append("- When project not in workspace use <a>EGradle import wizard</a>\n"); sb.append("- Or define root project path in <a>gradle setup preferences</a>\n"); link.setText(sb.toString()); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if ("Change EGradle root project".equals(e.text)) { showInHelp("html/user_guide/setup.html#change_rootproject_by_contextmenu"); } else if ("EGradle import wizard".equals(e.text)) { showInHelp("html/user_guide/import.html#import_by_importer"); } else { IDEUtil.openGradleSetupPage(); } close(); } }); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(link); } return composite; }
From source file:de.tudarmstadt.dvs.ukuflow.eventbase.utils.UkuInputDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); 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); // create message for (Integer message : requests.keySet()) { // ignore a special one if (message == -1) continue; if (message != null) { Label label = new Label(composite, SWT.READ_ONLY | SWT.WRAP); label.setText(requests.get(message).title); label.setLayoutData(data);// w w w . jav a2 s. co m label.setFont(parent.getFont()); } Control text = null; log.debug("requests of " + message + "[" + requests.get(message).title + "] : " + requests.get(message).requests); if (requests.get(message).requests == null) { // to deal with processes which are created using older version requests.get(message).requests = ""; } if (requests.get(message).requests instanceof String) { GridData gdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); if ("Filter's constraints".equals(requests.get(message).title)) { text = new Text(composite, SWT.WRAP | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.RESIZE); gdata.heightHint = 100; gdata.widthHint = 200; } else text = new Text(composite, getInputTextStyle()); text.setLayoutData(gdata); ((Text) text).setText(requests.get(message).requests.toString()); ((Text) text).addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validateInput(); } }); } else { CCombo combo = new CCombo(composite, getInputTextStyle()); combo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); // System.out.println("map: "+requests); // System.out.println("mesg:"+message + // "/ req:"+requests.get(message).requests); List l = (List<?>) requests.get(message).requests; String[] a = new String[l.size()]; int selectIndex = 0; for (int j = 0; j < l.size(); j++) { a[j] = l.get(j).toString(); if (a[j].equals(requests.get(message).currentValue)) selectIndex = j; } combo.setItems(a); combo.select(selectIndex); combo.setEditable(false); if (message == EventbasePackage.EG_DISTRIBUTION__FUNCTION) { combo_function = combo; init_function_parameters(composite, parent); combo.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { UkuInputDialog.this.function_changed(); } }); } text = combo; } texts.put(message, text); } // Set the error message text // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292 // setErrorMessage(errorMessage); // create error message erea: 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)); applyDialogFont(composite); return composite; }
From source file:de.unistuttgart.ipvs.pmp.editor.ui.editors.ais.internals.dialogs.RequiredPrivacySettingChangeValueDialog.java
License:Apache License
@Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); Label label = new Label(composite, SWT.WRAP); label.setText(this.message); /*//from www .j ava2 s. c o m * Layout the message with many things */ 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()); // Create a new composite with a gridlayout Composite textComposite = new Composite(parent, SWT.NULL); GridLayout gridLayout = new GridLayout(3, false); gridLayout.verticalSpacing = 9; textComposite.setLayout(gridLayout); data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); textComposite.setLayoutData(data); // The label and text field for the value new Label(textComposite, SWT.FILL).setText(I18N.general_value + ":"); //$NON-NLS-1$ this.valueText = new Text(textComposite, SWT.SINGLE | SWT.BORDER); this.valueText.addModifyListener(this); this.valueText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); // The button for the empty value this.checked = new Button(textComposite, SWT.CHECK); this.checked.setText(I18N.editor_ais_sf_pschangevaluedialog_emptyvalue); this.checked.addSelectionListener(this); applyDialogFont(composite); return composite; }
From source file:de.unistuttgart.ipvs.pmp.editor.ui.editors.ais.internals.dialogs.RequiredPrivacySettingsDialog.java
License:Apache License
@Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(new GridLayout(2, false)); Label psLabel = new Label(composite, SWT.NULL); psLabel.setText(I18N.editor_ais_sf_psdialog_choose + ":"); //$NON-NLS-1$ Label descLabel = new Label(composite, SWT.NULL); descLabel.setText(I18N.general_information + ":"); //$NON-NLS-1$ // The CheckboxTableViewer for the PrivacySettings this.listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); this.listViewer.addCheckStateListener(this); // Set the content provider and the label provider PrivacySettingsDialogContentProvider contentProvider = new PrivacySettingsDialogContentProvider(); this.listViewer.setContentProvider(contentProvider); this.listViewer.setLabelProvider(new PrivacySettingsDialogLabelProvider()); this.listViewer.setInput(this.toDisplay); this.listViewer.addSelectionChangedListener(this); GridData data = new GridData(GridData.FILL_BOTH); data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT; data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2); this.listViewer.getTable().setLayoutData(data); // The text that displays the description of the PS and the required // Value//from www . j a v a 2 s . com this.text = new StyledText(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP); this.text.setLayoutData(data); data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = SIZING_SELECTION_WIDGET_WIDTH; // Composite that holds the value label and text f Composite valueComp = new Composite(composite, SWT.BORDER); valueComp.setLayout(new GridLayout(2, false)); valueComp.setLayoutData(data); Label valueLabel = new Label(valueComp, SWT.NULL); valueLabel.setText(I18N.general_value + ":"); //$NON-NLS-1$ valueLabel.pack(); this.valueText = new Text(valueComp, SWT.BORDER); this.valueText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); this.valueText.pack(); // FocusListener to store the entered value this.valueText.addFocusListener(new org.eclipse.swt.events.FocusListener() { @Override public void focusLost(org.eclipse.swt.events.FocusEvent arg0) { // Store the value out of the value field RGISPrivacySetting ps = (RGISPrivacySetting) RequiredPrivacySettingsDialog.this.listViewer .getTable().getSelection()[0].getData(); if (!RequiredPrivacySettingsDialog.this.valueText.getText().isEmpty()) { RequiredPrivacySettingsDialog.this.values.put(ps.getIdentifier(), RequiredPrivacySettingsDialog.this.valueText.getText()); } } @Override public void focusGained(org.eclipse.swt.events.FocusEvent arg0) { } }); new Label(valueComp, SWT.None).setVisible(false); this.emptyValue = new Button(valueComp, SWT.CHECK); this.emptyValue.setText(I18N.editor_ais_sf_pschangevaluedialog_emptyvalue); this.emptyValue.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { // Store the value out of the value field RGISPrivacySetting ps = (RGISPrivacySetting) RequiredPrivacySettingsDialog.this.listViewer .getTable().getSelection()[0].getData(); if (RequiredPrivacySettingsDialog.this.emptyValue.getSelection()) { RequiredPrivacySettingsDialog.this.valuesEmpty.put(ps.getIdentifier(), true); RequiredPrivacySettingsDialog.this.valueText.setEnabled(false); } else { RequiredPrivacySettingsDialog.this.valuesEmpty.put(ps.getIdentifier(), false); RequiredPrivacySettingsDialog.this.valueText.setEnabled(true); RequiredPrivacySettingsDialog.this.valueText.setFocus(); } } }); // Set the initial selection and update the text if (this.toDisplay.getPrivacySettings().size() > 0) { this.listViewer.getTable().select(0); updateText(); } applyDialogFont(composite); return composite; }