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


Java IJavaElement.INITIALIZER属性代码示例

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


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

示例1: processType

private void processType(ITypeVisitor visitor, BinaryTypeName btn,
    IType type, IProgressMonitor monitor) throws JavaModelException {
  final String binaryname = btn.toString();
  monitor.subTask(binaryname);
  visitor.visit(type, binaryname);
  for (final IJavaElement child : type.getChildren()) {
    if (monitor.isCanceled()) {
      break;
    }
    switch (child.getElementType()) {
    case IJavaElement.TYPE:
      IType nestedtype = (IType) child;
      processType(visitor, btn.nest(nestedtype), nestedtype, monitor);
      break;
    case IJavaElement.METHOD:
    case IJavaElement.INITIALIZER:
    case IJavaElement.FIELD:
      processAnonymousInnerTypes(visitor, btn, (IMember) child, monitor);
      break;
    }
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:22,代码来源:TypeTraverser.java

示例2: mapKind

public static SymbolKind mapKind(IJavaElement element) {
	switch (element.getElementType()) {
	case IJavaElement.ANNOTATION:
		return SymbolKind.Property; // TODO: find a better mapping
	case IJavaElement.CLASS_FILE:
	case IJavaElement.COMPILATION_UNIT:
		return SymbolKind.File;
	case IJavaElement.FIELD:
		return SymbolKind.Field;
	case IJavaElement.IMPORT_CONTAINER:
	case IJavaElement.IMPORT_DECLARATION:
		return SymbolKind.Module;
	case IJavaElement.INITIALIZER:
		return SymbolKind.Constructor;
	case IJavaElement.LOCAL_VARIABLE:
	case IJavaElement.TYPE_PARAMETER:
		return SymbolKind.Variable;
	case IJavaElement.METHOD:
		return SymbolKind.Method;
	case IJavaElement.PACKAGE_DECLARATION:
		return SymbolKind.Package;
	case IJavaElement.TYPE:
		try {
			return ( ((IType)element).isInterface() ? SymbolKind.Interface : SymbolKind.Class);
		} catch (JavaModelException e) {
			return SymbolKind.Class;
		}
	}
	return SymbolKind.String;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:30,代码来源:DocumentSymbolHandler.java

示例3: getKind

private String getKind(IMember member) {
	switch (member.getElementType()) {
	case IJavaElement.METHOD:
		return KIND_METHOD;
	case IJavaElement.INITIALIZER:
		return KIND_INITIALIZER;
	case IJavaElement.FIELD:
		return KIND_FIELD;
	case IJavaElement.TYPE:
		IType type = (IType) member;
		try {
			if (type.isAnnotation()) {
				return KIND_ANNOTATION;
			}
			if (type.isInterface()) {
				return KIND_INTERFACE;
			}
			if (type.isEnum()) {
				return KIND_ENUM;
			}
			if (type.isClass()) {
				return KIND_CLASS;
			}
		} catch (JavaModelException e) {
			return KIND_TYPE;
		}
		return KIND_TYPE;
	default:
		return null;
	}
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:31,代码来源:JavaTypeMemberBookmarkPropertiesProvider.java

示例4: appendElementLabel

/**
 * Appends the label for a Java element with the flags as defined by this class.
 *
 * @param element the element to render
 * @param flags the rendering flags.
 */
public void appendElementLabel(IJavaElement element, long flags) {
	int type= element.getElementType();
	IPackageFragmentRoot root= null;

	if (type != IJavaElement.JAVA_MODEL && type != IJavaElement.JAVA_PROJECT && type != IJavaElement.PACKAGE_FRAGMENT_ROOT) {
		root= JavaModelUtil.getPackageFragmentRoot(element);
	}
	if (root != null && getFlag(flags, JavaElementLabels.PREPEND_ROOT_PATH)) {
		appendPackageFragmentRootLabel(root, JavaElementLabels.ROOT_QUALIFIED);
		fBuilder.append(JavaElementLabels.CONCAT_STRING);
	}

	switch (type) {
	case IJavaElement.METHOD:
		appendMethodLabel((IMethod) element, flags);
		break;
	case IJavaElement.FIELD:
		appendFieldLabel((IField) element, flags);
		break;
	case IJavaElement.LOCAL_VARIABLE:
		appendLocalVariableLabel((ILocalVariable) element, flags);
		break;
	case IJavaElement.TYPE_PARAMETER:
		appendTypeParameterLabel((ITypeParameter) element, flags);
		break;
	case IJavaElement.INITIALIZER:
		appendInitializerLabel((IInitializer) element, flags);
		break;
	case IJavaElement.TYPE:
		appendTypeLabel((IType) element, flags);
		break;
	case IJavaElement.CLASS_FILE:
		appendClassFileLabel((IClassFile) element, flags);
		break;
	case IJavaElement.COMPILATION_UNIT:
		appendCompilationUnitLabel((ICompilationUnit) element, flags);
		break;
	case IJavaElement.PACKAGE_FRAGMENT:
		appendPackageFragmentLabel((IPackageFragment) element, flags);
		break;
	case IJavaElement.PACKAGE_FRAGMENT_ROOT:
		appendPackageFragmentRootLabel((IPackageFragmentRoot) element, flags);
		break;
	case IJavaElement.IMPORT_CONTAINER:
	case IJavaElement.IMPORT_DECLARATION:
	case IJavaElement.PACKAGE_DECLARATION:
		appendDeclarationLabel(element, flags);
		break;
	case IJavaElement.JAVA_PROJECT:
	case IJavaElement.JAVA_MODEL:
		fBuilder.append(element.getElementName());
		break;
	default:
		fBuilder.append(element.getElementName());
	}

	if (root != null && getFlag(flags, JavaElementLabels.APPEND_ROOT_PATH)) {
		fBuilder.append(JavaElementLabels.CONCAT_STRING);
		appendPackageFragmentRootLabel(root, JavaElementLabels.ROOT_QUALIFIED);
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:67,代码来源:JavaElementLabelComposer.java


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