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:org.easotope.client.handler.ShowVideos.java
License:Open Source License
@Execute public void execute(Shell shell) { if (!Browse.launch(Messages.showVideos_url)) { MessageDialog.open(MessageDialog.INFORMATION, shell, Messages.showVideos_noBrowserTitle, Messages.showVideos_noBrowserMessage, SWT.SHEET); }/* ww w. jav a 2 s . c o m*/ }
From source file:org.easotope.client.handler.SubscribeToUserList.java
License:Open Source License
@Execute public void execute(Shell shell) { MessageDialog.open(MessageDialog.INFORMATION, shell, Messages.subscribeToUserList_explainTitle, Messages.subscribeToUserList_explainMessage, SWT.SHEET); if (!Email.launch(Messages.subscribeToUserList_address, Messages.subscribeToUserList_subject, Messages.subscribeToUserList_body)) { MessageDialog.open(MessageDialog.INFORMATION, shell, Messages.subscribeToUserList_noEmailTitle, Messages.subscribeToUserList_noEmailMessage, SWT.SHEET); }// w w w . ja v a 2 s . co m }
From source file:org.ebayopensource.turmeric.eclipse.typelibrary.ui.actions.ActionUtil.java
License:Open Source License
/** * Validates the given editor and the adapted object. In Type Lib context * these are the checks performed Editor should have either a wsdl or xsd * file. Adapted object should either be an XSD Model object or WSDL Model * object//from w w w. j av a 2 s .c o m * * @param editorPart2 the editor part2 * @param adaptedObject either XSD Schema or WSDL Definiton * @return false if the file extension of the editor part's file is not XSD * or WSDL input or the adapted object is not XSD or WSDL Model * @throws ValidationInterruptedException the validation interrupted exception */ public static boolean validateEditor(IEditorPart editorPart2, Object adaptedObject) throws ValidationInterruptedException { if (editorPart2.getEditorInput() instanceof FileEditorInput) { IFile editorFile = ((FileEditorInput) editorPart2.getEditorInput()).getFile(); if (adaptedObject instanceof XSDSchema) { if (!StringUtils.equalsIgnoreCase(editorFile.getFileExtension(), SOATypeLibraryConstants.XSD)) { String errorMessage = "The XSD Editor does not have a XSD file in it, but a " + editorFile.getFileExtension() + " file. This might be because you tried to edit the WSDL and opened up the schema in an Inline Schema editor. Please go to the WSDL Editor's Source tab and try importing it again."; UIUtil.openChoiceDialog("The type cannot be imported.", errorMessage, MessageDialog.INFORMATION); return false; } } if (adaptedObject instanceof Definition) { if (!StringUtils.equalsIgnoreCase(editorFile.getFileExtension(), SOAProjectConstants.WSDL)) { String errorMessage = "The WSDL Editor does not have a WSDL file in it, but a " + editorFile.getFileExtension() + " file. This operation is not supported in a non WSDL File."; UIUtil.openChoiceDialog("The type cannot be imported.", errorMessage, MessageDialog.INFORMATION); return false; } } final IProject project = editorFile.getProject(); final IStatus status = validateTypeDependencyAndProjectConfigFile(project); final String messages = ValidateUtil.getFormattedStatusMessagesForAction(status); if (messages != null) { UIUtil.showErrorDialog(UIUtil.getActiveShell(), "Error", messages, (Throwable) null); return false; } } return true; }
From source file:org.ebayopensource.turmeric.eclipse.typelibrary.ui.actions.SyncUpDependencyAction.java
License:Open Source License
@Override public void run(final IAction action) { if (SOALogger.DEBUG) logger.entering(action, selection); try {//from w w w. j av a2s .c om if (selection == null) return; final IProject project = ActionUtil.preValidateAction(selection.getFirstElement(), logger); if (validate(project)) { executeTask(project); MessageDialog.openInformation(UIUtil.getActiveShell(), "The operation was performed successfully.", "The dependency information for this project has been updated successfully."); } } catch (Exception e) { logger.error(e); UIUtil.openChoiceDialog("The selected operation cannot be performed.", "This might be due to one of the following reasons, \r 1) Type Library registry is not synchronized, Please go to Types Explorer view and select refresh. ", MessageDialog.INFORMATION); } finally { if (SOALogger.DEBUG) logger.exiting(); } }
From source file:org.ebayopensource.turmeric.eclipse.typelibrary.ui.resources.TypeLibMoveDeleteHook.java
License:Open Source License
@Override public void resourceChanged(IResourceChangeEvent event) { if (IResourceChangeEvent.POST_CHANGE == event.getType()) { TypeLibraryDeltaVisitor typeLibraryDeltaVisitor = new TypeLibraryDeltaVisitor(); try {/* w ww.j a v a 2s.c o m*/ event.getDelta().accept(typeLibraryDeltaVisitor); } catch (CoreException e1) { SOALogger.getLogger().error(e1); } ArrayList<IFile> deletedXSDs = typeLibraryDeltaVisitor.getDeletedXSDList(); Map<LibraryType, List<LibraryType>> typesWithChildren = new ConcurrentHashMap<LibraryType, List<LibraryType>>(); Map<LibraryType, List<LibraryType>> typesWithParents = new ConcurrentHashMap<LibraryType, List<LibraryType>>(); final HashSet<String> projectSet = new HashSet<String>(); // Warn if any dep exists try { for (IFile file : deletedXSDs) { LibraryType libraryType = SOAGlobalRegistryAdapter.getInstance().getGlobalRegistry() .getType(TypeLibraryUtil.toQName(file)); if (libraryType == null) return; if (!CollectionUtil.isEmpty(SOAGlobalRegistryAdapter.getInstance().getGlobalRegistry() .getDependentChildTypeFiles(libraryType))) { typesWithChildren.put(libraryType, SOAGlobalRegistryAdapter.getInstance() .getGlobalRegistry().getDependentChildTypeFiles(libraryType)); } if (!CollectionUtil.isEmpty(SOAGlobalRegistryAdapter.getInstance().getGlobalRegistry() .getDependentParentTypeFiles(libraryType))) { typesWithParents.put(libraryType, SOAGlobalRegistryAdapter.getInstance().getGlobalRegistry() .getDependentParentTypeFiles(libraryType)); } if (file.getProject() != null) projectSet.add(file.getProject().getName()); } if (typeLibraryDeltaVisitor.getDeletedProject().isEmpty() == false) { SOALogger.getLogger().info("Removing type library projects from the SOA type registry->", typeLibraryDeltaVisitor.getDeletedProject()); SOATypeRegistry typeRegistry = GlobalRepositorySystem.instanceOf().getActiveRepositorySystem() .getTypeRegistryBridge().getSOATypeRegistry(); for (IProject deletedProject : typeLibraryDeltaVisitor.getDeletedProject()) { typeRegistry.removeLibraryFromRegistry(deletedProject.getName()); } } } catch (Exception exception) { UIUtil.openChoiceDialog("Possible Issues", "There might be some issues in the build or registry. Please do a project clean and update the registry.", MessageDialog.INFORMATION); SOALogger.getLogger().error(exception); } StringBuffer errorStr = new StringBuffer( "There are some modifications required in the TypeDependency.xml and/or TypeInformation.xml with respect to the delete action you performed now, Please ignore this message if you used Schema Type --> Delete Type context menu. "); boolean showFlag = false; if (!typesWithChildren.isEmpty()) { errorStr.append( "\n\r\n Severe Issue: The types you deleted is referred by some other types. Please make sure that while building it, either change the dependency from the parent type or please put this type back."); showFlag = true; } if (!typesWithParents.isEmpty()) { errorStr.append( "\n\r\n Minor Issue: The types you deleted refer to some other types. The typedependency/typeinformation file of this type needs to be modified. Right click project -- > Schema Type --> Synchronize Dependencies or Select Project --> Clean. \r\n\n"); showFlag = true; } if (showFlag) { UIUtil.showErrorDialog(null, "", "Found dependency issues", errorStr.toString()); } } }
From source file:org.ebayopensource.turmeric.eclipse.typelibrary.ui.wst.ImportTypeFromTypeLibrary.java
License:Open Source License
/** * Shows the common Error dialog in case of import failures. Most of these * failures are due to stale registry or invalid XSD opened up outside the * work space etc. Thats why we show this common error in most cases. * * @param t the t//from w w w .j a v a 2 s. co m */ public static void showCommonErrorDialog(Throwable t) { String msg = SOAMessages.OP_ERR_DETAILS; if (t != null) { msg += "\r\rRoot Cause:" + t.toString(); } UIUtil.openChoiceDialog(SOAMessages.OP_ERR, msg, MessageDialog.INFORMATION); }
From source file:org.ebayopensource.turmeric.eclipse.typelibrary.ui.wst.UpdateTypeVersion.java
License:Open Source License
/** * {@inheritDoc}/*www . java 2 s . c o m*/ */ @Override public void run(IAction action) { try { if (WTPTypeLibUtil.validateEditorForContextMenus(editorPart)) { Object adaptedObject = TypeLibraryUtil.getAdapterClassFromWTPEditors(editorPart); if (adaptedObject instanceof Definition) { if (super.doValidation() == false) return; Definition definition = (Definition) adaptedObject; Map<LibraryType, XSDTypeDefinition> importedTypesMap = TypeLibraryActivator .getTypeLibraryTypes(definition); Map<LibraryType, XSDTypeDefinition> modifiedTypesMap = WTPTypeLibUtil .getUpdatedSchemas(importedTypesMap, getSelectedProject()); TypeSelector typeSelector = new TypeSelector(UIUtil.getActiveShell(), SOAMessages.NEW_VRSN, importedTypesMap.keySet().toArray(new LibraryType[0]), getSelectedProject().getName(), new CustomTypeSelectorRenderer(modifiedTypesMap.keySet())); typeSelector.setMultipleSelection(true); if (typeSelector.open() == Window.OK) { modifyWSDL(typeSelector.getSelectedTypes(), definition, importedTypesMap, getSelectedProject()); UIUtil.openChoiceDialog(SOAMessages.UPDTS_DONE, SOAMessages.UPDTS_DONE_DTL, MessageDialog.INFORMATION); } } else { ImportTypeFromTypeLibrary.showCommonErrorDialog(null); } } } catch (Exception e) { SOALogger.getLogger().error(e); ImportTypeFromTypeLibrary.showCommonErrorDialog(e); } }
From source file:org.ebayopensource.vjet.eclipse.internal.ui.wizards.VjoNewElementWizard.java
License:Open Source License
protected void warnAboutTypeCommentDeprecation() { String key = IUIConstants.DIALOGSTORE_TYPECOMMENT_DEPRECATED; if (OptionalMessageDialog.isDialogEnabled(key)) { // TemplateStore templates= // DLTKUIPlugin.getDefault().getTemplateStore(); // boolean isOldWorkspace= templates.findTemplate("filecomment") != // null && templates.findTemplate("typecomment") != null; // //$NON-NLS-1$ //$NON-NLS-2$ // if (!isOldWorkspace) { // OptionalMessageDialog.setDialogEnabled(key, false); // }/*from ww w.j av a 2 s . c o m*/ if (DLTKCore.DEBUG) { System.err.println("NewElementWizard: Add templates support here"); //$NON-NLS-1$ } String title = NewWizardMessages.NewElementWizard_typecomment_deprecated_title; String message = NewWizardMessages.NewElementWizard_typecomment_deprecated_message; OptionalMessageDialog.open(key, getShell(), title, null, message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); } }
From source file:org.eclipse.birt.chart.reportitem.ui.views.attributes.provider.ChartBindingGroupDescriptorProvider.java
License:Open Source License
public void save(Object saveValue) throws SemanticException { if (saveValue instanceof BindingInfo) { BindingInfo info = (BindingInfo) saveValue; int type = info.getBindingType(); String value = info.getBindingValue().toString(); switch (type) { case ReportItemHandle.DATABINDING_TYPE_DATA: if (value.equals(NONE)) { value = null;/*from w w w. j a v a 2 s . c om*/ } else if (value.equals(DATA_SETS_DEFAULT)) { value = ChoiceSetFactory.getDataSets()[0]; } else if (value.equals(DATA_CUBES_DEFAULT)) { value = ChoiceSetFactory.getCubes()[0]; } int ret = 0; if (!NONE.equals(((BindingInfo) load()).getBindingValue().toString()) || getReportItemHandle().getColumnBindings().iterator().hasNext()) { MessageDialog prefDialog = new MessageDialog(UIUtil.getDefaultShell(), Messages.getString("dataBinding.title.changeDataSet"), //$NON-NLS-1$ null, Messages.getString("dataBinding.message.changeDataSet"), //$NON-NLS-1$ MessageDialog.INFORMATION, new String[] { Messages.getString("AttributeView.dialg.Message.Yes"), //$NON-NLS-1$ Messages.getString("AttributeView.dialg.Message.No"), //$NON-NLS-1$ Messages.getString("AttributeView.dialg.Message.Cancel") }, //$NON-NLS-1$ 0); ret = prefDialog.open(); } switch (ret) { // Clear binding info case 0: if (getAvailableDatasets().contains(value)) { resetDataSetReference(value, info, true); } else { resetCubeReference(value, true); } break; // Doesn't clear binding info case 1: if (getAvailableDatasets().contains(value)) { resetDataSetReference(value, info, false); } else resetCubeReference(value, false); break; // Cancel. case 2: section.load(); } break; case ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF: if (value.equals(NONE)) { value = null; } int ret1 = 0; if (!NONE.equals(((BindingInfo) load()).getBindingValue().toString()) || getReportItemHandle().getColumnBindings().iterator().hasNext()) { MessageDialog prefDialog = new MessageDialog(UIUtil.getDefaultShell(), Messages.getString("dataBinding.title.changeDataSet"), //$NON-NLS-1$ null, Messages.getString("dataBinding.message.changeDataSet"), //$NON-NLS-1$ MessageDialog.INFORMATION, new String[] { Messages.getString("AttributeView.dialg.Message.Yes"), //$NON-NLS-1$ Messages.getString("AttributeView.dialg.Message.Cancel") }, //$NON-NLS-1$ 0); ret1 = prefDialog.open(); } switch (ret1) { // Clear binding info case 0: resetReference(value, true); break; // Cancel. case 1: section.load(); } } } }
From source file:org.eclipse.birt.data.oda.mongodb.ui.impl.MongoDBDataSetWizardPage.java
License:Open Source License
private void synchronizeSearchLimit() throws OdaException { if (!queryProps.hasRuntimeMetaDataSearchLimit()) return;//from ww w . j a va2s.co m int runtimeLimit = queryProps.getRuntimeMetaDataSearchLimit().intValue(); if (runtimeLimit < this.searchLimit) { MessageDialog infoDialog = new MessageDialog(sComposite.getShell(), Messages.getString("MongoDBAdvancedSettingsDialog.MessageDialog.synchronizeSearchLimit.title"), null, Messages.getString( "MongoDBAdvancedSettingsDialog.MessageDialog.synchronizeSearchLimit.message"), MessageDialog.INFORMATION, new String[] { Messages.getString( "MongoDBAdvancedSettingsDialog.MessageDialog.synchronizeSearchLimit.button") }, 0); if (infoDialog.open() == Window.OK) { this.searchLimit = runtimeLimit; docNumText.setText(String.valueOf(searchLimit)); updateAvailableFieldsList(); refreshAvailableFieldsViewer(); availableFieldsViewer.expandToLevel(2); refreshSelectedFieldsViewer(); selectedFieldsTable.getTable().deselectAll(); autoSelectRootItem(); } } }