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:de.unistuttgart.ipvs.pmp.editor.ui.editors.ais.internals.dialogs.RequiredResourceGroupsDialog.java
License:Apache License
@Override protected Control createDialogArea(final 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_rgdialog_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 this.listViewer.setContentProvider(new ResourceGroupsDialogContentProvider()); this.listViewer.setLabelProvider(new ResourceGroupDialogLabelProvider()); 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// w w w. j a va 2 s .c o m 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(3, false)); valueComp.setLayoutData(data); Label valueLabel = new Label(valueComp, SWT.NULL); valueLabel.setToolTipText(I18N.editor_ais_sf_minimalrev_tooltip); valueLabel.setText(I18N.editor_ais_sf_minimalrev + ":"); //$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(); Button picker = new Button(valueComp, SWT.ICON); picker.setToolTipText(I18N.general_calendar_tooltip); picker.setImage(Images.getImageDescriptor("icons", "history_working_set_obj.gif").createImage()); //$NON-NLS-1$ //$NON-NLS-2$ picker.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent arg0) { Long[] result = new Long[1]; // Open a dialog with the time and date picker if (new DateTimeDialog(RequiredResourceGroupsDialog.this.shell, result).open() == Window.OK) { // Get the display rg RGIS ps = (RGIS) RequiredResourceGroupsDialog.this.listViewer.getTable().getSelection()[0] .getData(); // Store it at the hash map RequiredResourceGroupsDialog.this.values.put(ps.getIdentifier(), XMLConstants.REVISION_DATE_FORMAT.format(new Date(result[0]))); updateText(); } } @Override public void widgetDefaultSelected(SelectionEvent arg0) { } }); // 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 RGIS ps = (RGIS) RequiredResourceGroupsDialog.this.listViewer.getTable().getSelection()[0] .getData(); if (!RequiredResourceGroupsDialog.this.valueText.getText().isEmpty()) { RequiredResourceGroupsDialog.this.values.put(ps.getIdentifier(), RequiredResourceGroupsDialog.this.valueText.getText()); } } @Override public void focusGained(org.eclipse.swt.events.FocusEvent arg0) { } }); // Set the initial selection and update the text if (this.toDisplay.size() > 0) { this.listViewer.getTable().select(0); updateText(); } applyDialogFont(composite); return composite; }
From source file:descent.internal.ui.refactoring.MessageWizardPage.java
License:Open Source License
public void createControl(Composite parent) { initializeDialogUnits(parent);//from ww w . j a v a 2s . c o 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:edu.iastate.cs.boa.ui.dialogs.InputSelectionDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); if (message != null) { final Label label = new Label(composite, SWT.WRAP); label.setText(message);//from ww w .ja v a 2s.c o m final 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.setVisibleItemCount(choices.length); combo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); combo.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)); setErrorMessage(errorMessage); applyDialogFont(composite); return composite; }
From source file:edu.umd.cs.eclipse.courseProjectManager.PasswordDialog.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);/*from w w w. j a v a 2 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()); } // username prompt Label usernameLabel = new Label(composite, SWT.WRAP); usernameLabel.setText("DirectoryID:"); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); usernameLabel.setLayoutData(data); usernameLabel.setFont(parent.getFont()); // username textbox usernameText = new Text(composite, SWT.SINGLE | SWT.BORDER); usernameText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); // password prompt Label passwordLabel = new Label(composite, SWT.WRAP); passwordLabel.setText("Password:"); GridData passwordGrid = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_BEGINNING); passwordGrid.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); passwordLabel.setLayoutData(passwordGrid); passwordLabel.setFont(parent.getFont()); // password textbox passwordText = new Text(composite, SWT.SINGLE | SWT.BORDER); passwordText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); passwordText.setEchoChar('*'); // Validate the user's input usernameText.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:edu.umd.cs.eclipse.courseProjectManager.SubmitUserDialog.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 ww . j a v a 2 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()); } // username prompt Label usernameLabel = new Label(composite, SWT.WRAP); usernameLabel.setText("Info:"); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); usernameLabel.setLayoutData(data); usernameLabel.setFont(parent.getFont()); // username textbox userDataText = new Text(composite, SWT.SINGLE | SWT.BORDER); userDataText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); // Validate the user's input userDataText.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:eu.esdihumboldt.hale.io.schematron.ui.SchematronValidatorConfigurationDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); Composite container = new Composite(composite, SWT.NONE); 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); container.setLayoutData(data);/* w w w .jav a 2s.co m*/ schematronRulesFile = new OpenFileFieldEditor("metadataFile", "Schematron schema file", true, FileFieldEditor.VALIDATE_ON_KEY_STROKE, container); schematronRulesFile.setEmptyStringAllowed(false); schematronRulesFile.setFilterNames(new String[] { "Schematron schema (*.xml, *.sch)" }); schematronRulesFile.setFileExtensions(new String[] { "*.xml; *.sch" }); SchematronInstanceValidator validator = this.getProvider(); if (validator != null && validator.getSchematronLocation() != null && validator.getSchematronLocation().getScheme().equals("file")) { File file = new File(validator.getSchematronLocation().getPath()); schematronRulesFile.setStringValue(file.getAbsolutePath()); } else { // isValid starts with false even if emptyStringAllowed is true. // -> force validation hack schematronRulesFile.setStringValue(" "); schematronRulesFile.setStringValue(""); } return composite; }
From source file:eu.esdihumboldt.hale.ui.common.definition.AttributeInputDialog.java
License:Open Source License
/** * @see Dialog#createDialogArea(Composite) *//*ww w .ja v a 2 s .co m*/ @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); 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 editor AttributeEditorFactory aef = (AttributeEditorFactory) PlatformUI.getWorkbench() .getService(AttributeEditorFactory.class); editor = aef.createEditor(composite, definition, entity, false); editor.getControl().setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); editor.setPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(Editor.IS_VALID)) getButton(IDialogConstants.OK_ID).setEnabled((Boolean) event.getNewValue()); } }); applyDialogFont(composite); return composite; }
From source file:eu.esdihumboldt.hale.ui.io.instance.ValidatorSelectionDialog.java
License:Open Source License
/** * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) *///from w ww .jav a 2 s . com @Override protected Control createDialogArea(Composite parent) { 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); composite.setLayoutData(data); Label label = new Label(composite, SWT.NONE); label.setText("Please select a validator if you want to validate the exported file"); label.setLayoutData(GridDataFactory.swtDefaults().span(3, 1).align(SWT.BEGINNING, SWT.BEGINNING).create()); validators = new ComboViewer(composite, SWT.DROP_DOWN | SWT.READ_ONLY); validators.getControl().setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); validators.setContentProvider(ArrayContentProvider.getInstance()); validators.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { if (element instanceof IOProviderDescriptor) { return ((IOProviderDescriptor) element).getDisplayName(); } return super.getText(element); } }); validators.setInput(input); validators.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { selection = event.getSelection(); } }); return composite; }
From source file:eu.geclipse.ui.dialogs.PasswordDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); // create message if (this.message != null) { Label label = new Label(composite, SWT.WRAP); label.setText(this.message); 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);// ww w. java2 s .c o m label.setFont(parent.getFont()); } this.text = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD); this.text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); this.text.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { validateInput(); } }); this.errorMessageText = new Text(composite, SWT.READ_ONLY); this.errorMessageText .setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); this.errorMessageText .setBackground(this.errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); // Set the error message text // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292 setErrorMessage(this.errorMessage); applyDialogFont(composite); return composite; }
From source file:eu.geclipse.ui.dialogs.ProblemDialog.java
License:Open Source License
protected void createLabelArea(final Composite parent) { if (this.message != null) { int wHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); final ScrolledComposite sComp = createListArea("Message:", parent, 100); final Composite comp = new Composite(sComp, SWT.NONE); sComp.setContent(comp);// w w w . j av a2 s.c o m comp.setLayout(new GridLayout(1, false)); Label label = new Label(comp, SWT.WRAP); label.setText(this.message); GridData gData = new GridData(GridData.FILL_HORIZONTAL); gData.grabExcessHorizontalSpace = true; gData.widthHint = wHint; label.setLayoutData(gData); Point size = comp.computeSize(wHint, SWT.DEFAULT); comp.setSize(size); sComp.addControlListener(new ControlAdapter() { @Override public void controlResized(final ControlEvent e) { Rectangle r = sComp.getClientArea(); Point cSize = comp.computeSize(r.width, SWT.DEFAULT); comp.setSize(cSize); } }); } }