List of usage examples for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH
int ENTRY_FIELD_WIDTH
To view the source code for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH.
Click Source Link
From source file:org.eclipse.linuxtools.tmf.ui.views.project.dialogs.NewExperimentDialog.java
License:Open Source License
/** * Creates the folder name specification controls. * * @param parent the parent composite//from w ww .j a v a 2 s . c o m */ private void createFolderNameGroup(Composite parent) { Font font = parent.getFont(); Composite folderGroup = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; folderGroup.setLayout(layout); folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // new folder label Label folderLabel = new Label(folderGroup, SWT.NONE); folderLabel.setFont(font); folderLabel.setText( org.eclipse.linuxtools.tmf.ui.views.project.dialogs.IDEWorkbenchMessages.NewExperimentDialog_ExperimentName + ": "); //$NON-NLS-1$ // new folder name entry field folderNameField = new Text(folderGroup, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; folderNameField.setLayoutData(data); folderNameField.setFont(font); folderNameField.addListener(SWT.Modify, new Listener() { @Override public void handleEvent(Event event) { validateLinkedResource(); } }); }
From source file:org.eclipse.mylyn.commons.repositories.ui.RepositoryLocationPart.java
License:Open Source License
private void createCertificateAuthSection(SectionComposite parent) { int style = SWT.NONE; if (getWorkingCopy().getCredentials(AuthenticationType.CERTIFICATE, false) != null) { style |= ExpandableComposite.EXPANDED; }/*from w w w . j a va 2 s . c o m*/ ExpandableComposite section = parent .createSection(Messages.RepositoryLocationPart_Certificate_Authentiation, style); section.clientVerticalSpacing = 5; final Composite composite = new Composite(section, SWT.NONE); section.setClient(composite); GridLayoutFactory.fillDefaults().numColumns(3).applyTo(composite); Label label; Button enableButton = new Button(composite, SWT.CHECK); GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(enableButton); enableButton.setText(Messages.RepositoryLocationPart_Enable_certificate_authentication); label = new Label(composite, SWT.NONE); label.setText(Messages.RepositoryLocationPart_Keystorefile); final Text keyStoreFileNameText = new Text(composite, SWT.BORDER); // FIXME fix width hint GridDataFactory.fillDefaults().grab(true, false).hint(IDialogConstants.ENTRY_FIELD_WIDTH, SWT.DEFAULT) .applyTo(keyStoreFileNameText); Button certBrowseButton = new Button(composite, SWT.PUSH); certBrowseButton.setText(Messages.RepositoryLocationPart_Browse); certBrowseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog fileDialog = new FileDialog(composite.getShell(), SWT.OPEN); fileDialog.setFilterPath(keyStoreFileNameText.getText()); String fileName = fileDialog.open(); if (fileName != null) { keyStoreFileNameText.setText(fileName); } } }); label = new Label(composite, SWT.NONE); label.setText(Messages.RepositoryLocationPart_Password); Text passwordText = new Text(composite, SWT.BORDER | SWT.PASSWORD); GridDataFactory.fillDefaults().grab(true, false).applyTo(passwordText); Button savePasswordButton = new Button(composite, SWT.CHECK); savePasswordButton.setText(Messages.RepositoryLocationPart_Save_Password); bindCertificateCredentials(AuthenticationType.CERTIFICATE, enableButton, keyStoreFileNameText, passwordText, savePasswordButton); }
From source file:org.eclipse.mylyn.commons.ui.dialogs.CredentialsDialog.java
License:Open Source License
private void createKeyStoreControls(Composite composite) { new Label(composite, SWT.NONE).setText(Messages.CredentialsDialog_KeyStore); final Text keyStoreField = new Text(composite, SWT.BORDER); keyStoreField.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { keyStoreFileName = keyStoreField.getText(); }//w w w . j a v a 2 s . c om }); keyStoreField.setText(keyStoreFileName); if (keyStoreFileName.length() == 0) { keyStoreField.setFocus(); } GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER) .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .grab(true, false).applyTo(keyStoreField); Button browseButton = new Button(composite, SWT.PUSH); browseButton.setText(Messages.CredentialsDialog_Browse); browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); if (keyStoreFileName != null) { fileDialog.setFilterPath(System.getProperty("user.home", ".")); //$NON-NLS-1$ //$NON-NLS-2$ } String returnFile = fileDialog.open(); if (returnFile != null) { username = returnFile; keyStoreField.setText(returnFile); } } }); }
From source file:org.eclipse.mylyn.commons.ui.dialogs.CredentialsDialog.java
License:Open Source License
private void createPasswordControls(Composite composite) { new Label(composite, SWT.NONE).setText(Messages.CredentialsDialog_Password); final Text passwordField = new Text(composite, SWT.BORDER | SWT.PASSWORD); passwordField.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { password = passwordField.getText(); }//from w w w .ja va 2 s. c o m }); passwordField.setText(password); if (username.length() > 0) { passwordField.setFocus(); } GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(2, 1) .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .grab(true, false).applyTo(passwordField); final Button savePasswordButton = new Button(composite, SWT.CHECK); savePasswordButton.setText(Messages.CredentialsDialog_SavePassword); savePasswordButton.setSelection(savePassword); savePasswordButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { savePassword = savePasswordButton.getSelection(); } }); GridDataFactory.fillDefaults().span(3, 1).applyTo(savePasswordButton); }
From source file:org.eclipse.mylyn.commons.ui.dialogs.CredentialsDialog.java
License:Open Source License
private void createUserControls(Composite composite) { new Label(composite, SWT.NONE).setText(Messages.CredentialsDialog_Username); final Text usernameText = new Text(composite, SWT.BORDER); usernameText.setText(username);/*from w ww .java2s . c om*/ usernameText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { username = usernameText.getText(); } }); if (username.length() == 0) { usernameText.setFocus(); } GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER) .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT).span(2, 1) .grab(true, false).applyTo(usernameText); if (needsDomain()) { new Label(composite, SWT.NONE).setText(Messages.CredentialsDialog_Domain); final Text domainText = new Text(composite, SWT.BORDER); domainText.setText(domain); domainText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { domain = domainText.getText(); } }); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER) .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT).span(2, 1) .grab(true, false).applyTo(domainText); } }
From source file:org.eclipse.mylyn.internal.builds.ui.view.ParametersDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); setTitle(NLS.bind("Build Plan {0}", plan.getLabel())); Composite pane = new Composite(composite, SWT.NONE); pane.setLayoutData(new GridData(GridData.FILL_BOTH)); pane.setLayout(new GridLayout(2, false)); for (final IParameterDefinition definition : plan.getParameterDefinitions()) { String name = definition.getName(); Label label = new Label(pane, SWT.NONE); label.setText(name);/*w ww . jav a2 s . co m*/ Control control = addParameter(pane, definition); if (control instanceof Text) { GridDataFactory.fillDefaults() .hint(convertVerticalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .applyTo(control); } control.addFocusListener(new FocusAdapter() { private boolean firstTime = true; @Override public void focusGained(FocusEvent e) { if (firstTime) { setMessage("Provide build parameters."); firstTime = false; } else { setMessage(definition.getDescription()); } } }); controls.put(name, control); } return composite; }
From source file:org.eclipse.mylyn.internal.tasks.ui.dialogs.TaskRepositoryCredentialsDialog.java
License:Open Source License
private void createCenterArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(3, false)); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); if (taskRepository != null) { Composite labelComposite = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(3, false); layout.marginHeight = 0;//from ww w . j av a 2s . c o m layout.marginWidth = 0; labelComposite.setLayout(layout); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(3, 1) .applyTo(labelComposite); Label label = new Label(labelComposite, SWT.NONE); label.setImage(TasksUiPlugin.getDefault().getBrandingIcon(taskRepository.getConnectorKind())); label = new Label(labelComposite, SWT.NONE); label.setText(Messages.TaskRepositoryCredentialsDialog_Task_Repository); label = new Label(labelComposite, SWT.NONE); label.setText(taskRepository.getRepositoryLabel()); } if (isFileDialog) { new Label(composite, SWT.NONE).setText(Messages.TaskRepositoryCredentialsDialog_Filename); } else { new Label(composite, SWT.NONE).setText(Messages.TaskRepositoryCredentialsDialog_User_ID); } final Text usernameField = new Text(composite, SWT.BORDER); usernameField.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { username = usernameField.getText(); } }); usernameField.setText(username); if (username.length() == 0) { usernameField.setFocus(); } GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER) .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .grab(true, false).applyTo(usernameField); if (isFileDialog) { certBrowseButton = new Button(composite, SWT.PUSH); certBrowseButton.setText(Messages.TaskRepositoryCredentialsDialog_ChooseCertificateFile); certBrowseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); fileDialog.setFilterPath(System.getProperty("user.home", ".")); //$NON-NLS-1$ //$NON-NLS-2$ String returnFile = fileDialog.open(); if (returnFile != null) { username = returnFile; usernameField.setText(returnFile); } } }); } else { new Label(composite, SWT.NONE).setText(" "); //$NON-NLS-1$ } new Label(composite, SWT.NONE).setText(Messages.TaskRepositoryCredentialsDialog_Password); final Text passwordField = new Text(composite, SWT.BORDER | SWT.PASSWORD); passwordField.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { password = passwordField.getText(); } }); passwordField.setText(password); if (username.length() > 0) { passwordField.setFocus(); } GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER) .hint(convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH), SWT.DEFAULT) .grab(true, false).applyTo(passwordField); final Button savePasswordButton = new Button(composite, SWT.CHECK); savePasswordButton.setText(Messages.TaskRepositoryCredentialsDialog_Save_Password); savePasswordButton.setSelection(savePassword); savePasswordButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { savePassword = savePasswordButton.getSelection(); } }); GridDataFactory.fillDefaults().span(3, 1).applyTo(savePasswordButton); createWarningMessage(composite); }
From source file:org.eclipse.ptp.remotetools.environment.generichost.ui.KeyboardInteractiveDialog.java
License:Open Source License
/** * Creates the widgets that represent the entry area. * /*from ww w . j av a2s . c o m*/ * @param parent * the parent of the widgets */ protected void createPasswordFields(Composite parent) { texts = new Text[prompt.length]; for (int i = 0; i < prompt.length; i++) { new Label(parent, SWT.NONE).setText(prompt[i]); texts[i] = new Text(parent, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); texts[i].setLayoutData(data); if (!echo[i]) { texts[i].setEchoChar('*'); } new Label(parent, SWT.NONE); } }
From source file:org.eclipse.ptp.remotetools.environment.generichost.ui.UserValidationDialog.java
License:Open Source License
/** * Creates the three widgets that represent the password entry area. * //from w w w . java2s.c om * @param parent * the parent of the widgets */ protected void createPasswordFields(Composite parent) { new Label(parent, SWT.NONE).setText(Messages.UserValidationDialog_Password); passwordField = new Text(parent, SWT.BORDER | SWT.PASSWORD); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); passwordField.setLayoutData(data); }
From source file:org.eclipse.ptp.remotetools.environment.generichost.ui.UserValidationDialog.java
License:Open Source License
/** * Creates the three widgets that represent the user name entry area. * /*from w w w . j ava2 s. c om*/ * @param parent * the parent of the widgets */ protected void createUsernameFields(Composite parent) { new Label(parent, SWT.NONE).setText(Messages.UserValidationDialog_3); usernameField = new Text(parent, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); usernameField.setLayoutData(data); }