Java Code Examples for org.eclipse.jdt.internal.ui.JavaPluginImages#DESC_OBJS_CLASS

The following examples show how to use org.eclipse.jdt.internal.ui.JavaPluginImages#DESC_OBJS_CLASS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeNameMatchLabelProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public static ImageDescriptor getImageDescriptor(TypeNameMatch typeRef, int flags) {
	if (isSet(SHOW_TYPE_CONTAINER_ONLY, flags)) {
		if (typeRef.getPackageName().equals(typeRef.getTypeContainerName()))
			return JavaPluginImages.DESC_OBJS_PACKAGE;

		// XXX cannot check outer type for interface efficiently (5887)
		return JavaPluginImages.DESC_OBJS_CLASS;

	} else if (isSet(SHOW_PACKAGE_ONLY, flags)) {
		return JavaPluginImages.DESC_OBJS_PACKAGE;
	} else {
		boolean isInner= typeRef.getTypeContainerName().indexOf('.') != -1;
		int modifiers= typeRef.getModifiers();

		ImageDescriptor desc= JavaElementImageProvider.getTypeImageDescriptor(isInner, false, modifiers, false);
		int adornmentFlags= 0;
		if (Flags.isFinal(modifiers)) {
			adornmentFlags |= JavaElementImageDescriptor.FINAL;
		}
		if (Flags.isAbstract(modifiers) && !Flags.isInterface(modifiers)) {
			adornmentFlags |= JavaElementImageDescriptor.ABSTRACT;
		}
		if (Flags.isStatic(modifiers)) {
			adornmentFlags |= JavaElementImageDescriptor.STATIC;
		}
		if (Flags.isDeprecated(modifiers)) {
			adornmentFlags |= JavaElementImageDescriptor.DEPRECATED;
		}

		return new JavaElementImageDescriptor(desc, adornmentFlags, JavaElementImageProvider.BIG_SIZE);
	}
}
 
Example 2
Source File: HierarchyLabelProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private ImageDescriptor getTypeImageDescriptor(IType type) {
	ITypeHierarchy hierarchy= fHierarchy.getHierarchy();
	if (hierarchy == null) {
		return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_CLASS, 0, JavaElementImageProvider.BIG_SIZE);
	}

	int flags= hierarchy.getCachedFlags(type);
	if (flags == -1) {
		return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_CLASS, 0, JavaElementImageProvider.BIG_SIZE);
	}

	boolean isInterface= Flags.isInterface(flags);
	IType declaringType= type.getDeclaringType();
	boolean isInner= declaringType != null;
	boolean isInInterfaceOrAnnotation= false;
	if (isInner) {
		int declaringTypeFlags= hierarchy.getCachedFlags(declaringType);
		if (declaringTypeFlags != -1) {
			isInInterfaceOrAnnotation= Flags.isInterface(declaringTypeFlags);
		} else {
			// declaring type is not in hierarchy, so we have to pay the price for resolving here
			try {
				isInInterfaceOrAnnotation= declaringType.isInterface();
			} catch (JavaModelException e) {
			}
		}
	}

	ImageDescriptor desc= JavaElementImageProvider.getTypeImageDescriptor(isInner, isInInterfaceOrAnnotation, flags, isInDifferentHierarchyScope(type));

	int adornmentFlags= 0;
	if (Flags.isFinal(flags)) {
		adornmentFlags |= JavaElementImageDescriptor.FINAL;
	}
	if (Flags.isAbstract(flags) && !isInterface) {
		adornmentFlags |= JavaElementImageDescriptor.ABSTRACT;
	}
	if (Flags.isStatic(flags)) {
		adornmentFlags |= JavaElementImageDescriptor.STATIC;
	}
	if (Flags.isDeprecated(flags)) {
		adornmentFlags |= JavaElementImageDescriptor.DEPRECATED;
	}

	return new JavaElementImageDescriptor(desc, adornmentFlags, JavaElementImageProvider.BIG_SIZE);
}
 
Example 3
Source File: BindingLabelProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private static ImageDescriptor getClassImageDescriptor(int modifiers) {
	if (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers) || Modifier.isPrivate(modifiers))
		return JavaPluginImages.DESC_OBJS_CLASS;
	else
		return JavaPluginImages.DESC_OBJS_CLASS_DEFAULT;
}
 
Example 4
Source File: JavaElementImageProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private static ImageDescriptor getClassImageDescriptor(int flags) {
	if (Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags))
		return JavaPluginImages.DESC_OBJS_CLASS;
	else
		return JavaPluginImages.DESC_OBJS_CLASS_DEFAULT;
}
 
Example 5
Source File: JavaCompareUtilities.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
static ImageDescriptor getTypeImageDescriptor(boolean isClass) {
	if (isClass)
		return JavaPluginImages.DESC_OBJS_CLASS;
	return JavaPluginImages.DESC_OBJS_INTERFACE;
}