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.tigris.subversion.subclipse.core.util.RebootConfirmDialog.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 ww w . j a v a 2 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()); } // label=new Label(composite,SWT.NONE); // label.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL // | GridData.HORIZONTAL_ALIGN_FILL)); // label.setText("12345678"); 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.tigris.subversion.subclipse.ui.util.DetailsDialogWithProjects.java
License:Open Source License
/** * @see DetailsDialog#createMainDialogArea(Composite) *///from w w w. j a v a 2 s . c om protected void createMainDialogArea(Composite composite) { Label label = new Label(composite, SWT.WRAP); label.setText(message); //$NON-NLS-1$ 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(composite.getFont()); updateEnablements(); }
From source file:org.universaal.uaalpax.ui.dialogs.AddEditUrlDialog.java
License:Apache License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); validator = new IInputValidator() { public String isValid(String newText) { try { Integer.parseInt(newText); return null; } catch (NumberFormatException e) { return "Level must be an integer"; }/* ww w. java 2 s. co m*/ } }; Label urlLabel = new Label(composite, SWT.WRAP); urlLabel.setText(urlMessage); GridData urlData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); urlData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); urlLabel.setLayoutData(urlData); urlLabel.setFont(parent.getFont()); urlInput = new Text(composite, SWT.SINGLE | SWT.BORDER); urlInput.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); urlInput.setText(url.url); urlInput.addFocusListener(new FocusListener() { public void focusLost(FocusEvent e) { } public void focusGained(FocusEvent e) { urlInput.selectAll(); } }); urlInput.setFocus(); Label lvlLabel = new Label(composite, SWT.WRAP); lvlLabel.setText(levelMessage); GridData lvlData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); lvlData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); lvlLabel.setLayoutData(lvlData); lvlLabel.setFont(parent.getFont()); levelInput = new Text(composite, SWT.SINGLE | SWT.BORDER); levelInput.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); levelInput.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validateLevel(); } }); levelInput.setText(String.valueOf(level)); levelInput.addFocusListener(new FocusListener() { public void focusLost(FocusEvent e) { } public void focusGained(FocusEvent e) { levelInput.selectAll(); } }); 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); errorMessageText.setForeground(new Color(errorMessageText.getDisplay(), 255, 0, 0)); applyDialogFont(composite); return composite; }
From source file:org.universaal.uaalpax.ui.dialogs.NewRunconfigDialog.java
License:Apache License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); validator = new IInputValidator() { public String isValid(String newText) { if (newText.isEmpty()) return "Name must not be empty"; else// w w w . ja v a2 s . com return null; } }; Label urlLabel = new Label(composite, SWT.WRAP); urlLabel.setText(nameMessage); GridData urlData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); urlData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); urlLabel.setLayoutData(urlData); urlLabel.setFont(parent.getFont()); nameInput = new Text(composite, SWT.SINGLE | SWT.BORDER); nameInput.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); nameInput.setText(name); nameInput.addFocusListener(new FocusListener() { public void focusLost(FocusEvent e) { } public void focusGained(FocusEvent e) { nameInput.selectAll(); } }); nameInput.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validateName(); } }); nameInput.setFocus(); IWorkspaceRoot myWorkspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); projects = myWorkspaceRoot.getProjects(); Label projectLabel = new Label(composite, SWT.WRAP); projectLabel.setText(projectMessage); GridData lvlData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); lvlData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); projectLabel.setLayoutData(lvlData); projectLabel.setFont(parent.getFont()); projectCombo = new Combo(composite, SWT.READ_ONLY); projectCombo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); String[] items = new String[projects.length + 1]; items[0] = "default"; for (int i = 0; i < projects.length; i++) items[i + 1] = projects[i].getName(); projectCombo.setItems(items); projectCombo.select(0); 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); errorMessageText.setForeground(new Color(errorMessageText.getDisplay(), 255, 0, 0)); applyDialogFont(composite); return composite; }
From source file:org.vclipse.base.ui.ErrorDialog.java
License:Open Source License
@Override protected Control createCustomArea(Composite composite) { Composite mainArea = new Composite(composite, SWT.NONE); mainArea.setLayout(new GridLayout(2, false)); Label label = new Label(mainArea, SWT.NONE); label.setText(status.getMessage());/* w w w. j a v a 2 s . c o m*/ label.setLayoutData(new GridData()); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, true) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(label); return mainArea; }
From source file:org.vclipse.connection.dialogs.IDocErrorDialog.java
License:Open Source License
/** * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite) *//*from w w w .j a v a2 s. c o m*/ @Override protected Control createCustomArea(final Composite composite) { final Link link = new Link(composite, SWT.NONE); link.setText("Please follow the VClipse installation instructions (see <a>VCLipse User Guide</a>):\n" + "Download SAP IDoc3 from the SAP Service Marketplace and " + "copy the file sapidoc3.jar into the directory " + "plugins\\org.vclipse.sapjco3_1.1.0 inside your Eclipse installation directory."); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent event) { // -> gegen displayHelp(String contextid) eintauschen PlatformUI.getWorkbench().getHelpSystem().displayHelp(); } }); 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:org.vclipse.connection.dialogs.JCoErrorDialog.java
License:Open Source License
/** * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite) *//*from www . jav a 2 s. c om*/ @Override protected Control createCustomArea(final Composite composite) { final Link link = new Link(composite, SWT.NONE); link.setText("Please follow the VClipse installation instructions (see <a>VClipse User Guide</a>):\n" + "Download SAP JCo3 from the SAP Service Marketplace and " + "copy the files sapjco3.dll and sapjco3.jar into the directory " + "plugins\\org.vclipse.sapjco3_1.1.0 inside your Eclipse installation directory."); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent event) { // -> gegen displayHelp(String contextid) eintauschen PlatformUI.getWorkbench().getHelpSystem().displayHelp(); } }); 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:org.xilaew.atg.dialogs.ActTCGPropertyDialog.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 .j a va 2 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()); } max_depth_paths = new Text(composite, getInputTextStyle()); max_depth_paths.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); max_no_paths = new Text(composite, getInputTextStyle()); max_no_paths.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); solver_name = new Text(composite, getInputTextStyle()); solver_name.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); // max_depth_paths.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:org.zend.usagedata.ui.internal.wizards.DetailsPage.java
License:Open Source License
public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); Label description = new Label(composite, SWT.WRAP); description.setText(MessageFormat.format(Messages.DetailsPage_UDCDescription, UIUsageDataActivator.getDefault().getProductName())); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(description);/*from w ww .ja va 2 s. c o m*/ createTermsOfUseSection(composite); setControl(composite); }
From source file:org2.eclipse.php.internal.debug.ui.breakpoint.property.PHPBreakpointPropertyPage.java
License:Open Source License
protected Control createContents(Composite parent) { breakpoint = (PHPConditionalBreakpoint) getElement().getAdapter(PHPConditionalBreakpoint.class); if (breakpoint == null) { PHPDebugEPLPlugin.logError("Could not adapt to PHPConditionalBreakpoint"); return null; }//w ww. j a v a 2 s. c o m conditionEnabled = breakpoint.isConditionEnabled(); String currentCondition = breakpoint.getCondition(); if (currentCondition.equals("")) { conditionEnabled = true; } Label label = new Label(parent, SWT.WRAP); label.setText(MessageFormat.format(PHPDebugUIMessages.EnterCondition_1, new Object[] {})); 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(parent.getFont()); text = new Text(parent, SWT.SINGLE | SWT.BORDER); text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); text.setText(currentCondition); final Button checkbox = new Button(parent, SWT.CHECK); data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); checkbox.setLayoutData(data); checkbox.setFont(parent.getFont()); checkbox.setText(MessageFormat.format(PHPDebugUIMessages.EnableSetCondition_1, new Object[] {})); checkbox.setSelection(conditionEnabled); text.setEnabled(conditionEnabled); checkbox.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { conditionEnabled = checkbox.getSelection(); text.setEnabled(conditionEnabled); } public void widgetDefaultSelected(SelectionEvent e) { } }); return parent; }