• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FilteredTypesSelectionDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog的典型用法代码示例。如果您正苦于以下问题:Java FilteredTypesSelectionDialog类的具体用法?Java FilteredTypesSelectionDialog怎么用?Java FilteredTypesSelectionDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FilteredTypesSelectionDialog类属于org.eclipse.jdt.internal.ui.dialogs包,在下文中一共展示了FilteredTypesSelectionDialog类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: chooseResourceType

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
private IType chooseResourceType() {
  IJavaSearchScope scope;
  try {
    scope = SearchEngine.createHierarchyScope(ClientBundleUtilities.findResourcePrototypeType(javaProject));
    FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(
        getShell(), false, PlatformUI.getWorkbench().getProgressService(),
        scope, IJavaSearchConstants.INTERFACE);
    dialog.setTitle("Resource Type Selection");
    dialog.setMessage("Choose a resource type:");

    if (dialog.open() == Window.OK) {
      return (IType) dialog.getFirstResult();
    }
  } catch (JavaModelException e) {
    GWTPluginLog.logError(e);
  }

  return null;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:20,代码来源:ClientBundleResourceDialog.java


示例2: chooseClientBundleType

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
private IType chooseClientBundleType() {
  try {
    // Create a search scope for finding ClientBundle subtypes
    IJavaSearchScope scope = SearchEngine.createHierarchyScope(ClientBundleUtilities.findClientBundleType(getJavaProject()));

    // Configure the type selection dialog
    FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(
        getShell(), false, PlatformUI.getWorkbench().getProgressService(),
        scope, IJavaSearchConstants.INTERFACE);
    dialog.setTitle("ClientBundle Type Selection");
    dialog.setMessage("Choose a type:");

    if (dialog.open() == Window.OK) {
      return (IType) dialog.getFirstResult();
    }
  } catch (JavaModelException e) {
    GWTPluginLog.logError(e);
  }

  return null;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:22,代码来源:AddResourcesToClientBundleDialog.java


示例3: chooseIntermediaryType

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
private IType chooseIntermediaryType() {
	IJavaProject proj= getIntroduceIndirectionRefactoring().getProject();

	if (proj == null)
		return null;

	IJavaElement[] elements= new IJavaElement[] { proj };
	IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);

	int elementKinds= JavaModelUtil.is18OrHigher(proj) ? IJavaSearchConstants.CLASS_AND_INTERFACE : IJavaSearchConstants.CLASS;
	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false, getWizard().getContainer(), scope, elementKinds);

	dialog.setTitle(RefactoringMessages.IntroduceIndirectionInputPage_dialog_choose_declaring_class);
	dialog.setMessage(RefactoringMessages.IntroduceIndirectionInputPage_dialog_choose_declaring_class_long);

	if (dialog.open() == Window.OK) {
		return (IType) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:IntroduceIndirectionInputPage.java


示例4: openTypeSelectionDialog

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
private void openTypeSelectionDialog(){
	int elementKinds= IJavaSearchConstants.TYPE;
	final IJavaSearchScope scope= createWorkspaceSourceScope();
	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false,
		getWizard().getContainer(), scope, elementKinds);
	dialog.setTitle(RefactoringMessages.MoveMembersInputPage_choose_Type);
	dialog.setMessage(RefactoringMessages.MoveMembersInputPage_dialogMessage);
	dialog.setValidator(new ISelectionStatusValidator(){
		public IStatus validate(Object[] selection) {
			Assert.isTrue(selection.length <= 1);
			if (selection.length == 0)
				return new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, RefactoringMessages.MoveMembersInputPage_Invalid_selection, null);
			Object element= selection[0];
			if (! (element instanceof IType))
				return new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, RefactoringMessages.MoveMembersInputPage_Invalid_selection, null);
			IType type= (IType)element;
			return validateDestinationType(type, type.getElementName());
		}
	});
	dialog.setInitialPattern(createInitialFilter());
	if (dialog.open() == Window.CANCEL)
		return;
	IType firstResult= (IType)dialog.getFirstResult();
	fDestinationField.setText(firstResult.getFullyQualifiedName('.'));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:MoveMembersWizard.java


示例5: browseForAccessorClass

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
protected void browseForAccessorClass() {
	IProgressService service= PlatformUI.getWorkbench().getProgressService();
	IPackageFragmentRoot root= fAccessorPackage.getSelectedFragmentRoot();

	IJavaSearchScope scope= root != null ? SearchEngine.createJavaSearchScope(new IJavaElement[] { root }) : SearchEngine.createWorkspaceScope();

	FilteredTypesSelectionDialog  dialog= new FilteredTypesSelectionDialog (getShell(), false,
		service, scope, IJavaSearchConstants.CLASS);
	dialog.setTitle(NLSUIMessages.NLSAccessorConfigurationDialog_Accessor_Selection);
	dialog.setMessage(NLSUIMessages.NLSAccessorConfigurationDialog_Choose_the_accessor_file);
	dialog.setInitialPattern("*Messages"); //$NON-NLS-1$
	if (dialog.open() == Window.OK) {
		IType selectedType= (IType) dialog.getFirstResult();
		if (selectedType != null) {
			fAccessorClassName.setText(selectedType.getElementName());
			fAccessorPackage.setSelected(selectedType.getPackageFragment());
		}
	}


}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:NLSAccessorConfigurationDialog.java


示例6: chooseFactoryClass

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
private IType chooseFactoryClass() {
	IJavaProject	proj= getUseFactoryRefactoring().getProject();

	if (proj == null)
		return null;

	IJavaElement[] elements= new IJavaElement[] { proj };
	IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);

	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(
		getShell(), false, getWizard().getContainer(), scope, IJavaSearchConstants.CLASS);

	dialog.setTitle(RefactoringMessages.IntroduceFactoryInputPage_chooseFactoryClass_title);
	dialog.setMessage(RefactoringMessages.IntroduceFactoryInputPage_chooseFactoryClass_message);

	if (dialog.open() == Window.OK) {
		return (IType) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:IntroduceFactoryInputPage.java


示例7: chooseEnclosingType

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
/**
 * Opens a selection dialog that allows to select an enclosing type.
 *
 * @return returns the selected type or <code>null</code> if the dialog has been canceled.
 * The caller typically sets the result to the enclosing type input field.
 * <p>
 * Clients can override this method if they want to offer a different dialog.
 * </p>
 *
 * @since 3.2
 */
protected IType chooseEnclosingType() {
	IPackageFragmentRoot root= getPackageFragmentRoot();
	if (root == null) {
		return null;
	}

	IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { root });

	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(),
		false, getWizard().getContainer(), scope, IJavaSearchConstants.TYPE);
	dialog.setTitle(NewWizardMessages.NewTypeWizardPage_ChooseEnclosingTypeDialog_title);
	dialog.setMessage(NewWizardMessages.NewTypeWizardPage_ChooseEnclosingTypeDialog_description);
	dialog.setInitialPattern(Signature.getSimpleName(getEnclosingTypeText()));

	if (dialog.open() == Window.OK) {
		return (IType) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:31,代码来源:NewTypeWizardPage.java


示例8: chooseSuperClass

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
/**
 * Opens a selection dialog that allows to select a super class.
 *
 * @return returns the selected type or <code>null</code> if the dialog has been canceled.
 * The caller typically sets the result to the super class input field.
 * 	<p>
 * Clients can override this method if they want to offer a different dialog.
 * </p>
 *
 * @since 3.2
 */
protected IType chooseSuperClass() {
	IJavaProject project= getJavaProject();
	if (project == null) {
		return null;
	}

	IJavaElement[] elements= new IJavaElement[] { project };
	IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);

	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false,
		getWizard().getContainer(), scope, IJavaSearchConstants.CLASS);
	dialog.setTitle(NewWizardMessages.NewTypeWizardPage_SuperClassDialog_title);
	dialog.setMessage(NewWizardMessages.NewTypeWizardPage_SuperClassDialog_message);
	dialog.setInitialPattern(getSuperClass());

	if (dialog.open() == Window.OK) {
		return (IType) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:32,代码来源:NewTypeWizardPage.java


示例9: run

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
@Override
public void run() {
	Shell parent= fViewPart.getSite().getShell();
	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(parent, false,
		PlatformUI.getWorkbench().getProgressService(),
		SearchEngine.createWorkspaceScope(), IJavaSearchConstants.TYPE);

	dialog.setTitle(TypeHierarchyMessages.FocusOnTypeAction_dialog_title);
	dialog.setMessage(TypeHierarchyMessages.FocusOnTypeAction_dialog_message);
	if (dialog.open() != IDialogConstants.OK_ID) {
		return;
	}

	Object[] types= dialog.getResult();
	if (types != null && types.length > 0) {
		IType type= (IType)types[0];
		fViewPart.setInputElement(type);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:FocusOnTypeAction.java


示例10: chooseIntermediaryClass

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
private IType chooseIntermediaryClass() {
	IJavaProject proj= getIntroduceIndirectionRefactoring().getProject();

	if (proj == null)
		return null;

	IJavaElement[] elements= new IJavaElement[] { proj };
	IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);

	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false, getWizard().getContainer(), scope, IJavaSearchConstants.CLASS);

	dialog.setTitle(RefactoringMessages.IntroduceIndirectionInputPage_dialog_choose_declaring_class);
	dialog.setMessage(RefactoringMessages.IntroduceIndirectionInputPage_dialog_choose_declaring_class_long);

	if (dialog.open() == Window.OK) {
		return (IType) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:20,代码来源:IntroduceIndirectionInputPage.java


示例11: openClassSelectionDialog

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
/**
 * Opens the class selection dialog to add services to the given {@link TemplateCustomProperties}.
 * 
 * @param customProperties
 *            the {@link TemplateCustomProperties}
 */
private void openClassSelectionDialog(final TemplateCustomProperties customProperties) {
    final IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
    final FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(
            Display.getCurrent().getActiveShell(), true, PlatformUI.getWorkbench().getProgressService(), scope,
            IJavaSearchConstants.CLASS);
    if (dialog.open() == Dialog.OK && dialog.getResult() != null && dialog.getResult().length != 0) {
        for (Object object : dialog.getResult()) {
            IPath parentPath = ((IType) object).getParent().getPath();
            if (parentPath.getFileExtension().equals("jar")) {
                int indexOfUnderscore = parentPath.lastSegment().indexOf('_');
                if (indexOfUnderscore > -1) {
                    final String pluginName = parentPath.lastSegment().substring(0, indexOfUnderscore);
                    customProperties.getServiceClasses().put(((IType) object).getFullyQualifiedName(), pluginName);
                } else {
                    customProperties.getServiceClasses().put(((IType) object).getFullyQualifiedName(), "");
                }
            } else {
                final String bundleName = getBundleName((IType) object);
                if (bundleName != null) {
                    customProperties.getServiceClasses().put(((IType) object).getFullyQualifiedName(), bundleName);
                } else {
                    customProperties.getServiceClasses().put(((IType) object).getFullyQualifiedName(),
                            ((IType) object).getJavaProject().getProject().getName());
                }
            }
        }
        setDirty(true);
        servicesTable.refresh();
    }
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:37,代码来源:M2DocTemplateEditor.java


示例12: handleTypeBrowsing

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
public void handleTypeBrowsing() {
	Text textControl = javaStartCommandPart.getTypeText();
	if (textControl == null) {
		return;
	}
	String pattern = textControl.getText();

	Shell shell = getShell();

	int javaSearchType = IJavaSearchConstants.CLASS;

	IJavaElement[] elements = new IJavaElement[] { javaProject };
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);

	FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(
			shell, false, null, scope, javaSearchType);
	dialog.setTitle(title);
	dialog.setInitialPattern(pattern);

	if (dialog.open() == Window.OK) {
		IType type = (IType) dialog.getFirstResult();
		if (type != null) {
			String qualifiedName = type.getFullyQualifiedName();
			if (qualifiedName != null) {
				textControl.setText(qualifiedName);
			}
		}
	}

	javaStartCommandPart.updateStartCommand();
}
 
开发者ID:eclipse,项目名称:cft,代码行数:32,代码来源:JavaTypeUIAdapter.java


示例13: chooseException

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
private IType chooseException() {
	IJavaElement[] elements= new IJavaElement[] { fProject.getJavaProject() };
	final IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);

	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false,
			PlatformUI.getWorkbench().getProgressService(), scope, IJavaSearchConstants.CLASS);
	dialog.setTitle(RefactoringMessages.ChangeExceptionsControl_choose_title);
	dialog.setMessage(RefactoringMessages.ChangeExceptionsControl_choose_message);
	dialog.setInitialPattern("*Exception*"); //$NON-NLS-1$
	dialog.setValidator(new ISelectionStatusValidator() {
		public IStatus validate(Object[] selection) {
			if (selection.length == 0)
				return new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$
			try {
				return checkException((IType)selection[0]);
			} catch (JavaModelException e) {
				JavaPlugin.log(e);
				return StatusInfo.OK_STATUS;
			}
		}
	});

	if (dialog.open() == Window.OK) {
		return (IType) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:28,代码来源:ChangeExceptionsControl.java


示例14: createTypeDialog

import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; //导入依赖的package包/类
/**
 * Creates a selection dialog that lists all types in the given scope.
 * The caller is responsible for opening the dialog with <code>Window.open</code>,
 * and subsequently extracting the selected type(s) (of type
 * <code>IType</code>) via <code>SelectionDialog.getResult</code>.
 *
 * @param parent the parent shell of the dialog to be created
 * @param context the runnable context used to show progress when the dialog
 *   is being populated
 * @param scope the scope that limits which types are included
 * @param style flags defining the style of the dialog; the only valid values are
 *   {@link IJavaElementSearchConstants#CONSIDER_CLASSES},
 *   {@link IJavaElementSearchConstants#CONSIDER_INTERFACES},
 *   {@link IJavaElementSearchConstants#CONSIDER_ANNOTATION_TYPES},
 *   {@link IJavaElementSearchConstants#CONSIDER_ENUMS},
 *   {@link IJavaElementSearchConstants#CONSIDER_ALL_TYPES},
 *   {@link IJavaElementSearchConstants#CONSIDER_CLASSES_AND_INTERFACES},
 *   {@link IJavaElementSearchConstants#CONSIDER_CLASSES_AND_ENUMS}, and
 *   {@link IJavaElementSearchConstants#CONSIDER_INTERFACES_AND_ANNOTATIONS}. Please note that
 *   the bitwise OR combination of the elementary constants is not supported.
 * @param multipleSelection <code>true</code> if multiple selection is allowed
 * @param filter the initial pattern to filter the set of types. For example "Abstract" shows
 *  all types starting with "abstract". The meta character '?' representing any character and
 *  '*' representing any string are supported. Clients can pass an empty string if no filtering
 *  is required.
 * @param extension a user interface extension to the type selection dialog or <code>null</code>
 *  if no extension is desired
 *
 * @return a new selection dialog
 *
 * @exception JavaModelException if the selection dialog could not be opened
 *
 * @since 3.2
 */
public static SelectionDialog createTypeDialog(Shell parent, IRunnableContext context, IJavaSearchScope scope, int style,
		boolean multipleSelection, String filter, TypeSelectionExtension extension) throws JavaModelException {
	int elementKinds= 0;
	if (style == IJavaElementSearchConstants.CONSIDER_ALL_TYPES) {
		elementKinds= IJavaSearchConstants.TYPE;
	} else if (style == IJavaElementSearchConstants.CONSIDER_INTERFACES) {
		elementKinds= IJavaSearchConstants.INTERFACE;
	} else if (style == IJavaElementSearchConstants.CONSIDER_CLASSES) {
		elementKinds= IJavaSearchConstants.CLASS;
	} else if (style == IJavaElementSearchConstants.CONSIDER_ANNOTATION_TYPES) {
		elementKinds= IJavaSearchConstants.ANNOTATION_TYPE;
	} else if (style == IJavaElementSearchConstants.CONSIDER_ENUMS) {
		elementKinds= IJavaSearchConstants.ENUM;
	} else if (style == IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES) {
		elementKinds= IJavaSearchConstants.CLASS_AND_INTERFACE;
	} else if (style == IJavaElementSearchConstants.CONSIDER_CLASSES_AND_ENUMS) {
		elementKinds= IJavaSearchConstants.CLASS_AND_ENUM;
	} else if (style == DEPRECATED_CONSIDER_TYPES) {
		elementKinds= IJavaSearchConstants.CLASS_AND_INTERFACE;
	} else if (style == IJavaElementSearchConstants.CONSIDER_INTERFACES_AND_ANNOTATIONS) {
		elementKinds= IJavaSearchConstants.INTERFACE_AND_ANNOTATION;
	} else {
		throw new IllegalArgumentException("Invalid style constant."); //$NON-NLS-1$
	}
	FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(parent, multipleSelection,
		context, scope, elementKinds, extension);
	dialog.setMessage(JavaUIMessages.JavaUI_defaultDialogMessage);
	dialog.setInitialPattern(filter);
	return dialog;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:65,代码来源:JavaUI.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MappingData类代码示例发布时间:2022-05-23
下一篇:
Java IntListIterator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap