Package org.eclipse.jface.viewers
Interface IDecoration
@NoImplement
public interface IDecoration
Defines the result of decorating an element.
This interface is not meant to be implemented and will be provided to
instances of
ILightweightLabelDecorator
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant for the bottom left quadrant.static final int
Constant for the bottom right quadrant.static final String
Constant that is used as the property key on anIDecorationContext
.static final int
Constant for replacing the original image.static final int
Constants for placement of image decorations.static final int
Constant for the top right quadrant.static final int
Constant for the underlay. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOverlay
(ImageDescriptor overlay) Adds an overlay to the element's image.void
addOverlay
(ImageDescriptor overlay, int quadrant) Adds an overlay to the element's image.void
Adds a prefix to the element's label.void
Adds a suffix to the element's label.Return the decoration context in which this decoration will be applied.void
setBackgroundColor
(Color color) Set the background color for this decoration.void
Set the font for this decoration.void
setForegroundColor
(Color color) Set the foreground color for this decoration.
-
Field Details
-
TOP_LEFT
static final int TOP_LEFTConstants for placement of image decorations.- See Also:
-
TOP_RIGHT
static final int TOP_RIGHTConstant for the top right quadrant.- See Also:
-
BOTTOM_LEFT
static final int BOTTOM_LEFTConstant for the bottom left quadrant.- See Also:
-
BOTTOM_RIGHT
static final int BOTTOM_RIGHTConstant for the bottom right quadrant.- See Also:
-
UNDERLAY
static final int UNDERLAYConstant for the underlay.- See Also:
-
REPLACE
static final int REPLACEConstant for replacing the original image. Note that for this to have an effect on the resulting decorated image,ENABLE_REPLACE
has to be set toBoolean.TRUE
in theIDecorationContext
(opt-in model). If replacement behavior is enabled, the resulting decorated image will be constructed by first painting the underlay, then the replacement image, and then the regular quadrant images.- Since:
- 3.4
- See Also:
-
ENABLE_REPLACE
Constant that is used as the property key on anIDecorationContext
. To enable image replacement, set toBoolean.TRUE
.- Since:
- 3.4
- See Also:
-
-
Method Details
-
addPrefix
Adds a prefix to the element's label.- Parameters:
prefix
- the prefix
-
addSuffix
Adds a suffix to the element's label.- Parameters:
suffix
- the suffix
-
addOverlay
Adds an overlay to the element's image.- Parameters:
overlay
- the overlay image descriptor
-
addOverlay
Adds an overlay to the element's image.- Parameters:
overlay
- the overlay image descriptorquadrant
- The constant for the quadrant to draw the image on.
-
setForegroundColor
Set the foreground color for this decoration.- Parameters:
color
- the color to be set for the foreground- Since:
- 3.1
-
setBackgroundColor
Set the background color for this decoration.- Parameters:
color
- the color to be set for the background- Since:
- 3.1
-
setFont
Set the font for this decoration.- Parameters:
font
- the font to use in this decoration- Since:
- 3.1
-
getDecorationContext
IDecorationContext getDecorationContext()Return the decoration context in which this decoration will be applied.- Returns:
- the decoration context
- Since:
- 3.2
-