public class JavaElementLabelProvider extends LabelProvider implements DelegatingStyledCellLabelProvider.IStyledLabelProvider
The implementation also handles non-Java elements by forwarding the requests to the
IWorkbenchAdapter
of the element.
This class may be instantiated; it is not intended to be subclassed.
Since 3.4, this class also implements DelegatingStyledCellLabelProvider.IStyledLabelProvider
for colored labels.
Modifier and Type | Field and Description |
---|---|
static int |
SHOW_BASICS
Constant (value
0 ) indicating that the label should show
the basic images only. |
static int |
SHOW_CONTAINER
Deprecated.
Use SHOW_QUALIFIED or SHOW_ROOT instead
|
static int |
SHOW_CONTAINER_QUALIFICATION
Deprecated.
Use SHOW_QUALIFIED instead
|
static int |
SHOW_DEFAULT
Constant indicating the default label rendering.
|
static int |
SHOW_OVERLAY_ICONS
Flag (bit mask) indicating that the label should include overlay icons
for element type and modifiers.
|
static int |
SHOW_PARAMETERS
Flag (bit mask) indicating that method label include parameter types.
|
static int |
SHOW_POST_QUALIFIED
Flag (bit mask) indicating that compilation units, class files, types, declarations and members
should be rendered qualified.The qualification is appended.
|
static int |
SHOW_POSTIFIX_QUALIFICATION
Deprecated.
SHOW_POST_QUALIFIED instead
|
static int |
SHOW_QUALIFIED
Flag (bit mask) indicating that compilation units, class files, types, declarations and members
should be rendered qualified.
|
static int |
SHOW_RETURN_TYPE
Flag (bit mask) indicating that methods labels include the method return type (appended).
|
static int |
SHOW_ROOT
Flag (bit mask) indicating that the label should include the name of the
package fragment root (appended).
|
static int |
SHOW_SMALL_ICONS
Flag (bit mask) indicating that the label should show the icons with no space
reserved for overlays.
|
static int |
SHOW_TYPE
Flag (bit mask) indicating that a field label should include the declared type.
|
static int |
SHOW_VARIABLE
Flag (bit mask) indicating that the package fragment roots from class path variables should
be rendered with the variable in the name
|
Constructor and Description |
---|
JavaElementLabelProvider()
Creates a new label provider with
SHOW_DEFAULT flag. |
JavaElementLabelProvider(int flags)
Creates a new label provider.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
Image |
getImage(Object element) |
StyledString |
getStyledText(Object element)
Returns the styled text label for the given element
|
String |
getText(Object element) |
void |
turnOff(int flags)
Turns off the rendering options specified in the given flags.
|
void |
turnOn(int flags)
Turns on the rendering options specified in the given flags.
|
addListener, fireLabelProviderChanged, isLabelProperty, removeListener
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, isLabelProperty, removeListener
public static final int SHOW_RETURN_TYPE
public static final int SHOW_PARAMETERS
public static final int SHOW_CONTAINER
public static final int SHOW_CONTAINER_QUALIFICATION
public static final int SHOW_OVERLAY_ICONS
public static final int SHOW_TYPE
public static final int SHOW_ROOT
public static final int SHOW_POSTIFIX_QUALIFICATION
public static final int SHOW_SMALL_ICONS
public static final int SHOW_VARIABLE
public static final int SHOW_QUALIFIED
java.lang.String
, java.util.Vector.size()
public static final int SHOW_POST_QUALIFIED
String - java.lang
, size() - java.util.Vector
public static final int SHOW_BASICS
0
) indicating that the label should show
the basic images only.public static final int SHOW_DEFAULT
SHOW_PARAMETERS | SHOW_OVERLAY_ICONS
.public JavaElementLabelProvider()
SHOW_DEFAULT
flag.SHOW_DEFAULT
public JavaElementLabelProvider(int flags)
flags
- the initial options; a bitwise OR of SHOW_*
constantspublic void turnOn(int flags)
flags
- the options; a bitwise OR of SHOW_*
constantspublic void turnOff(int flags)
flags
- the initial options; a bitwise OR of SHOW_*
constantspublic Image getImage(Object element)
getImage
in interface DelegatingStyledCellLabelProvider.IStyledLabelProvider
getImage
in interface ILabelProvider
getImage
in class LabelProvider
public String getText(Object element)
getText
in interface ILabelProvider
getText
in class LabelProvider
public StyledString getStyledText(Object element)
getStyledText
in interface DelegatingStyledCellLabelProvider.IStyledLabelProvider
element
- the element to evaluate the styled string forpublic void dispose()
dispose
in interface IBaseLabelProvider
dispose
in class BaseLabelProvider
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.