本文整理汇总了Java中org.eclipse.jdt.ui.JavaElementImageDescriptor.CONSTRUCTOR属性的典型用法代码示例。如果您正苦于以下问题:Java JavaElementImageDescriptor.CONSTRUCTOR属性的具体用法?Java JavaElementImageDescriptor.CONSTRUCTOR怎么用?Java JavaElementImageDescriptor.CONSTRUCTOR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.ui.JavaElementImageDescriptor
的用法示例。
在下文中一共展示了JavaElementImageDescriptor.CONSTRUCTOR属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAdornmentFlags
private static int getAdornmentFlags(IBinding binding) {
int adornments = 0;
final int modifiers = binding.getModifiers();
if (Modifier.isAbstract(modifiers)) adornments |= JavaElementImageDescriptor.ABSTRACT;
if (Modifier.isFinal(modifiers)) adornments |= JavaElementImageDescriptor.FINAL;
if (Modifier.isStatic(modifiers)) adornments |= JavaElementImageDescriptor.STATIC;
if (binding.isDeprecated()) adornments |= JavaElementImageDescriptor.DEPRECATED;
if (binding instanceof IMethodBinding) {
if (((IMethodBinding) binding).isConstructor())
adornments |= JavaElementImageDescriptor.CONSTRUCTOR;
if (Modifier.isSynchronized(modifiers)) adornments |= JavaElementImageDescriptor.SYNCHRONIZED;
if (Modifier.isNative(modifiers)) adornments |= JavaElementImageDescriptor.NATIVE;
ITypeBinding type = ((IMethodBinding) binding).getDeclaringClass();
if (type.isInterface() && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers))
adornments |= JavaElementImageDescriptor.DEFAULT_METHOD;
if (((IMethodBinding) binding).getDefaultValue() != null)
adornments |= JavaElementImageDescriptor.ANNOTATION_DEFAULT;
}
if (binding instanceof IVariableBinding && ((IVariableBinding) binding).isField()) {
if (Modifier.isTransient(modifiers)) adornments |= JavaElementImageDescriptor.TRANSIENT;
if (Modifier.isVolatile(modifiers)) adornments |= JavaElementImageDescriptor.VOLATILE;
}
return adornments;
}
示例2: MethodDeclarationCompletionProposal
public MethodDeclarationCompletionProposal(IType type, String methodName, String returnTypeSig, int start, int length, int relevance) {
super("", type.getCompilationUnit(), start, length, null, getDisplayName(methodName, returnTypeSig), relevance); //$NON-NLS-1$
Assert.isNotNull(type);
Assert.isNotNull(methodName);
fType= type;
fMethodName= methodName;
fReturnTypeSig= returnTypeSig;
if (returnTypeSig == null) {
setProposalInfo(new ProposalInfo(type));
ImageDescriptor desc= new JavaElementImageDescriptor(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE);
setImage(JavaPlugin.getImageDescriptorRegistry().get(desc));
} else {
setImage(JavaPluginImages.get(JavaPluginImages.IMG_MISC_PRIVATE));
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:MethodDeclarationCompletionProposal.java
示例3: getAdornmentFlags
private static int getAdornmentFlags(IBinding binding) {
int adornments= 0;
final int modifiers= binding.getModifiers();
if (Modifier.isAbstract(modifiers))
adornments|= JavaElementImageDescriptor.ABSTRACT;
if (Modifier.isFinal(modifiers))
adornments|= JavaElementImageDescriptor.FINAL;
if (Modifier.isStatic(modifiers))
adornments|= JavaElementImageDescriptor.STATIC;
if (binding.isDeprecated())
adornments|= JavaElementImageDescriptor.DEPRECATED;
if (binding instanceof IMethodBinding) {
if (((IMethodBinding) binding).isConstructor())
adornments|= JavaElementImageDescriptor.CONSTRUCTOR;
if (Modifier.isSynchronized(modifiers))
adornments|= JavaElementImageDescriptor.SYNCHRONIZED;
if (Modifier.isNative(modifiers))
adornments|= JavaElementImageDescriptor.NATIVE;
ITypeBinding type= ((IMethodBinding) binding).getDeclaringClass();
if (type.isInterface() && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers))
adornments|= JavaElementImageDescriptor.DEFAULT_METHOD;
if (((IMethodBinding) binding).getDefaultValue() != null)
adornments|= JavaElementImageDescriptor.ANNOTATION_DEFAULT;
}
if (binding instanceof IVariableBinding && ((IVariableBinding) binding).isField()) {
if (Modifier.isTransient(modifiers))
adornments|= JavaElementImageDescriptor.TRANSIENT;
if (Modifier.isVolatile(modifiers))
adornments|= JavaElementImageDescriptor.VOLATILE;
}
return adornments;
}
示例4: adornWithMethodClassDetails
private static int adornWithMethodClassDetails(MethodMember element, int accessorFlags_JDT) {
int flags = accessorFlags_JDT;
if (!element.methodDecl.type.isPresent()) { // No return type means that it is a constructor
flags |= JavaElementImageDescriptor.CONSTRUCTOR;
}
return flags;
}
示例5: getImage
@Override
public Image getImage() {
int accessorFlags_JVM = Flags.AccPublic;
int accessorFlags_JDT = JavaElementImageDescriptor.CONSTRUCTOR;
ImageDescriptor desc = ForceImages.getDesc(ForceImages.APEX_GLOBAL_METHOD);
ApexElementImageDescriptor decoratedDesc =
new ApexElementImageDescriptor(desc, accessorFlags_JDT, APEX_ICON_SIZE);
return ForceImages.get(ForceImages.APEX_GLOBAL_METHOD, accessorFlags_JVM, decoratedDesc);
}
示例6: getAdornmentFlags
private static int getAdornmentFlags(IBinding binding) {
int adornments= 0;
final int modifiers= binding.getModifiers();
if (Modifier.isAbstract(modifiers))
adornments|= JavaElementImageDescriptor.ABSTRACT;
if (Modifier.isFinal(modifiers))
adornments|= JavaElementImageDescriptor.FINAL;
if (Modifier.isStatic(modifiers))
adornments|= JavaElementImageDescriptor.STATIC;
if (binding.isDeprecated())
adornments|= JavaElementImageDescriptor.DEPRECATED;
if (binding instanceof IMethodBinding) {
if (((IMethodBinding) binding).isConstructor())
adornments|= JavaElementImageDescriptor.CONSTRUCTOR;
if (Modifier.isSynchronized(modifiers))
adornments|= JavaElementImageDescriptor.SYNCHRONIZED;
if (Modifier.isNative(modifiers))
adornments|= JavaElementImageDescriptor.NATIVE;
}
if (binding instanceof IVariableBinding && ((IVariableBinding) binding).isField()) {
if (Modifier.isTransient(modifiers))
adornments|= JavaElementImageDescriptor.TRANSIENT;
if (Modifier.isVolatile(modifiers))
adornments|= JavaElementImageDescriptor.VOLATILE;
}
return adornments;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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