Java Code Examples for org.eclipse.ui.dialogs.SelectionDialog#setMessage()
The following examples show how to use
org.eclipse.ui.dialogs.SelectionDialog#setMessage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JarManifestWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
protected void handleMainClassBrowseButtonPressed() { List<IResource> resources= JarPackagerUtil.asResources(fJarPackage.getElements()); if (resources == null) { setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_noResourceSelected); return; } IJavaSearchScope searchScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(resources.toArray(new IResource[resources.size()]), true); SelectionDialog dialog= JavaUI.createMainTypeDialog(getContainer().getShell(), getContainer(), searchScope, 0, false, ""); //$NON-NLS-1$ dialog.setTitle(JarPackagerMessages.JarManifestWizardPage_mainTypeSelectionDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_mainTypeSelectionDialog_message); if (fJarPackage.getManifestMainClass() != null) dialog.setInitialSelections(new Object[] {fJarPackage.getManifestMainClass()}); if (dialog.open() == Window.OK) { fJarPackage.setManifestMainClass((IType)dialog.getResult()[0]); fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage)); } else if (!fJarPackage.isMainClassValid(getContainer())) { // user did not cancel: no types were found fJarPackage.setManifestMainClass(null); fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage)); } }
Example 2
Source File: GotoTypeAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@Override public void run() { Shell shell= JavaPlugin.getActiveWorkbenchShell(); SelectionDialog dialog= null; try { dialog= JavaUI.createTypeDialog(shell, new ProgressMonitorDialog(shell), SearchEngine.createWorkspaceScope(), IJavaElementSearchConstants.CONSIDER_ALL_TYPES, false); } catch (JavaModelException e) { String title= getDialogTitle(); String message= PackagesMessages.GotoType_error_message; ExceptionHandler.handle(e, title, message); return; } dialog.setTitle(getDialogTitle()); dialog.setMessage(PackagesMessages.GotoType_dialog_message); if (dialog.open() == IDialogConstants.CANCEL_ID) { return; } Object[] types= dialog.getResult(); if (types != null && types.length > 0) { gotoType((IType) types[0]); } }
Example 3
Source File: ExpandWithConstructorsConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * Creates the type hierarchy for type selection. */ private void doBrowseTypes() { IRunnableContext context= new BusyIndicatorRunnableContext(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int style= IJavaElementSearchConstants.CONSIDER_ALL_TYPES; try { SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), context, scope, style, false, fNameDialogField.getText()); dialog.setTitle(CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_ChooseTypeDialog_title); dialog.setMessage(CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_ChooseTypeDialog_description); if (dialog.open() == Window.OK) { IType res= (IType)dialog.getResult()[0]; fNameDialogField.setText(res.getFullyQualifiedName('.')); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_ChooseTypeDialog_title, CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_ChooseTypeDialog_error_message); } }
Example 4
Source File: GenerateToStringDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void browseForBuilderClass() { try { IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { getType().getJavaProject() }); SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), PlatformUI.getWorkbench().getProgressService(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, "*ToString", fExtension); //$NON-NLS-1$ dialog.setTitle(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_windowTitle); dialog.setMessage(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_message); dialog.open(); if (dialog.getReturnCode() == OK) { IType type= (IType)dialog.getResult()[0]; fBuilderClassName.setText(type.getFullyQualifiedParameterizedName()); List<String> suggestions= fValidator.getAppendMethodSuggestions(type); if (!suggestions.contains(fAppendMethodName.getText())) fAppendMethodName.setText(suggestions.get(0)); suggestions= fValidator.getResultMethodSuggestions(type); if (!suggestions.contains(fResultMethodName.getText())) fResultMethodName.setText(suggestions.get(0)); } } catch (JavaModelException e) { JavaPlugin.log(e); } }
Example 5
Source File: CodeAssistFavoritesConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void doBrowseTypes() { IRunnableContext context= new BusyIndicatorRunnableContext(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int style= IJavaElementSearchConstants.CONSIDER_ALL_TYPES; try { SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), context, scope, style, false, fNameDialogField.getText()); dialog.setTitle(PreferencesMessages.FavoriteStaticMemberInputDialog_ChooseTypeDialog_title); dialog.setMessage(PreferencesMessages.FavoriteStaticMemberInputDialog_ChooseTypeDialog_description); if (dialog.open() == Window.OK) { IType res= (IType) dialog.getResult()[0]; fNameDialogField.setText(res.getFullyQualifiedName('.')); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), PreferencesMessages.FavoriteStaticMemberInputDialog_ChooseTypeDialog_title, PreferencesMessages.FavoriteStaticMemberInputDialog_ChooseTypeDialog_error_message); } }
Example 6
Source File: ProblemSeveritiesConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void doBrowseTypes(StringButtonDialogField dialogField) { IRunnableContext context= new BusyIndicatorRunnableContext(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int style= IJavaElementSearchConstants.CONSIDER_ANNOTATION_TYPES; try { SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), context, scope, style, false, dialogField.getText()); dialog.setTitle(PreferencesMessages.NullAnnotationsConfigurationDialog_browse_title); dialog.setMessage(PreferencesMessages.NullAnnotationsConfigurationDialog_choose_annotation); if (dialog.open() == Window.OK) { IType res= (IType) dialog.getResult()[0]; dialogField.setText(res.getFullyQualifiedName('.')); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), PreferencesMessages.NullAnnotationsConfigurationDialog_error_title, PreferencesMessages.NullAnnotationsConfigurationDialog_error_message); } }
Example 7
Source File: ImportOrganizeInputDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void doBrowseTypes() { IRunnableContext context= new BusyIndicatorRunnableContext(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int style= IJavaElementSearchConstants.CONSIDER_ALL_TYPES; try { SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), context, scope, style, false, fNameDialogField.getText()); dialog.setTitle(PreferencesMessages.ImportOrganizeInputDialog_ChooseTypeDialog_title); dialog.setMessage(PreferencesMessages.ImportOrganizeInputDialog_ChooseTypeDialog_description); if (dialog.open() == Window.OK) { IType res= (IType) dialog.getResult()[0]; fNameDialogField.setText(res.getFullyQualifiedName('.')); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), PreferencesMessages.ImportOrganizeInputDialog_ChooseTypeDialog_title, PreferencesMessages.ImportOrganizeInputDialog_ChooseTypeDialog_error_message); } }
Example 8
Source File: JarManifestWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
protected void handleSealPackagesDetailsButtonPressed() { SelectionDialog dialog= createPackageDialog(getPackagesForSelectedResources()); dialog.setTitle(JarPackagerMessages.JarManifestWizardPage_sealedPackagesSelectionDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_sealedPackagesSelectionDialog_message); dialog.setInitialSelections(fJarPackage.getPackagesToSeal()); if (dialog.open() == Window.OK) fJarPackage.setPackagesToSeal(getPackagesFromDialog(dialog)); updateSealingInfo(); }
Example 9
Source File: JarManifestWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
protected void handleUnSealPackagesDetailsButtonPressed() { SelectionDialog dialog= createPackageDialog(getPackagesForSelectedResources()); dialog.setTitle(JarPackagerMessages.JarManifestWizardPage_unsealedPackagesSelectionDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_unsealedPackagesSelectionDialog_message); dialog.setInitialSelections(fJarPackage.getPackagesToUnseal()); if (dialog.open() == Window.OK) fJarPackage.setPackagesToUnseal(getPackagesFromDialog(dialog)); updateSealingInfo(); }
Example 10
Source File: GotoPackageAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@Override public void run() { Shell shell= JavaPlugin.getActiveWorkbenchShell(); SelectionDialog dialog= createAllPackagesDialog(shell); dialog.setTitle(getDialogTitle()); dialog.setMessage(PackagesMessages.GotoPackage_dialog_message); dialog.open(); Object[] res= dialog.getResult(); if (res != null && res.length == 1) gotoPackage((IPackageFragment)res[0]); }
Example 11
Source File: PrimitiveSection.java From uima-uimaj with Apache License 2.0 | 4 votes |
@Override public void handleEvent(Event event) { valueChanged = false; OperationalProperties ops = getOperationalProperties(); if (event.widget == findButton) { String className = null; try { String implKind = editor.getAeDescription().getFrameworkImplementation(); if (Constants.CPP_FRAMEWORK_NAME.equals(implKind)) { FileDialog dialog = new FileDialog(getSection().getShell(), SWT.NONE); String[] extensions = { "*.dll" }; dialog.setFilterExtensions(extensions); String sStartDir = Platform.getLocation().toString(); dialog.setFilterPath(sStartDir); className = dialog.open(); } else { SelectionDialog typeDialog = JavaUI.createTypeDialog(getSection().getShell(), editor .getEditorSite().getWorkbenchWindow(), editor.getSearchScopeForDescriptorType(), IJavaElementSearchConstants.CONSIDER_CLASSES, false, "*"); typeDialog.setTitle(MessageFormat.format("Choose the {0} implementation class", new Object[] { editor.descriptorTypeString() })); typeDialog.setMessage("Filter/mask:"); if (typeDialog.open() == Window.CANCEL) return; Object[] result = typeDialog.getResult(); if (result != null && result.length > 0) className = ((IType) result[0]).getFullyQualifiedName(); } if (className == null || className.equals("")) //$NON-NLS-1$ return; implName.setText(className); editor.getAeDescription().setAnnotatorImplementationName(className); valueChanged = true; } catch (JavaModelException e) { throw new InternalErrorCDE("unexpected Exception", e); } } else if (event.widget == modifiesCas) { ops.setModifiesCas(setValueChangedBoolean(modifiesCas.getSelection(), ops.getModifiesCas())); } else if (event.widget == multipleDeploymentAllowed) { ops.setMultipleDeploymentAllowed(setValueChangedBoolean(multipleDeploymentAllowed .getSelection(), ops.isMultipleDeploymentAllowed())); } else if (event.widget == outputsNewCASes) { ops.setOutputsNewCASes(setValueChangedBoolean(outputsNewCASes.getSelection(), ops .getOutputsNewCASes())); } else if (event.widget == implName) { editor.getAeDescription().setAnnotatorImplementationName( setValueChanged(implName.getText(), editor.getAeDescription() .getAnnotatorImplementationName())); } if (valueChanged) editor.setFileDirty(); }