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


Java JavaElementImageDescriptor.RUNNABLE属性代码示例

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


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

示例1: computeJavaAdornmentFlags

private int computeJavaAdornmentFlags(IJavaElement element, int renderFlags) {
  int flags = 0;
  if (showOverlayIcons(renderFlags)) {
    try {
      if (element instanceof IMember) {
        IMember member = (IMember) element;

        int modifiers = member.getFlags();
        if (confirmAbstract(member) && JdtFlags.isAbstract(member))
          flags |= JavaElementImageDescriptor.ABSTRACT;
        if (Flags.isFinal(modifiers)
            || isInterfaceOrAnnotationField(member)
            || isEnumConstant(member, modifiers)) flags |= JavaElementImageDescriptor.FINAL;
        if (Flags.isStatic(modifiers)
            || isInterfaceOrAnnotationFieldOrType(member)
            || isEnumConstant(member, modifiers)) flags |= JavaElementImageDescriptor.STATIC;

        if (Flags.isDeprecated(modifiers)) flags |= JavaElementImageDescriptor.DEPRECATED;

        int elementType = element.getElementType();
        if (elementType == IJavaElement.METHOD) {
          if (((IMethod) element).isConstructor())
            flags |= JavaElementImageDescriptor.CONSTRUCTOR;
          if (Flags.isSynchronized(modifiers)) // collides with 'super' flag
          flags |= JavaElementImageDescriptor.SYNCHRONIZED;
          if (Flags.isNative(modifiers)) flags |= JavaElementImageDescriptor.NATIVE;
          if (Flags.isDefaultMethod(modifiers))
            flags |= JavaElementImageDescriptor.DEFAULT_METHOD;
          if (Flags.isAnnnotationDefault(modifiers))
            flags |= JavaElementImageDescriptor.ANNOTATION_DEFAULT;
        }

        if (member.getElementType() == IJavaElement.TYPE) {
          if (JavaModelUtil.hasMainMethod((IType) member)) {
            flags |= JavaElementImageDescriptor.RUNNABLE;
          }
        }

        if (member.getElementType() == IJavaElement.FIELD) {
          if (Flags.isVolatile(modifiers)) flags |= JavaElementImageDescriptor.VOLATILE;
          if (Flags.isTransient(modifiers)) flags |= JavaElementImageDescriptor.TRANSIENT;
        }
      } else if (element instanceof ILocalVariable
          && Flags.isFinal(((ILocalVariable) element).getFlags())) {
        flags |= JavaElementImageDescriptor.FINAL;
      }
    } catch (JavaModelException e) {
      // do nothing. Can't compute runnable adornment or get flags
    }
  }
  return flags;
}
 
开发者ID:eclipse,项目名称:che,代码行数:52,代码来源:JavaElementImageProvider.java

示例2: computeJavaAdornmentFlags

private int computeJavaAdornmentFlags(IJavaElement element, int renderFlags) {
	int flags= 0;
	if (showOverlayIcons(renderFlags)) {
		try {
			if (element instanceof IMember) {
				IMember member= (IMember)element;

				int modifiers= member.getFlags();
				if (confirmAbstract(member) && JdtFlags.isAbstract(member))
					flags|= JavaElementImageDescriptor.ABSTRACT;
				if (Flags.isFinal(modifiers) || isInterfaceOrAnnotationField(member) || isEnumConstant(member, modifiers))
					flags|= JavaElementImageDescriptor.FINAL;
				if (Flags.isStatic(modifiers) || isInterfaceOrAnnotationFieldOrType(member) || isEnumConstant(member, modifiers))
					flags|= JavaElementImageDescriptor.STATIC;

				if (Flags.isDeprecated(modifiers))
					flags|= JavaElementImageDescriptor.DEPRECATED;

				int elementType= element.getElementType();
				if (elementType == IJavaElement.METHOD) {
					if (((IMethod)element).isConstructor())
						flags|= JavaElementImageDescriptor.CONSTRUCTOR;
					if (Flags.isSynchronized(modifiers)) // collides with 'super' flag
						flags|= JavaElementImageDescriptor.SYNCHRONIZED;
					if (Flags.isNative(modifiers))
						flags|= JavaElementImageDescriptor.NATIVE;
					if (Flags.isDefaultMethod(modifiers))
						flags|= JavaElementImageDescriptor.DEFAULT_METHOD;
					if (Flags.isAnnnotationDefault(modifiers))
						flags|= JavaElementImageDescriptor.ANNOTATION_DEFAULT;
				}

				if (member.getElementType() == IJavaElement.TYPE) {
					if (JavaModelUtil.hasMainMethod((IType)member)) {
						flags|= JavaElementImageDescriptor.RUNNABLE;
					}
				}

				if (member.getElementType() == IJavaElement.FIELD) {
					if (Flags.isVolatile(modifiers))
						flags|= JavaElementImageDescriptor.VOLATILE;
					if (Flags.isTransient(modifiers))
						flags|= JavaElementImageDescriptor.TRANSIENT;
				}
			} else if (element instanceof ILocalVariable && Flags.isFinal(((ILocalVariable)element).getFlags())) {
				flags|= JavaElementImageDescriptor.FINAL;
			}
		} catch (JavaModelException e) {
			// do nothing. Can't compute runnable adornment or get flags
		}
	}
	return flags;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:53,代码来源:JavaElementImageProvider.java

示例3: computeJavaAdornmentFlags

private int computeJavaAdornmentFlags(IJavaElement element, int renderFlags) {
	int flags= 0;
	if (showOverlayIcons(renderFlags)) {
		try {
			if (element instanceof IMember) {
				IMember member= (IMember)element;

				int modifiers= member.getFlags();
				if (Flags.isAbstract(modifiers) && confirmAbstract(member))
					flags|= JavaElementImageDescriptor.ABSTRACT;
				if (Flags.isFinal(modifiers) || isInterfaceOrAnnotationField(member) || isEnumConstant(member, modifiers))
					flags|= JavaElementImageDescriptor.FINAL;
				if (Flags.isStatic(modifiers) || isInterfaceOrAnnotationFieldOrType(member) || isEnumConstant(member, modifiers))
					flags|= JavaElementImageDescriptor.STATIC;

				if (Flags.isDeprecated(modifiers))
					flags|= JavaElementImageDescriptor.DEPRECATED;

				int elementType= element.getElementType();
				if (elementType == IJavaElement.METHOD) {
					if (((IMethod)element).isConstructor())
						flags|= JavaElementImageDescriptor.CONSTRUCTOR;
					if (Flags.isSynchronized(modifiers)) // collides with 'super' flag
						flags|= JavaElementImageDescriptor.SYNCHRONIZED;
					if (Flags.isNative(modifiers))
						flags|= JavaElementImageDescriptor.NATIVE;
				}

				if (member.getElementType() == IJavaElement.TYPE) {
					if (JavaModelUtil.hasMainMethod((IType)member)) {
						flags|= JavaElementImageDescriptor.RUNNABLE;
					}
				}

				if (member.getElementType() == IJavaElement.FIELD) {
					if (Flags.isVolatile(modifiers))
						flags|= JavaElementImageDescriptor.VOLATILE;
					if (Flags.isTransient(modifiers))
						flags|= JavaElementImageDescriptor.TRANSIENT;
				}
			} else if (element instanceof ILocalVariable && Flags.isFinal(((ILocalVariable)element).getFlags())) {
				flags|= JavaElementImageDescriptor.FINAL;
			}
		} catch (JavaModelException e) {
			// do nothing. Can't compute runnable adornment or get flags
		}
	}
	return flags;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:49,代码来源:JavaElementImageProvider.java


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