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


Java IJavaSearchConstants.CLASS_AND_ENUM属性代码示例

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


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

示例1: getSearchForConstant

private int getSearchForConstant(int typeKinds) {
  final int CLASSES = SimilarElementsRequestor.CLASSES;
  final int INTERFACES = SimilarElementsRequestor.INTERFACES;
  final int ENUMS = SimilarElementsRequestor.ENUMS;
  final int ANNOTATIONS = SimilarElementsRequestor.ANNOTATIONS;

  switch (typeKinds & (CLASSES | INTERFACES | ENUMS | ANNOTATIONS)) {
    case CLASSES:
      return IJavaSearchConstants.CLASS;
    case INTERFACES:
      return IJavaSearchConstants.INTERFACE;
    case ENUMS:
      return IJavaSearchConstants.ENUM;
    case ANNOTATIONS:
      return IJavaSearchConstants.ANNOTATION_TYPE;
    case CLASSES | INTERFACES:
      return IJavaSearchConstants.CLASS_AND_INTERFACE;
    case CLASSES | ENUMS:
      return IJavaSearchConstants.CLASS_AND_ENUM;
    default:
      return IJavaSearchConstants.TYPE;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:JavaContext.java

示例2: getSearchForConstant

private int getSearchForConstant(int typeKinds) {
	final int CLASSES= SimilarElementsRequestor.CLASSES;
	final int INTERFACES= SimilarElementsRequestor.INTERFACES;
	final int ENUMS= SimilarElementsRequestor.ENUMS;
	final int ANNOTATIONS= SimilarElementsRequestor.ANNOTATIONS;

	switch (typeKinds & (CLASSES | INTERFACES | ENUMS | ANNOTATIONS)) {
		case CLASSES: return IJavaSearchConstants.CLASS;
		case INTERFACES: return IJavaSearchConstants.INTERFACE;
		case ENUMS: return IJavaSearchConstants.ENUM;
		case ANNOTATIONS: return IJavaSearchConstants.ANNOTATION_TYPE;
		case CLASSES | INTERFACES: return IJavaSearchConstants.CLASS_AND_INTERFACE;
		case CLASSES | ENUMS: return IJavaSearchConstants.CLASS_AND_ENUM;
		default: return IJavaSearchConstants.TYPE;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:JavaContext.java

示例3: matchesModifiers

private boolean matchesModifiers(TypeNameMatch type) {
	if (fElementKind == IJavaSearchConstants.TYPE)
		return true;
	int modifiers= type.getModifiers() & TYPE_MODIFIERS;
	switch (fElementKind) {
		case IJavaSearchConstants.CLASS:
			return modifiers == 0;
		case IJavaSearchConstants.ANNOTATION_TYPE:
			return Flags.isAnnotation(modifiers);
		case IJavaSearchConstants.INTERFACE:
			return modifiers == Flags.AccInterface;
		case IJavaSearchConstants.ENUM:
			return Flags.isEnum(modifiers);
		case IJavaSearchConstants.CLASS_AND_INTERFACE:
			return modifiers == 0 || modifiers == Flags.AccInterface;
		case IJavaSearchConstants.CLASS_AND_ENUM:
			return modifiers == 0 || Flags.isEnum(modifiers);
		case IJavaSearchConstants.INTERFACE_AND_ANNOTATION:
			return Flags.isInterface(modifiers);
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:TypeInfoFilter.java

示例4: createTypeDialog

/**
 * 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,代码行数:64,代码来源:JavaUI.java


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