本文整理汇总了Java中org.eclipse.jdt.ui.JavaElementImageDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java JavaElementImageDescriptor类的具体用法?Java JavaElementImageDescriptor怎么用?Java JavaElementImageDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JavaElementImageDescriptor类属于org.eclipse.jdt.ui包,在下文中一共展示了JavaElementImageDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAdornmentFlags
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
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: computeAdornmentFlags
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
@Override
protected int computeAdornmentFlags(Object obj) {
if (!(obj instanceof IWorkingSet))
return super.computeAdornmentFlags(obj);
IWorkingSet workingSet= (IWorkingSet)obj;
IAdaptable[] elements= workingSet.getElements();
int result= 0;
for (int i= 0; i < elements.length; i++) {
IAdaptable element= elements[i];
int flags= super.computeAdornmentFlags(element);
if ((flags & JavaElementImageDescriptor.BUILDPATH_ERROR) != 0)
return JavaElementImageDescriptor.BUILDPATH_ERROR;
result|= flags;
}
if ((result & JavaElementImageDescriptor.ERROR) != 0)
return JavaElementImageDescriptor.ERROR;
else if ((result & JavaElementImageDescriptor.WARNING) != 0)
return JavaElementImageDescriptor.WARNING;
return 0;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:PackageExplorerProblemsDecorator.java
示例3: getImage
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
@Override
public Image getImage(Object element) {
if (element instanceof JavadocLinkRef) {
JavadocLinkRef ref= (JavadocLinkRef) element;
ImageDescriptor desc;
if (ref.isProjectRef()) {
desc= PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
} else {
desc= JavaUI.getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_JAR);
}
if (ref.getURL() == null) {
return JavaPlugin.getImageDescriptorRegistry().get(new JavaElementImageDescriptor(desc, JavaElementImageDescriptor.WARNING, JavaElementImageProvider.SMALL_SIZE));
}
return JavaPlugin.getImageDescriptorRegistry().get(desc);
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:JavadocLinkDialogLabelProvider.java
示例4: MethodDeclarationCompletionProposal
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
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,代码行数:19,代码来源:MethodDeclarationCompletionProposal.java
示例5: getImage
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
@Override
public Image getImage() {
IStatus status= getFixStatus();
if (status != null && !status.isOK()) {
ImageImageDescriptor image= new ImageImageDescriptor(super.getImage());
int flag= JavaElementImageDescriptor.WARNING;
if (status.getSeverity() == IStatus.ERROR) {
flag= JavaElementImageDescriptor.ERROR;
}
ImageDescriptor composite= new JavaElementImageDescriptor(image, flag, new Point(image.getImageData().width, image.getImageData().height));
return composite.createImage();
} else {
return super.getImage();
}
}
示例6: computeAdornmentFlags
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
@Override
protected int computeAdornmentFlags(Object element) {
if (element instanceof IPackageFragment) {
return computePackageAdornmentFlags((IPackageFragment) element);
} else if (element instanceof LogicalPackage) {
IPackageFragment[] fragments= ((LogicalPackage) element).getFragments();
int res= 0;
for (int i= 0; i < fragments.length; i++) {
int flags= computePackageAdornmentFlags(fragments[i]);
if (flags == JavaElementImageDescriptor.ERROR) {
return flags;
} else if (flags != 0) {
res= flags;
}
}
return res;
}
return super.computeAdornmentFlags(element);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:TreeHierarchyLayoutProblemsDecorator.java
示例7: getColumnImage
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
public Image getColumnImage(Object element, int columnIndex) {
if (columnIndex != 0) {
return null;
}
NameConventionEntry entry= (NameConventionEntry) element;
ImageDescriptorRegistry registry= JavaPlugin.getImageDescriptorRegistry();
switch (entry.kind) {
case FIELD:
return registry.get(JavaPluginImages.DESC_FIELD_PUBLIC);
case STATIC:
return registry.get(new JavaElementImageDescriptor(JavaPluginImages.DESC_FIELD_PUBLIC, JavaElementImageDescriptor.STATIC, JavaElementImageProvider.SMALL_SIZE));
case STATIC_FINAL:
return registry.get(new JavaElementImageDescriptor(JavaPluginImages.DESC_FIELD_PUBLIC, JavaElementImageDescriptor.STATIC | JavaElementImageDescriptor.FINAL, JavaElementImageProvider.SMALL_SIZE));
case ARGUMENT:
return registry.get(JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE);
default:
return registry.get(JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:NameConventionConfigurationBlock.java
示例8: getBindingImageDescriptor
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
/**
* Returns the image descriptor for a binding with the flags as defined by {@link
* JavaElementImageProvider}.
*
* @param binding The binding to get the image for.
* @param imageFlags The image flags as defined in {@link JavaElementImageProvider}.
* @return the image of the binding or null if there is no image
*/
public static ImageDescriptor getBindingImageDescriptor(IBinding binding, int imageFlags) {
ImageDescriptor baseImage = getBaseImageDescriptor(binding, imageFlags);
if (baseImage != null) {
int adornmentFlags = getAdornmentFlags(binding);
Point size =
((imageFlags & JavaElementImageProvider.SMALL_ICONS) != 0)
? JavaElementImageProvider.SMALL_SIZE
: JavaElementImageProvider.BIG_SIZE;
return new JavaElementImageDescriptor(baseImage, adornmentFlags /*, size*/);
}
return null;
}
示例9: getJavaImageDescriptor
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
/**
* Returns an image descriptor for a java element. The descriptor includes overlays, if specified.
*
* @param element the Java element
* @param flags the image flags
* @return returns the image descriptor
*/
public ImageDescriptor getJavaImageDescriptor(IJavaElement element, int flags) {
Point size = useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
ImageDescriptor baseDesc = getBaseImageDescriptor(element, flags);
if (baseDesc != null) {
int adornmentFlags = computeJavaAdornmentFlags(element, flags);
return new JavaElementImageDescriptor(baseDesc, adornmentFlags /*, size*/);
}
return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_GHOST, 0 /*, size*/);
}
示例10: getAdornmentFlags
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
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;
}
示例11: getBindingImageDescriptor
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
/**
* Returns the image descriptor for a binding with the flags as defined by {@link JavaElementImageProvider}.
* @param binding The binding to get the image for.
* @param imageFlags The image flags as defined in {@link JavaElementImageProvider}.
* @return the image of the binding or null if there is no image
*/
public static ImageDescriptor getBindingImageDescriptor(IBinding binding, int imageFlags) {
ImageDescriptor baseImage= getBaseImageDescriptor(binding, imageFlags);
if (baseImage != null) {
int adornmentFlags= getAdornmentFlags(binding);
Point size= ((imageFlags & JavaElementImageProvider.SMALL_ICONS) != 0) ? JavaElementImageProvider.SMALL_SIZE : JavaElementImageProvider.BIG_SIZE;
return new JavaElementImageDescriptor(baseImage, adornmentFlags, size);
}
return null;
}
示例12: getJavaImageDescriptor
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
/**
* Returns an image descriptor for a java element. The descriptor includes overlays, if specified.
* @param element the Java element
* @param flags the image flags
* @return returns the image descriptor
*/
public ImageDescriptor getJavaImageDescriptor(IJavaElement element, int flags) {
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
ImageDescriptor baseDesc= getBaseImageDescriptor(element, flags);
if (baseDesc != null) {
int adornmentFlags= computeJavaAdornmentFlags(element, flags);
return new JavaElementImageDescriptor(baseDesc, adornmentFlags, size);
}
return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_GHOST, 0, size);
}
示例13: getWorkbenchImageDescriptor
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
/**
* Returns an image descriptor for a IAdaptable. The descriptor includes overlays, if specified (only error ticks apply).
* Returns <code>null</code> if no image could be found.
* @param adaptable the adaptable
* @param flags the image flags
* @return returns the image descriptor
*/
public ImageDescriptor getWorkbenchImageDescriptor(IAdaptable adaptable, int flags) {
IWorkbenchAdapter wbAdapter= (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class);
if (wbAdapter == null) {
return null;
}
ImageDescriptor descriptor= wbAdapter.getImageDescriptor(adaptable);
if (descriptor == null) {
return null;
}
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
return new JavaElementImageDescriptor(descriptor, 0, size);
}
示例14: getImageDescriptor
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
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);
}
}
示例15: testStaticModifier
import org.eclipse.jdt.ui.JavaElementImageDescriptor; //导入依赖的package包/类
public void testStaticModifier() {
ModifierGroup modifiers = ModifierGroup.builder()
.addModifiers(STATIC)
.build();
AccessorFlags twiddled = ModifierFlagsBitFlipper.flipBits(modifiers);
assertTrue((twiddled.accessorFlags_JVM & Flags.AccStatic) != 0);
assertTrue((twiddled.accessorFlags_JDT & JavaElementImageDescriptor.STATIC) != 0);
}