Package org.eclipse.jdt.ui
Class JavaElementImageDescriptor
- java.lang.Object
-
- org.eclipse.jface.resource.DeviceResourceDescriptor
-
- org.eclipse.jface.resource.ImageDescriptor
-
- org.eclipse.jface.resource.CompositeImageDescriptor
-
- org.eclipse.jdt.ui.JavaElementImageDescriptor
-
public class JavaElementImageDescriptor extends CompositeImageDescriptor
AJavaElementImageDescriptorconsists of a base image and several adornments. The adornments are computed according to the flags either passed during creation or set via the methodsetAdornments(int).This class may be instantiated; it is not intended to be subclassed.
- Since:
- 2.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jface.resource.CompositeImageDescriptor
CompositeImageDescriptor.CachedImageDataProvider
-
-
Field Summary
Fields Modifier and Type Field Description static intABSTRACTFlag to render the abstract adornment.static intANNOTATION_DEFAULTFlag to render the 'default' annotation adornment.static intBUILDPATH_ERRORFlag to render the build path error adornment.static intCONSTRUCTORFlag to render the 'constructor' adornment.static intDEFAULT_METHODFlag to render the 'default' method adornment.static intDEPRECATEDFlag to render the 'deprecated' adornment.static intERRORFlag to render the error adornment.static intFINALFlag to render the final adornment.static intIGNORE_OPTIONAL_PROBLEMSFlag to render the 'ignore optional compile problems' adornment.static intIMPLEMENTSFlag to render the 'implements' adornment.static intINFOFlag to render the info adornment.static intNATIVEFlag to render the 'native' adornment.static intOVERRIDESFlag to render the 'override' adornment.static intRUNNABLEFlag to render the runnable adornment.static intSTATICFlag to render the static adornment.static intSYNCHRONIZEDFlag to render the synchronized adornment.static intTRANSIENTFlag to render the 'transient' adornment.static intVOLATILEFlag to render the 'volatile' adornment.static intWARNINGFlag to render the warning adornment.-
Fields inherited from class org.eclipse.jface.resource.ImageDescriptor
DEFAULT_IMAGE_DATA
-
-
Constructor Summary
Constructors Constructor Description JavaElementImageDescriptor(ImageDescriptor baseImage, int flags, Point size)Creates a new JavaElementImageDescriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddrawCompositeImage(int width, int height)booleanequals(Object object)intgetAdronments()Returns the current adornments.PointgetImageSize()Returns the size of the image created by callingImageDescriptor.createImage().protected PointgetSize()inthashCode()voidsetAdornments(int adornments)Sets the descriptors adornments.voidsetImageSize(Point size)Sets the size of the image created by callingImageDescriptor.createImage().-
Methods inherited from class org.eclipse.jface.resource.CompositeImageDescriptor
autoScaleDown, autoScaleUp, createCachedImageDataProvider, createCachedImageDataProvider, drawImage, drawImage, getImageData, getImageData, getTransparentPixel, getZoomLevel, setImageData, supportsZoomLevel
-
Methods inherited from class org.eclipse.jface.resource.ImageDescriptor
createFromFile, createFromImage, createFromImage, createFromImageData, createFromImageDataProvider, createFromURL, createImage, createImage, createImage, createImage, createResource, createWithFlags, destroyResource, getMissingImageDescriptor, imageDescriptorFromURI
-
-
-
-
Field Detail
-
ABSTRACT
public static final int ABSTRACT
Flag to render the abstract adornment.- See Also:
- Constant Field Values
-
FINAL
public static final int FINAL
Flag to render the final adornment.- See Also:
- Constant Field Values
-
SYNCHRONIZED
public static final int SYNCHRONIZED
Flag to render the synchronized adornment.- See Also:
- Constant Field Values
-
STATIC
public static final int STATIC
Flag to render the static adornment.- See Also:
- Constant Field Values
-
RUNNABLE
public static final int RUNNABLE
Flag to render the runnable adornment.- See Also:
- Constant Field Values
-
WARNING
public static final int WARNING
Flag to render the warning adornment.- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
Flag to render the error adornment.- See Also:
- Constant Field Values
-
OVERRIDES
public static final int OVERRIDES
Flag to render the 'override' adornment.- See Also:
- Constant Field Values
-
IMPLEMENTS
public static final int IMPLEMENTS
Flag to render the 'implements' adornment.- See Also:
- Constant Field Values
-
CONSTRUCTOR
public static final int CONSTRUCTOR
Flag to render the 'constructor' adornment.- See Also:
- Constant Field Values
-
DEPRECATED
public static final int DEPRECATED
Flag to render the 'deprecated' adornment.- Since:
- 3.0
- See Also:
- Constant Field Values
-
VOLATILE
public static final int VOLATILE
Flag to render the 'volatile' adornment.- Since:
- 3.3
- See Also:
- Constant Field Values
-
TRANSIENT
public static final int TRANSIENT
Flag to render the 'transient' adornment.- Since:
- 3.3
- See Also:
- Constant Field Values
-
BUILDPATH_ERROR
public static final int BUILDPATH_ERROR
Flag to render the build path error adornment.- Since:
- 3.7
- See Also:
- Constant Field Values
-
NATIVE
public static final int NATIVE
Flag to render the 'native' adornment.- Since:
- 3.7
- See Also:
- Constant Field Values
-
IGNORE_OPTIONAL_PROBLEMS
public static final int IGNORE_OPTIONAL_PROBLEMS
Flag to render the 'ignore optional compile problems' adornment.- Since:
- 3.8
- See Also:
- Constant Field Values
-
DEFAULT_METHOD
public static final int DEFAULT_METHOD
Flag to render the 'default' method adornment.- Since:
- 3.10
- See Also:
- Constant Field Values
-
ANNOTATION_DEFAULT
public static final int ANNOTATION_DEFAULT
Flag to render the 'default' annotation adornment.- Since:
- 3.10
- See Also:
- Constant Field Values
-
INFO
public static final int INFO
Flag to render the info adornment.- Since:
- 3.12
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JavaElementImageDescriptor
public JavaElementImageDescriptor(ImageDescriptor baseImage, int flags, Point size)
Creates a new JavaElementImageDescriptor.- Parameters:
baseImage- an image descriptor used as the base imageflags- flags indicating which adornments are to be rendered. SeesetAdornments(int)for valid values.size- the size of the resulting image
-
-
Method Detail
-
setAdornments
public void setAdornments(int adornments)
Sets the descriptors adornments. Valid values are:ABSTRACT,FINAL,SYNCHRONIZED,STATIC,RUNNABLE,INFO,WARNING,ERROR,OVERRIDES,IMPLEMENTS,CONSTRUCTOR,DEPRECATED,VOLATILE,TRANSIENT,BUILDPATH_ERROR,NATIVE, or any combination of those.- Parameters:
adornments- the image descriptors adornments
-
getAdronments
public int getAdronments()
Returns the current adornments.- Returns:
- the current adornments
-
setImageSize
public void setImageSize(Point size)
Sets the size of the image created by callingImageDescriptor.createImage().- Parameters:
size- the size of the image returned from callingImageDescriptor.createImage()
-
getImageSize
public Point getImageSize()
Returns the size of the image created by callingImageDescriptor.createImage().- Returns:
- the size of the image created by calling
ImageDescriptor.createImage()
-
getSize
protected Point getSize()
- Specified by:
getSizein classCompositeImageDescriptor
-
drawCompositeImage
protected void drawCompositeImage(int width, int height)- Specified by:
drawCompositeImagein classCompositeImageDescriptor
-
-