Package org.eclipse.jdt.ui
Class JavaElementLabelProvider
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.viewers.BaseLabelProvider
org.eclipse.jface.viewers.LabelProvider
org.eclipse.jdt.ui.JavaElementLabelProvider
- All Implemented Interfaces:
- org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider,- org.eclipse.jface.viewers.IBaseLabelProvider,- org.eclipse.jface.viewers.ILabelProvider
public class JavaElementLabelProvider
extends org.eclipse.jface.viewers.LabelProvider
implements org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider
Standard label provider for Java elements.
 Use this class when you want to present the Java elements in a viewer.
 
 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.
- Restriction:
- This class is not intended to be subclassed by clients.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intConstant (value0) indicating that the label should show the basic images only.static final intDeprecated.Use SHOW_QUALIFIED or SHOW_ROOT insteadstatic final intDeprecated.Use SHOW_QUALIFIED insteadstatic final intConstant indicating the default label rendering.static final intFlag (bit mask) indicating that the label should include overlay icons for element type and modifiers.static final intFlag (bit mask) indicating that method label include parameter types.static final intFlag (bit mask) indicating that compilation units, class files, types, declarations and members should be rendered qualified.The qualification is appended.static final intDeprecated.SHOW_POST_QUALIFIED insteadstatic final intFlag (bit mask) indicating that compilation units, class files, types, declarations and members should be rendered qualified.static final intFlag (bit mask) indicating that methods labels include the method return type (appended).static final intFlag (bit mask) indicating that the label should include the name of the package fragment root (appended).static final intFlag (bit mask) indicating that the label should show the icons with no space reserved for overlays.static final intFlag (bit mask) indicating that a field label should include the declared type.static final intFlag (bit mask) indicating that the package fragment roots from class path variables should be rendered with the variable in the name
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new label provider withSHOW_DEFAULTflag.JavaElementLabelProvider(int flags) Creates a new label provider.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()org.eclipse.swt.graphics.Imageorg.eclipse.jface.viewers.StyledStringgetStyledText(Object element) Returns the styled text label for the given elementvoidturnOff(int flags) Turns off the rendering options specified in the given flags.voidturnOn(int flags) Turns on the rendering options specified in the given flags.Methods inherited from class org.eclipse.jface.viewers.LabelProvidercreateImageProvider, createTextImageProvider, createTextProviderMethods inherited from class org.eclipse.jface.viewers.BaseLabelProvideraddListener, fireLabelProviderChanged, isLabelProperty, removeListenerMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvideraddListener, isLabelProperty, removeListener
- 
Field Details- 
SHOW_RETURN_TYPEpublic static final int SHOW_RETURN_TYPEFlag (bit mask) indicating that methods labels include the method return type (appended).- See Also:
 
- 
SHOW_PARAMETERSpublic static final int SHOW_PARAMETERSFlag (bit mask) indicating that method label include parameter types.- See Also:
 
- 
SHOW_CONTAINERDeprecated.Use SHOW_QUALIFIED or SHOW_ROOT insteadFlag (bit mask) indicating that the label of a member should include the container. For example, include the name of the type enclosing a field.- See Also:
 
- 
SHOW_CONTAINER_QUALIFICATIONDeprecated.Use SHOW_QUALIFIED insteadFlag (bit mask) indicating that the label of a type should be fully qualified. For example, include the fully qualified name of the type enclosing a type.- See Also:
 
- 
SHOW_OVERLAY_ICONSpublic static final int SHOW_OVERLAY_ICONSFlag (bit mask) indicating that the label should include overlay icons for element type and modifiers.- See Also:
 
- 
SHOW_TYPEpublic static final int SHOW_TYPEFlag (bit mask) indicating that a field label should include the declared type.- See Also:
 
- 
SHOW_ROOTpublic static final int SHOW_ROOTFlag (bit mask) indicating that the label should include the name of the package fragment root (appended).- See Also:
 
- 
SHOW_POSTIFIX_QUALIFICATIONDeprecated.SHOW_POST_QUALIFIED insteadFlag (bit mask) indicating that the label qualification of a type should be shown after the name.- See Also:
 
- 
SHOW_SMALL_ICONSpublic static final int SHOW_SMALL_ICONSFlag (bit mask) indicating that the label should show the icons with no space reserved for overlays.- See Also:
 
- 
SHOW_VARIABLEpublic static final int SHOW_VARIABLEFlag (bit mask) indicating that the package fragment roots from class path variables should be rendered with the variable in the name- See Also:
 
- 
SHOW_QUALIFIEDpublic static final int SHOW_QUALIFIEDFlag (bit mask) indicating that compilation units, class files, types, declarations and members should be rendered qualified. Examples:java.lang.String,java.util.Vector.size()- Since:
- 2.0
- See Also:
 
- 
SHOW_POST_QUALIFIEDpublic static final int SHOW_POST_QUALIFIEDFlag (bit mask) indicating that compilation units, class files, types, declarations and members should be rendered qualified.The qualification is appended. Examples:String - java.lang,size() - java.util.Vector- Since:
- 2.0
- See Also:
 
- 
SHOW_BASICSpublic static final int SHOW_BASICSConstant (value0) indicating that the label should show the basic images only.- See Also:
 
- 
SHOW_DEFAULTpublic static final int SHOW_DEFAULTConstant indicating the default label rendering. Currently the default is equivalent toSHOW_PARAMETERS | SHOW_OVERLAY_ICONS.- See Also:
 
 
- 
- 
Constructor Details- 
JavaElementLabelProviderpublic JavaElementLabelProvider()Creates a new label provider withSHOW_DEFAULTflag.- Since:
- 2.0
- See Also:
 
- 
JavaElementLabelProviderpublic JavaElementLabelProvider(int flags) Creates a new label provider.- Parameters:
- flags- the initial options; a bitwise OR of- SHOW_*constants
 
 
- 
- 
Method Details- 
turnOnpublic void turnOn(int flags) Turns on the rendering options specified in the given flags.- Parameters:
- flags- the options; a bitwise OR of- SHOW_*constants
 
- 
turnOffpublic void turnOff(int flags) Turns off the rendering options specified in the given flags.- Parameters:
- flags- the initial options; a bitwise OR of- SHOW_*constants
 
- 
getImage- Specified by:
- getImagein interface- org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider
- Specified by:
- getImagein interface- org.eclipse.jface.viewers.ILabelProvider
- Overrides:
- getImagein class- org.eclipse.jface.viewers.LabelProvider
 
- 
getText- Specified by:
- getTextin interface- org.eclipse.jface.viewers.ILabelProvider
- Overrides:
- getTextin class- org.eclipse.jface.viewers.LabelProvider
 
- 
getStyledTextReturns the styled text label for the given element- Specified by:
- getStyledTextin interface- org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider
- Parameters:
- element- the element to evaluate the styled string for
- Returns:
- the styled string.
- Since:
- 3.4
 
- 
disposepublic void dispose()- Specified by:
- disposein interface- org.eclipse.jface.viewers.IBaseLabelProvider
- Overrides:
- disposein class- org.eclipse.jface.viewers.BaseLabelProvider
 
 
-