List of usage examples for org.eclipse.jface.dialogs IMessageProvider INFORMATION
int INFORMATION
To view the source code for org.eclipse.jface.dialogs IMessageProvider INFORMATION.
Click Source Link
From source file:com.kopson.cite.actions.AddSmartLogRowDialog.java
License:Open Source License
@Override protected Control createContents(Composite parent) { Control contents = super.createContents(parent); setTitle(CITE.ADDLOGROW_DIALOG_TITLE); setMessage(CITE.ADDLOGROW_DIALOG_MSG, IMessageProvider.INFORMATION); return contents; }
From source file:com.matlab.eclipse.meditor.AbstractMatlabenginePrefsPage.java
License:Open Source License
/** * Applies the status to the status line of a dialog page. * @param page the dialog page/*from ww w . j av a 2s.c o m*/ * @param status the status */ public void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message.length() == 0) { message = null; } page.setMessage(null); page.setErrorMessage(message); break; } }
From source file:com.mercatis.lighthouse3.ui.event.providers.ShowHideDialog.java
License:Apache License
@Override protected Control createContents(Composite parent) { Control contents = super.createContents(parent); setTitle("Show/Hide Columns"); setMessage("Please choose the columns to show", IMessageProvider.INFORMATION); return contents; }
From source file:com.microsoft.azuretools.docker.ui.dialogs.AzureInputDockerLoginCredsDialog.java
License:Open Source License
private void initUIComponents(Composite mainContainer) { setTitle("Docker Host Log In Credentials"); if (resetCredentials) { setMessage(String.format("Update %s with new log in credentials", editableDockerHost.originalDockerHost.name), IMessageProvider.INFORMATION); } else {//from ww w . j a va 2 s . com setMessage(String.format("Docker host %s log in credentials not found; enter your log in credentials", editableDockerHost.originalDockerHost.name), IMessageProvider.INFORMATION); } copyFromAzureKeyButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { AzureSelectKeyVault azureSelectKeyVaultDialog = new AzureSelectKeyVault(mainContainer.getShell(), dockerManager); if (azureSelectKeyVaultDialog.open() == Window.OK && azureSelectKeyVaultDialog.getSelectedKeyvault() != null) { updateUIWithKeyvault(azureSelectKeyVaultDialog.getSelectedKeyvault()); } okButton.setEnabled(doValidate()); } }); dockerHostUsernameTextField.setText((editableDockerHost.originalDockerHost.certVault != null && editableDockerHost.originalDockerHost.certVault.vmUsername != null) ? editableDockerHost.originalDockerHost.certVault.vmUsername : ""); dockerHostUsernameTextField.setToolTipText(AzureDockerValidationUtils.getDockerHostUserNameTip()); dockerHostUsernameTextField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent event) { if (!resetCredentials || AzureDockerValidationUtils .validateDockerHostUserName(((Text) event.getSource()).getText())) { errDispatcher.removeMessage("dockerHostUsernameTextField", dockerHostUsernameTextField); setErrorMessage(null); okButton.setEnabled(doValidate()); } else { errDispatcher.addMessage("dockerHostUsernameTextField", AzureDockerValidationUtils.getDockerHostUserNameTip(), null, IMessageProvider.ERROR, dockerHostUsernameTextField); setErrorMessage("Invalid user name"); okButton.setEnabled(false); } } }); dockerHostFirstPwdField.setToolTipText(AzureDockerValidationUtils.getDockerHostPasswordTip()); dockerHostFirstPwdField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent event) { String text = ((Text) event.getSource()).getText(); if (text == null || text.isEmpty() || (!resetCredentials || AzureDockerValidationUtils.validateDockerHostPassword(text))) { errDispatcher.removeMessage("dockerHostFirstPwdField", dockerHostFirstPwdField); setErrorMessage(null); if (!resetCredentials) { dockerHostSecondPwdField.setText(text); } okButton.setEnabled(doValidate()); } else { errDispatcher.addMessage("dockerHostFirstPwdField", AzureDockerValidationUtils.getDockerHostPasswordTip(), null, IMessageProvider.ERROR, dockerHostFirstPwdField); setErrorMessage("Invalid password"); okButton.setEnabled(false); } } }); dockerHostSecondPwdField.setVisible(resetCredentials); dockerHostSecondPwdField.setToolTipText(AzureDockerValidationUtils.getDockerHostPasswordTip()); dockerHostSecondPwdField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent event) { String pwd1 = dockerHostFirstPwdField.getText(); String pwd2 = ((Text) event.getSource()).getText(); if ((pwd1 == null && pwd2 == null) || pwd2.equals(pwd1)) { errDispatcher.removeMessage("dockerHostSecondPwdField", dockerHostSecondPwdField); setErrorMessage(null); okButton.setEnabled(doValidate()); } else { errDispatcher.addMessage("dockerHostSecondPwdField", AzureDockerValidationUtils.getDockerHostPasswordTip(), null, IMessageProvider.ERROR, dockerHostSecondPwdField); setErrorMessage("Invalid confirmation password"); okButton.setEnabled(false); } } }); dockerHostKeepSshRadioButton.setSelection(true); dockerHostKeepSshRadioButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { dockerHostImportSSHTextField.setEnabled(false); dockerHostImportSSHBrowseButton.setEnabled(false); errDispatcher.removeMessage("dockerHostImportSSHTextField", dockerHostImportSSHTextField); setErrorMessage(null); if (editableDockerHost.originalDockerHost.hasSSHLogIn) { AzureDockerCertVaultOps.copyVaultSshKeys(editableDockerHost.updatedDockerHost.certVault, editableDockerHost.originalDockerHost.certVault); } editableDockerHost.updatedDockerHost.hasSSHLogIn = editableDockerHost.originalDockerHost.hasSSHLogIn; okButton.setEnabled(doValidate()); } }); dockerHostImportSshRadioButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { dockerHostImportSSHTextField.setEnabled(true); dockerHostImportSSHBrowseButton.setEnabled(true); okButton.setEnabled(doValidate()); } }); dockerHostImportSSHTextField.setEnabled(false); dockerHostImportSSHTextField.setToolTipText(AzureDockerValidationUtils.getDockerHostSshDirectoryTip()); dockerHostImportSSHTextField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent event) { if (AzureDockerValidationUtils .validateDockerHostSshDirectory(((Text) event.getSource()).getText())) { errDispatcher.removeMessage("dockerHostImportSSHTextField", dockerHostImportSSHTextField); setErrorMessage(null); okButton.setEnabled(doValidate()); } else { errDispatcher.addMessage("dockerHostImportSSHTextField", AzureDockerValidationUtils.getDockerHostSshDirectoryTip(), null, IMessageProvider.ERROR, dockerHostImportSSHTextField); setErrorMessage("SSH key files not found in the specified directory"); okButton.setEnabled(false); } } }); dockerHostImportSSHBrowseButton.setEnabled(false); dockerHostImportSSHBrowseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog directoryDialog = new DirectoryDialog(dockerHostImportSSHBrowseButton.getShell()); directoryDialog.setText("Select SSH Keys Directory"); directoryDialog.setFilterPath(System.getProperty("user.home")); String path = directoryDialog.open(); if (path == null) { return; } dockerHostImportSSHTextField.setText(path); okButton.setEnabled(doValidate()); } }); dockerHostAutoSshRadioButton.setVisible(resetCredentials); dockerHostAutoSshRadioButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { dockerHostImportSSHTextField.setEnabled(false); dockerHostImportSSHBrowseButton.setEnabled(false); errDispatcher.removeMessage("dockerHostImportSSHTextField", dockerHostImportSSHTextField); setErrorMessage(null); AzureDockerCertVault certVault = AzureDockerCertVaultOps.generateSSHKeys(null, "SSH keys for " + editableDockerHost.updatedDockerHost.name); AzureDockerCertVaultOps.copyVaultSshKeys(editableDockerHost.updatedDockerHost.certVault, certVault); editableDockerHost.updatedDockerHost.hasSSHLogIn = true; okButton.setEnabled(doValidate()); } }); }
From source file:com.mindquarry.desktop.client.dialog.conflict.AbstractConflictDialog.java
License:Open Source License
protected Control createContents(Composite parent) { Control contents = super.createContents(parent); setTitle(getTitle());/*from w ww . j a v a2 s .co m*/ setMessage(getMessage(), IMessageProvider.INFORMATION); getShell().setText(I18N.getString("Resolving conflicts")); //$NON-NLS-1$ getShell().setSize(600, getHeightHint()); getShell().redraw(); return contents; }
From source file:com.mindquarry.desktop.client.dialog.task.TaskSettingsDialog.java
License:Open Source License
/** * @see org.eclipse.jface.dialogs.TitleAreaDialog#createContents(org.eclipse.swt.widgets.Composite) *//*from w ww.j a v a 2 s . c o m*/ protected Control createContents(Composite parent) { Control contents = super.createContents(parent); setTitle(I18N.getString("Edit the contents of a task")); //$NON-NLS-1$ setMessage(I18N.getString("Please enter the tasks data and press OK for adding/changing the task."), //$NON-NLS-1$ IMessageProvider.INFORMATION); getShell().setText(I18N.getString("Edit Task") //$NON-NLS-1$ + ": " //$NON-NLS-1$ + task.getTitle()); getShell().setSize(400, 650); getShell().redraw(); return contents; }
From source file:com.mindquarry.desktop.client.dialog.team.TeamSelectionDialog.java
License:Open Source License
protected Control createContents(Composite parent) { Control contents = super.createContents(parent); setTitle(I18N.getString("Select a Team")); //$NON-NLS-1$ setMessage(I18N.getString("Please select one of your teams."), //$NON-NLS-1$ IMessageProvider.INFORMATION); getShell().setText(I18N.getString("Select a Team")); //$NON-NLS-1$ return contents; }
From source file:com.mindquarry.desktop.client.dialog.workspace.CommitDialog.java
License:Open Source License
protected Control createContents(Composite parent) { Control contents = super.createContents(parent); String title = I18N.get("Commit message for team '{0}'", //$NON-NLS-1$ teamName);//from ww w . jav a 2s . c o m setTitle(title); getShell().setText(title); setMessage(I18N.get("Please describe the changes you have " + //$NON-NLS-1$ "made to the following files in team '{0}'", teamName), //$NON-NLS-1$ IMessageProvider.INFORMATION); getShell().setSize(600, 350); getShell().redraw(); return contents; }
From source file:com.mobilesorcery.sdk.ui.internal.properties.BuildSettingsPropertyPage.java
License:Open Source License
private void validateMemorySettings(ValidationMessageProvider provider) { if (!new Version(version.getText()).isValid()) { provider.setMessage(version,// ww w . j a va 2 s . c o m new DefaultMessageProvider( "Invalid version format, must comply to major[.minor][.micro][.qualifier]", IMessageProvider.ERROR)); } provider.setMessage(stackSize, validateInteger(stackSize.getText(), "Stack size", 1L << 22)); provider.setMessage(heapSize, validateInteger(heapSize.getText(), "Heap size", 1L << 22)); provider.setMessage(dataSize, validateInteger(dataSize.getText(), "Data size", 1L << 22)); if (provider.isEmpty(stackSize) && provider.isEmpty(heapSize) && provider.isEmpty(dataSize)) { // They're all integers long stackSize = Long.parseLong(this.stackSize.getText()); long heapSize = Long.parseLong(this.heapSize.getText()); long dataSize = Long.parseLong(this.dataSize.getText()); if (dataSize < stackSize + heapSize) { provider.setMessage(this.dataSize, new DefaultMessageProvider( "Data size must be at least as large as the stack and heap sizes combined", IMessageProvider.ERROR)); } else if (ceil2p(dataSize) != dataSize) { provider.setMessage(this.dataSize, new DefaultMessageProvider(MessageFormat .format("Will round up data size to nearest power of 2 ({0} kb)", ceil2p(dataSize)), IMessageProvider.INFORMATION)); } } }
From source file:com.motorola.studio.android.common.utilities.ui.PasswordInputDialog.java
License:Apache License
private void setErrorMessage(String errorMsg, int severity) { if ((errorMsg == null) || (severity == IMessageProvider.NONE)) { image.setImage(null);/*from www. ja va2s . c o m*/ image.setVisible(false); message.setText(description); getButton(OK).setEnabled(errorMsg == null); } else { message.setText(errorMsg); message.setVisible(true); switch (severity) { case IMessageProvider.ERROR: image.setImage( PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); break; case IMessageProvider.INFORMATION: image.setImage( PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK)); break; case IMessageProvider.WARNING: image.setImage( PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK)); break; default: image.setImage( PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); break; } image.setVisible(true); getButton(OK).setEnabled(false); } message.getParent().layout(); }