List of usage examples for org.eclipse.jface.dialogs MessageDialog INFORMATION
int INFORMATION
To view the source code for org.eclipse.jface.dialogs MessageDialog INFORMATION.
Click Source Link
From source file:carisma.ui.eclipse.editors.AdfEditorMasterDetailsBlock.java
License:Open Source License
/** * This method activates or deactivates the editors combo box. * //from w ww .j a v a2s . co m * @param active * True, if the combo box should be activated, false otherwise * @param message * the message, which will be shown */ private void updateSelectedEditorEnableState(final boolean active, final String message) { boolean validEditor = false; if (this.selectedEditorCombo.getEnabled() != active) { this.selectedEditorCombo.removeAll(); if (active) { this.selectedEditorCombo.setEnabled(true); // Get the editors final EditorRegistry editorRegistry = CarismaGUI.INSTANCE.getEditorRegistry(); List<EditorDescriptor> editorDescriptorList = editorRegistry.getRegisteredEditors(); this.selectedEditorCombo.add(DEFAULT_EDITOR); // Add all applicable editors to the combo box for (EditorDescriptor editorDesc : editorDescriptorList) { if (editorDesc.isAvailable() && editorDesc.isApplicable(this.controller.getModelIFile())) { this.selectedEditorCombo.add(editorDesc.getName()); } } // Select 'Default Eclipse Editor' by default or the editor, // which is saved in the adf file this.selectedEditorCombo.select(0); EditorDescriptor savedEditorDescriptor = editorRegistry .getEditorDescriptorById(this.controller.getSelectedEditorId()); if (savedEditorDescriptor != null) { int index = 0; for (String item : this.selectedEditorCombo.getItems()) { if (item.equals(savedEditorDescriptor.getName())) { this.selectedEditorCombo.select(index); validEditor = true; break; } index++; } } else { if ((this.controller.getSelectedEditorId().equals("")) || (this.controller.getSelectedEditorId().equals("Default Eclipse Editor"))) { validEditor = true; } } this.selectedEditorCombo.setToolTipText("Choose an editor to open the model."); this.selectedEditorDecoration.hide(); } else { if (EditorPriorityList.getPriorityList(this.controller.getModelType()) != null && EditorPriorityList.getPriorityList(this.controller.getModelType()).size() >= 1) { this.selectedEditorCombo .add(EditorPriorityList.getPriorityList(this.controller.getModelType()).get(0)); } else { this.selectedEditorCombo.add("Priority list is empty!"); } this.selectedEditorCombo.select(0); this.selectedEditorCombo.setEnabled(false); this.selectedEditorDecoration.setDescriptionText(message); this.selectedEditorCombo.setToolTipText(""); this.selectedEditorDecoration.show(); } if (!validEditor) { //MessageBox if the stored editor is invalid MessageDialog messageDialog = new MessageDialog(this.selectedEditorCombo.getShell(), "Invalid Model-Editor", null, "The chosen editor for the modeltype of the CARiSMA analysis is invalid." + "\nThe ID is \"" + this.controller.getSelectedEditorId() + "\"." + "\nThe default editor will be chosen." + "\nClick \"OK && remove ID\" to change the editor to the default editor in the analysis file.", MessageDialog.INFORMATION, new String[] { "OK", "OK && remove ID" }, 0); // && in strings results in & messageDialog.open(); if (messageDialog.getReturnCode() == 1) { //set the stored Editor to the default Editor and saves the analysis file setEditorToDefault(); } } } }
From source file:codeOrchestra.lcs.license.AbstractExpirationWithSerialNumberStrategy.java
@Override public void showLicenseExpirationInProgressDialog() { String expireMessage = String.format( "You have %d days of %d evaluation period days left. You may continue evaluation or enter a serial number", getDaysLeft(), getExpirationPeriod()); MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "Evaluation License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "Continue Evaluation", "Enter Serial Number" }, 0); int result = dialog.open(); if (result == 1) { showSerialNumberDialog();/*w w w. j a v a2s .c o m*/ } }
From source file:codeOrchestra.lcs.license.FastCompilerBetaExpirationStrategy.java
@Override public boolean showLicenseExpiredDialog() { String expireMessage = "This copy of COLT has expired."; MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "COLT 1.1 (beta)", null, expireMessage, MessageDialog.INFORMATION, new String[] { "OK" }, 0); dialog.open();/*from w ww. j av a2s.c o m*/ return false; }
From source file:codeOrchestra.lcs.license.FastCompilerBetaExpirationStrategy.java
@SuppressWarnings("deprecation") @Override//from w w w. j a v a2s . co m public void showLicenseExpirationInProgressDialog() { String expireMessage = String.format("This copy of COLT will expire on %s", new Date(113, 5, 24).toLocaleString()); MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "COLT 1.1 (beta)", null, expireMessage, MessageDialog.INFORMATION, new String[] { "OK" }, 0); dialog.open(); }
From source file:codeOrchestra.lcs.license.PlimusSubscriptionExpirationStrategy.java
@Override public boolean showLicenseExpiredDialog() { if (haventValidatedOnServerForTooLong()) { String expireMessage = "Key validation requires an active internet connection"; MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "COLT License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "Exit" }, 0); dialog.open();/*from w ww . j a va 2s . co m*/ return false; } String expireMessage = isInTrialMode() ? "Your COLT trial period has expired. Browse to www.codeorchestra.com to purchase a subscription." : "Your COLT subscription has expired. Browse to www.codeorchestra.com to update the subscription."; MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "COLT License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "Exit", "Enter Serial Number" }, 1); int result = dialog.open(); if (result == 1) { return showSerialNumberDialog(); } return false; }
From source file:codeOrchestra.lcs.license.PlimusSubscriptionExpirationStrategy.java
@Override public void showLicenseExpirationInProgressDialog() { if (isInTrialMode()) { String expireMessage = String.format( "You have %d days of %d evaluation period days left. You may continue evaluation or enter a serial number", getDaysLeft(), getExpirationPeriod()); MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "Evaluation License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "Continue Evaluation", "Enter Serial Number" }, 0); int result = dialog.open(); if (result == 1) { showSerialNumberDialog();/* ww w .j a va2 s. c o m*/ } } else { if (getSubscriptionDaysLeft() < 4) { String expireMessage = String.format("You have %d days of paid subscription left.", getSubscriptionDaysLeft()); MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "Evaluation License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "OK" }, 0); dialog.open(); } } }
From source file:codeOrchestra.lcs.license.PlimusSubscriptionWithDemoExpirationStrategy.java
@Override public void handleExpiration() { demoMode = true;/*from ww w . j a v a2 s . c o m*/ String expireMessage = String.format("COLT is in Demo mode. Compilations count is limited to %d.", DemoHelper.get().getMaxCompilationsCount() - 1); MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "COLT License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "OK" }, 0); dialog.open(); }
From source file:codeOrchestra.lcs.license.PlimusSubscriptionWithDemoExpirationStrategy.java
@Override public boolean showLicenseExpiredDialog() { if (haventValidatedOnServerForTooLong() && !CodeOrchestraLicenseManager.noSerialNumberPresent()) { String expireMessage = "Key validation requires an active internet connection. COLT will be launched in Demo mode"; MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "COLT License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "OK" }, 0); dialog.open();/*from ww w .ja va 2 s .co m*/ return false; } String expireMessage = CodeOrchestraLicenseManager.noSerialNumberPresent() ? "Browse to www.codeorchestra.com to purchase a subscription or continue in Demo mode." : "Your COLT subscription has expired. Browse to www.codeorchestra.com to update the subscription or continue in Demo mode."; MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), "COLT License", null, expireMessage, MessageDialog.INFORMATION, new String[] { "Continue in Demo mode", "Enter Serial Number" }, 1); int result = dialog.open(); if (result == 1) { return showSerialNumberDialog(); } return false; }
From source file:com.amazonaws.eclipse.ec2.ui.PuTTYgenTranslationDialog.java
License:Apache License
/** * Creates a new dialog explaining how to convert an OpenSSH private key * file to a PuTTY compatible private key. * //from w ww . j av a2s. c o m * @param puttyPrivateKeyFile * The full path where the user must save the PuTTY key in * order for Eclipse to find it. */ public PuTTYgenTranslationDialog(String puttyPrivateKeyFile) { super(Display.getDefault().getShells()[0], "Translate Key with PuTTYgen", null, "This key needs to be translated with PuTTYgen before PuTTY can use it.", MessageDialog.INFORMATION, new String[] { "Ok" }, 1); this.puttyPrivateKeyFile = puttyPrivateKeyFile; }
From source file:com.amazonaws.eclipse.ec2.ui.views.instances.OpenShellDialog.java
License:Apache License
public OpenShellDialog() { super(Display.getDefault().getActiveShell(), "SSH Connection Options", null, "Configure the SSH connection to your Amazon EC2 instance with the options below.", MessageDialog.INFORMATION, new String[] { "Connect" }, 0); }