当前位置: 首页>>代码示例>>Java>>正文


Java SelectionDialog.setTitle方法代码示例

本文整理汇总了Java中org.eclipse.ui.dialogs.SelectionDialog.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java SelectionDialog.setTitle方法的具体用法?Java SelectionDialog.setTitle怎么用?Java SelectionDialog.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.dialogs.SelectionDialog的用法示例。


在下文中一共展示了SelectionDialog.setTitle方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doBrowseTypes

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:ProblemSeveritiesConfigurationBlock.java

示例2: handleManifestmainclassBrowse

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
/**
 * Uses the standard container selection dialog to
 * choose the new value for the container field.
 */

private void handleManifestmainclassBrowse() {

    String mainClass = getManifestmainclass();
    
    ILabelProvider lp= new WorkbenchLabelProvider();
    ITreeContentProvider cp= new WorkbenchContentProvider();

    IResource[] res=jproject.getResource();
    IJavaSearchScope searchScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(res, true);
    SelectionDialog dialog = JavaUI.createMainTypeDialog(getShell(), getContainer(), searchScope, 0, false);
    dialog.setMessage("Select Main-Class for JAR file");
    dialog.setTitle("Fat Jar Config");
    
    if (dialog.open() == SelectionDialog.OK) {
        Object[] elements= dialog.getResult();
        if (elements.length == 1) {
            SourceType mainElement = (SourceType)elements[0];
            mainClass = mainElement.getFullyQualifiedName();
            manifestmainclassText.setText(mainClass);
        }
    }
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:28,代码来源:ConfigPage.java

示例3: handleMainClassBrowseButtonPressed

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
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));
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:JarManifestWizardPage.java

示例4: run

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
@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]);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:GotoTypeAction.java

示例5: doBrowseTypes

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
/**
 * 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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:ExpandWithConstructorsConfigurationBlock.java

示例6: browseForBuilderClass

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:GenerateToStringDialog.java

示例7: doBrowseTypes

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:CodeAssistFavoritesConfigurationBlock.java

示例8: doBrowseTypes

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:ImportOrganizeInputDialog.java

示例9: handleManifestmainclassBrowse

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
/**
 * Uses the standard container selection dialog to choose the new value for
 * the container field.
 */

private void handleManifestmainclassBrowse() {
	try {
		String mainClass = getManifestmainclass();

		ILabelProvider lp = new WorkbenchLabelProvider();
		ITreeContentProvider cp = new WorkbenchContentProvider();

		IResource[] res = { jproject.getCorrespondingResource() };
		IJavaSearchScope searchScope = JavaSearchScopeFactory.getInstance().createJavaSearchScope(res, true);
		SelectionDialog dialog = JavaUI.createMainTypeDialog(getShell(), getContainer(), searchScope, 0, false);
		dialog.setMessage("Select Main-Class for JAR file");
		dialog.setTitle("Fat Jar Config");

		if (dialog.open() == SelectionDialog.OK) {
			Object[] elements = dialog.getResult();
			if (elements.length == 1) {
				SourceType mainElement = (SourceType) elements[0];
				mainClass = mainElement.getFullyQualifiedName();
				manifestmainclassText.setText(mainClass);
			}
		}
	} catch (JavaModelException e) {
		e.printStackTrace();
	}
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:31,代码来源:FJExportWizardConfigPage.java

示例10: handleSealPackagesDetailsButtonPressed

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:JarManifestWizardPage.java

示例11: handleUnSealPackagesDetailsButtonPressed

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:JarManifestWizardPage.java

示例12: run

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
@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]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:GotoPackageAction.java

示例13: handleSelectSuperClass

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
private void handleSelectSuperClass() {
       Shell parent = getShell();
       SelectionDialog dialog;
	try {
		if (project != null) {
			dialog = JavaUI.createTypeDialog(
			    parent, new ProgressMonitorDialog(parent),
			    project,
			    IJavaElementSearchConstants.CONSIDER_CLASSES, SINGLE_SELECTION);
		} else {
			dialog = JavaUI.createTypeDialog(
			    parent, new ProgressMonitorDialog(parent),
			    SearchEngine.createWorkspaceScope(),
			    IJavaElementSearchConstants.CONSIDER_CLASSES, SINGLE_SELECTION);
		}
	} catch (JavaModelException e) {
		return;
	}
       
       dialog.setTitle("Select superclass");
       dialog.setMessage("Fixture superclass");
       if (dialog.open() == IDialogConstants.CANCEL_ID)
           return;

       Object[] types = dialog.getResult();
       if (types == null || types.length == 0)
           return;
       
       IType superClass = (IType) types[0];
       superClassText.setText(superClass.getFullyQualifiedName());
}
 
开发者ID:sunix,项目名称:org.concordion.ide.eclipse,代码行数:32,代码来源:NewSpecWizardPage.java

示例14: getJavaClassDialog

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
public static String getJavaClassDialog(Shell shell, List<Class<?>> classes) {
	try {
		IJavaSearchScope searchScope = SearchEngine.createWorkspaceScope();
		if (classes != null && !classes.isEmpty()) {
			IProject prj = ((IFileEditorInput) SelectionHelper.getActiveJRXMLEditor().getEditorInput()).getFile()
					.getProject();
			if (prj != null) {
				IJavaProject jprj = JavaCore.create(prj);
				IType t;

				t = jprj.findType(classes.get(0).getName());
				// ITypeHierarchy hierarchy = t.newTypeHierarchy(new
				// NullProgressMonitor());
				// IType[] subTypes = hierarchy.getAllSubtypes(t);
				if (t != null)
					searchScope = BasicSearchEngine.createHierarchyScope(t);// (jprj, t, owner, true, true, true);

			}
		}
		// FilteredTypesSelectionDialog a = new FilteredTypesSelectionDialog();
		// a.
		// JavaModelUtil.g
		// searchScope.enclosingProjectsAndJars()[0].
		//
		// SearchEngine.createHierarchyScope(IType.);
		// IType focus = ...;
		// IJavaProject project = ...;
		// ITypeHierarchy hierarchy = focus.newTypeHierarchy(project, pm);
		// IType[] subTypes = hierarchy.getAllSubTypes(focus);
		// IJavaSearchScope scope = SearchEngine.createJavaSearchScope(subTypes);
		// SearchPattern sp = SearchPattern.createPattern("java.lang.String", IJavaSearchConstants.CLASS,
		// IJavaSearchConstants.IMPLEMENTORS, SearchPattern.R_EXACT_MATCH);
		// FilteredTypesSelectionDialog a = new FilteredTypesSelectionDialog(shell, false, new
		// ProgressMonitorDialog(shell),
		// searchScope, SearchPattern.R_EXACT_MATCH);

		// ;
		// -------------
		// IProject project; // currently selected project
		//
		// // get the java project and locate the interface type
		// JavaProject javaProject = JavaCore.create(project);
		// IType myInterface = javaProject.findType("MyInterface", "name.seller.rich");
		//
		// // get the sub types from the interface's type hierarchy
		// ITypeHierarchy hierarchy = myInterface.newTypeHierarchy(new NullProgressMonitor());
		//
		// IType[] subTypes = hierarchy.getAllSubtypes(myInterface);

		SelectionDialog dialog = JavaUI.createTypeDialog(shell, new ProgressMonitorDialog(shell), searchScope,
				IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES, false);
		dialog.setTitle(Messages.ClassTypeCellEditor_open_type);
		dialog.setMessage(Messages.ClassTypeCellEditor_dialog_message);
		if (dialog.open() == Window.OK) {
			if (dialog.getResult() != null && dialog.getResult().length > 0) {
				IType bt = (IType) dialog.getResult()[0];
				return bt.getFullyQualifiedName();
			}
		}
	} catch (JavaModelException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:66,代码来源:ClassTypeCellEditor.java


注:本文中的org.eclipse.ui.dialogs.SelectionDialog.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。