Package org.eclipse.jdt.ui
Class JavaElementLabels
java.lang.Object
org.eclipse.jdt.ui.JavaElementLabels
JavaElementLabels
provides helper methods to render names of Java elements.- Since:
- 3.1
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Deprecated.static final long
Show category for all elements.static final long
Default options (M_PARAMETER_TYPES, M_APP_TYPE_PARAMETERS & T_TYPE_PARAMETERS enabled)static final long
Qualify all elementsstatic final long
Post qualify all elementsstatic final long
Add root path to all elements except Package Fragment Roots and Java projects.static final String
User-readable string for concatenating categories (e.g. " ").static final long
Class file names are post qualified.static final long
Class file names are fully qualified.static final long
Specifies to apply color styles to labels.static final String
User-readable string for separating list items (e.g. ", ").static final String
User-readable string for separating post qualified names (e.g. " - ").static final long
Compilation unit names are post qualified.static final long
Compilation unit names are fully qualified.static final long
Declarations (import container / declaration, package declaration) are post qualified.static final long
Declarations (import container / declaration, package declaration) are qualified.static final String
User-readable string for separating the return type (e.g. " : ").static final String
User-readable string for the default package name (e.g.static final long
Default post qualify options (All except Root and Package)static final long
Default qualify options (All except Root and Package)static final String
User-readable string for ellipsis ("...").static final long
Field names contain the declared type (appended) e.g.static final long
Prepend first category (if any) to field.static final long
Fields names are fully qualified.static final long
Fields names are post qualified.static final long
Field names contain the declared type (prepended) e.g.static final long
Initializer names are fully qualified.static final long
Type names are post qualified.static final long
Method names contain return type (appended) e.g.static final long
Method names contain type parameters appended.static final long
Prepend first category (if any) to method.static final long
Method names contain thrown exceptions.static final long
Method names are fully qualified.static final long
Method labels contain parameter annotations.static final long
Method names contain parameter names.static final long
Method names contain parameter types.static final long
Method names are post qualified.static final long
Method names contain return type (appended) e.g.static final long
Method names contain type parameters prepended.static final long
Package names are abbreviated ifPreferenceConstants.APPEARANCE_ABBREVIATE_PACKAGE_NAMES
istrue
and/or compressed ifPreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES
istrue
.static final long
Package names are post qualified.static final long
Package names are qualified.static final long
Add root path to all elements except Package Fragment Roots and Java projects.static final long
Post qualify referenced package fragment roots.static final long
Package Fragment Roots contain the project name if not an archive (appended).static final long
Package Fragment Roots contain the project name if not an archive (prepended).static final long
Package Fragment Roots contain variable name if from a variable.static final long
Prepend first category (if any) to type.static final long
Type names are type container qualified.static final long
Type names are fully qualified.static final long
Type names are post qualified.static final long
Type names contain type parameters.static final long
Type parameters are post qualified.static final long
Specifies to use the resolved information of a IType, IMethod or IField. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
getClassFileLabel
(IClassFile classFile, long flags, StringBuffer buf) Appends the label for a class file to aStringBuffer
.static void
getClassFileLabel
(IClassFile classFile, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a class file to aStyledString
.static void
getCompilationUnitLabel
(ICompilationUnit cu, long flags, StringBuffer buf) Appends the label for a compilation unit to aStringBuffer
.static void
getCompilationUnitLabel
(ICompilationUnit cu, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a compilation unit to aStyledString
.static String
getContainerEntryLabel
(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) Returns the label of a classpath container.static void
getDeclarationLabel
(IJavaElement declaration, long flags, StringBuffer buf) Appends the label for a import container, import or package declaration to aStringBuffer
.static void
getDeclarationLabel
(IJavaElement declaration, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a import container, import or package declaration to aStyledString
.static String
getElementLabel
(IJavaElement element, long flags) Returns the label for a Java element with the flags as defined by this class.static void
getElementLabel
(IJavaElement element, long flags, StringBuffer buf) Returns the label for a Java element with the flags as defined by this class.static void
getElementLabel
(IJavaElement element, long flags, org.eclipse.jface.viewers.StyledString result) Returns the styled label for a Java element with the flags as defined by this class.static void
getFieldLabel
(IField field, long flags, StringBuffer buf) Appends the label for a field to aStringBuffer
.static void
getFieldLabel
(IField field, long flags, org.eclipse.jface.viewers.StyledString result) Appends the style label for a field to aStyledString
.static void
getInitializerLabel
(IInitializer initializer, long flags, StringBuffer buf) Appends the label for a initializer to aStringBuffer
.static void
getInitializerLabel
(IInitializer initializer, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a initializer to aStyledString
.static void
getLocalVariableLabel
(ILocalVariable localVariable, long flags, StringBuffer buf) Appends the label for a local variable to aStringBuffer
.static void
getLocalVariableLabel
(ILocalVariable localVariable, long flags, org.eclipse.jface.viewers.StyledString result) Appends the styled label for a local variable to aStyledString
.static void
getMethodLabel
(IMethod method, long flags, StringBuffer buf) Appends the label for a method to aStringBuffer
.static void
getMethodLabel
(IMethod method, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a method to aStyledString
.static void
getPackageFragmentLabel
(IPackageFragment pack, long flags, StringBuffer buf) Appends the label for a package fragment to aStringBuffer
.static void
getPackageFragmentLabel
(IPackageFragment pack, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a package fragment to aStyledString
.static void
getPackageFragmentRootLabel
(IPackageFragmentRoot root, long flags, StringBuffer buf) Appends the label for a package fragment root to aStringBuffer
.static void
getPackageFragmentRootLabel
(IPackageFragmentRoot root, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a package fragment root to aStyledString
.static org.eclipse.jface.viewers.StyledString
getStyledContainerEntryLabel
(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) Returns the styled label of a classpath container.static org.eclipse.jface.viewers.StyledString
getStyledElementLabel
(IJavaElement element, long flags) Returns the styled label for a Java element with the flags as defined by this class.static org.eclipse.jface.viewers.StyledString
getStyledTextLabel
(Object obj, long flags) Returns the styled label of the given object.static String
getTextLabel
(Object obj, long flags) Returns the label of the given object.static void
getTypeLabel
(IType type, long flags, StringBuffer buf) Appends the label for a type to aStringBuffer
.static void
getTypeLabel
(IType type, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a type to aStyledString
.static void
getTypeParameterLabel
(ITypeParameter typeParameter, long flags, StringBuffer buf) Appends the label for a type parameter to aStringBuffer
.static void
getTypeParameterLabel
(ITypeParameter typeParameter, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a type parameter to aStyledString
.
-
Field Details
-
M_PARAMETER_TYPES
public static final long M_PARAMETER_TYPESMethod names contain parameter types. e.g.foo(int)
- See Also:
-
M_PARAMETER_NAMES
public static final long M_PARAMETER_NAMESMethod names contain parameter names. e.g.foo(index)
- See Also:
-
M_PARAMETER_ANNOTATIONS
public static final long M_PARAMETER_ANNOTATIONSMethod labels contain parameter annotations. E.g.foo(@NonNull int)
. This flag is only valid ifM_PARAMETER_NAMES
orM_PARAMETER_TYPES
is also set.- Since:
- 3.8
- See Also:
-
M_PRE_TYPE_PARAMETERS
public static final long M_PRE_TYPE_PARAMETERSMethod names contain type parameters prepended. e.g.<A> foo(A index)
- See Also:
-
M_APP_TYPE_PARAMETERS
public static final long M_APP_TYPE_PARAMETERSMethod names contain type parameters appended. e.g.foo(A index) <A>
- See Also:
-
M_EXCEPTIONS
public static final long M_EXCEPTIONSMethod names contain thrown exceptions. e.g.foo throws IOException
- See Also:
-
M_APP_RETURNTYPE
public static final long M_APP_RETURNTYPEMethod names contain return type (appended) e.g.foo : int
- See Also:
-
M_PRE_RETURNTYPE
public static final long M_PRE_RETURNTYPEMethod names contain return type (appended) e.g.int foo
- See Also:
-
M_FULLY_QUALIFIED
public static final long M_FULLY_QUALIFIEDMethod names are fully qualified. e.g.java.util.Vector.size
- See Also:
-
M_POST_QUALIFIED
public static final long M_POST_QUALIFIEDMethod names are post qualified. e.g.size - java.util.Vector
- See Also:
-
I_FULLY_QUALIFIED
public static final long I_FULLY_QUALIFIEDInitializer names are fully qualified. e.g.java.util.Vector.{ ... }
- See Also:
-
I_POST_QUALIFIED
public static final long I_POST_QUALIFIEDType names are post qualified. e.g.{ ... } - java.util.Map
- See Also:
-
F_APP_TYPE_SIGNATURE
public static final long F_APP_TYPE_SIGNATUREField names contain the declared type (appended) e.g.fHello : int
- See Also:
-
F_PRE_TYPE_SIGNATURE
public static final long F_PRE_TYPE_SIGNATUREField names contain the declared type (prepended) e.g.int fHello
- See Also:
-
F_FULLY_QUALIFIED
public static final long F_FULLY_QUALIFIEDFields names are fully qualified. e.g.java.lang.System.out
- See Also:
-
F_POST_QUALIFIED
public static final long F_POST_QUALIFIEDFields names are post qualified. e.g.out - java.lang.System
- See Also:
-
T_FULLY_QUALIFIED
public static final long T_FULLY_QUALIFIEDType names are fully qualified. e.g.java.util.Map.Entry
- See Also:
-
T_CONTAINER_QUALIFIED
public static final long T_CONTAINER_QUALIFIEDType names are type container qualified. e.g.Map.Entry
- See Also:
-
T_POST_QUALIFIED
public static final long T_POST_QUALIFIEDType names are post qualified. e.g.Entry - java.util.Map
- See Also:
-
T_TYPE_PARAMETERS
public static final long T_TYPE_PARAMETERSType names contain type parameters. e.g.Map<S, T>
- See Also:
-
TP_POST_QUALIFIED
public static final long TP_POST_QUALIFIEDType parameters are post qualified. e.g.K - java.util.Map.Entry
- Since:
- 3.5
- See Also:
-
D_QUALIFIED
public static final long D_QUALIFIEDDeclarations (import container / declaration, package declaration) are qualified. e.g.java.util.Vector.class/import container
- See Also:
-
D_POST_QUALIFIED
public static final long D_POST_QUALIFIEDDeclarations (import container / declaration, package declaration) are post qualified. e.g.import container - java.util.Vector.class
- See Also:
-
CF_QUALIFIED
public static final long CF_QUALIFIEDClass file names are fully qualified. e.g.java.util.Vector.class
- See Also:
-
CF_POST_QUALIFIED
public static final long CF_POST_QUALIFIEDClass file names are post qualified. e.g.Vector.class - java.util
- See Also:
-
CU_QUALIFIED
public static final long CU_QUALIFIEDCompilation unit names are fully qualified. e.g.java.util.Vector.java
- See Also:
-
CU_POST_QUALIFIED
public static final long CU_POST_QUALIFIEDCompilation unit names are post qualified. e.g.Vector.java - java.util
- See Also:
-
P_QUALIFIED
public static final long P_QUALIFIEDPackage names are qualified. e.g.MyProject/src/java.util
- See Also:
-
P_POST_QUALIFIED
public static final long P_POST_QUALIFIEDPackage names are post qualified. e.g.java.util - MyProject/src
- See Also:
-
P_COMPRESSED
public static final long P_COMPRESSEDPackage names are abbreviated ifPreferenceConstants.APPEARANCE_ABBREVIATE_PACKAGE_NAMES
istrue
and/or compressed ifPreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES
istrue
.- See Also:
-
ROOT_VARIABLE
public static final long ROOT_VARIABLEPackage Fragment Roots contain variable name if from a variable. e.g.JRE_LIB - c:\java\lib\rt.jar
- See Also:
-
ROOT_QUALIFIED
public static final long ROOT_QUALIFIEDPackage Fragment Roots contain the project name if not an archive (prepended). e.g.MyProject/src
- See Also:
-
ROOT_POST_QUALIFIED
public static final long ROOT_POST_QUALIFIEDPackage Fragment Roots contain the project name if not an archive (appended). e.g.src - MyProject
- See Also:
-
APPEND_ROOT_PATH
public static final long APPEND_ROOT_PATHAdd root path to all elements except Package Fragment Roots and Java projects. e.g.java.lang.Vector - C:\java\lib\rt.jar
Option only applies to getElementLabel- See Also:
-
PREPEND_ROOT_PATH
public static final long PREPEND_ROOT_PATHAdd root path to all elements except Package Fragment Roots and Java projects. e.g.C:\java\lib\rt.jar - java.lang.Vector
Option only applies to getElementLabel- See Also:
-
REFERENCED_ROOT_POST_QUALIFIED
public static final long REFERENCED_ROOT_POST_QUALIFIEDPost qualify referenced package fragment roots. For examplejdt.jar - org.eclipse.jdt.ui
if the jar is referenced from another project.- See Also:
-
USE_RESOLVED
public static final long USE_RESOLVEDSpecifies to use the resolved information of a IType, IMethod or IField. SeeIType.isResolved()
. If resolved information is available, types will be rendered with type parameters of the instantiated type. Resolved methods render with the parameter types of the method instance.Vector<String>.get(String)
- See Also:
-
COLORIZE
public static final long COLORIZESpecifies to apply color styles to labels. This flag only applies to methods taking or returning aStyledString
.- Since:
- 3.4
- See Also:
-
F_CATEGORY
public static final long F_CATEGORYPrepend first category (if any) to field.- Since:
- 3.2
- See Also:
-
M_CATEGORY
public static final long M_CATEGORYPrepend first category (if any) to method.- Since:
- 3.2
- See Also:
-
T_CATEGORY
public static final long T_CATEGORYPrepend first category (if any) to type.- Since:
- 3.2
- See Also:
-
ALL_CATEGORY
Deprecated.UseALL_CATEGORY2
instead.Show category for all elements.- Since:
- 3.2
- See Also:
-
ALL_CATEGORY2
public static final long ALL_CATEGORY2Show category for all elements.- Since:
- 3.28
- See Also:
-
ALL_FULLY_QUALIFIED
public static final long ALL_FULLY_QUALIFIEDQualify all elements- See Also:
-
ALL_POST_QUALIFIED
public static final long ALL_POST_QUALIFIEDPost qualify all elements- See Also:
-
ALL_DEFAULT
public static final long ALL_DEFAULTDefault options (M_PARAMETER_TYPES, M_APP_TYPE_PARAMETERS & T_TYPE_PARAMETERS enabled)- See Also:
-
DEFAULT_QUALIFIED
public static final long DEFAULT_QUALIFIEDDefault qualify options (All except Root and Package)- See Also:
-
DEFAULT_POST_QUALIFIED
public static final long DEFAULT_POST_QUALIFIEDDefault post qualify options (All except Root and Package)- See Also:
-
CONCAT_STRING
User-readable string for separating post qualified names (e.g. " - "). -
COMMA_STRING
User-readable string for separating list items (e.g. ", "). -
DECL_STRING
User-readable string for separating the return type (e.g. " : "). -
CATEGORY_SEPARATOR_STRING
User-readable string for concatenating categories (e.g. " ").- Since:
- 3.5
-
ELLIPSIS_STRING
User-readable string for ellipsis ("...").- See Also:
-
DEFAULT_PACKAGE
User-readable string for the default package name (e.g. "(default package)").
-
-
Method Details
-
getTextLabel
Returns the label of the given object. The object must be of typeIJavaElement
or adapt toIWorkbenchAdapter
. If the element type is not known, the empty string is returned. The returned label is BiDi-processed withTextProcessor.process(String, String)
.- Parameters:
obj
- object to get the label forflags
- the rendering flags- Returns:
- the label or the empty string if the object type is not supported
-
getStyledTextLabel
Returns the styled label of the given object. The object must be of typeIJavaElement
or adapt toIWorkbenchAdapter
. If the element type is not known, the empty string is returned. The returned label is BiDi-processed withTextProcessor.process(String, String)
.- Parameters:
obj
- object to get the label forflags
- the rendering flags- Returns:
- the label or the empty string if the object type is not supported
- Since:
- 3.4
-
getElementLabel
Returns the label for a Java element with the flags as defined by this class.- Parameters:
element
- the element to renderflags
- the rendering flags- Returns:
- the label of the Java element
-
getStyledElementLabel
public static org.eclipse.jface.viewers.StyledString getStyledElementLabel(IJavaElement element, long flags) Returns the styled label for a Java element with the flags as defined by this class.- Parameters:
element
- the element to renderflags
- the rendering flags- Returns:
- the label of the Java element
- Since:
- 3.4
-
getElementLabel
Returns the label for a Java element with the flags as defined by this class.- Parameters:
element
- the element to renderflags
- the rendering flagsbuf
- the buffer to append the resulting label to
-
getElementLabel
public static void getElementLabel(IJavaElement element, long flags, org.eclipse.jface.viewers.StyledString result) Returns the styled label for a Java element with the flags as defined by this class.- Parameters:
element
- the element to renderflags
- the rendering flagsresult
- the buffer to append the resulting label to- Since:
- 3.4
-
getMethodLabel
Appends the label for a method to aStringBuffer
. Considers the M_* flags.- Parameters:
method
- the element to renderflags
- the rendering flags. Flags with names starting with 'M_' are considered.buf
- the buffer to append the resulting label to
-
getMethodLabel
public static void getMethodLabel(IMethod method, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a method to aStyledString
. Considers the M_* flags.- Parameters:
method
- the element to renderflags
- the rendering flags. Flags with names starting with 'M_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getFieldLabel
Appends the label for a field to aStringBuffer
. Considers the F_* flags.- Parameters:
field
- the element to renderflags
- the rendering flags. Flags with names starting with 'F_' are considered.buf
- the buffer to append the resulting label to
-
getFieldLabel
public static void getFieldLabel(IField field, long flags, org.eclipse.jface.viewers.StyledString result) Appends the style label for a field to aStyledString
. Considers the F_* flags.- Parameters:
field
- the element to renderflags
- the rendering flags. Flags with names starting with 'F_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getLocalVariableLabel
public static void getLocalVariableLabel(ILocalVariable localVariable, long flags, StringBuffer buf) Appends the label for a local variable to aStringBuffer
.- Parameters:
localVariable
- the element to renderflags
- the rendering flags. Flags with names starting with 'F_' are considered.buf
- the buffer to append the resulting label to
-
getLocalVariableLabel
public static void getLocalVariableLabel(ILocalVariable localVariable, long flags, org.eclipse.jface.viewers.StyledString result) Appends the styled label for a local variable to aStyledString
.- Parameters:
localVariable
- the element to renderflags
- the rendering flags. Flags with names starting with 'F_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getInitializerLabel
Appends the label for a initializer to aStringBuffer
. Considers the I_* flags.- Parameters:
initializer
- the element to renderflags
- the rendering flags. Flags with names starting with 'I_' are considered.buf
- the buffer to append the resulting label to
-
getInitializerLabel
public static void getInitializerLabel(IInitializer initializer, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a initializer to aStyledString
. Considers the I_* flags.- Parameters:
initializer
- the element to renderflags
- the rendering flags. Flags with names starting with 'I_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getTypeLabel
Appends the label for a type to aStringBuffer
. Considers the T_* flags.- Parameters:
type
- the element to renderflags
- the rendering flags. Flags with names starting with 'T_' are considered.buf
- the buffer to append the resulting label to
-
getTypeLabel
public static void getTypeLabel(IType type, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a type to aStyledString
. Considers the T_* flags.- Parameters:
type
- the element to renderflags
- the rendering flags. Flags with names starting with 'T_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getTypeParameterLabel
public static void getTypeParameterLabel(ITypeParameter typeParameter, long flags, StringBuffer buf) Appends the label for a type parameter to aStringBuffer
. Considers the TP_* flags.- Parameters:
typeParameter
- the element to renderflags
- the rendering flags. Flags with names starting with 'TP_' are considered.buf
- the buffer to append the resulting label to- Since:
- 3.5
-
getTypeParameterLabel
public static void getTypeParameterLabel(ITypeParameter typeParameter, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a type parameter to aStyledString
. Considers the TP_* flags.- Parameters:
typeParameter
- the element to renderflags
- the rendering flags. Flags with names starting with 'TP_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.5
-
getDeclarationLabel
Appends the label for a import container, import or package declaration to aStringBuffer
. Considers the D_* flags.- Parameters:
declaration
- the element to renderflags
- the rendering flags. Flags with names starting with 'D_' are considered.buf
- the buffer to append the resulting label to
-
getDeclarationLabel
public static void getDeclarationLabel(IJavaElement declaration, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a import container, import or package declaration to aStyledString
. Considers the D_* flags.- Parameters:
declaration
- the element to renderflags
- the rendering flags. Flags with names starting with 'D_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getClassFileLabel
Appends the label for a class file to aStringBuffer
. Considers the CF_* flags.- Parameters:
classFile
- the element to renderflags
- the rendering flags. Flags with names starting with 'CF_' are considered.buf
- the buffer to append the resulting label to
-
getClassFileLabel
public static void getClassFileLabel(IClassFile classFile, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a class file to aStyledString
. Considers the CF_* flags.- Parameters:
classFile
- the element to renderflags
- the rendering flags. Flags with names starting with 'CF_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getCompilationUnitLabel
Appends the label for a compilation unit to aStringBuffer
. Considers the CU_* flags.- Parameters:
cu
- the element to renderflags
- the rendering flags. Flags with names starting with 'CU_' are considered.buf
- the buffer to append the resulting label to
-
getCompilationUnitLabel
public static void getCompilationUnitLabel(ICompilationUnit cu, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a compilation unit to aStyledString
. Considers the CU_* flags.- Parameters:
cu
- the element to renderflags
- the rendering flags. Flags with names starting with 'CU_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getPackageFragmentLabel
Appends the label for a package fragment to aStringBuffer
. Considers the P_* flags.- Parameters:
pack
- the element to renderflags
- the rendering flags. Flags with names starting with P_' are considered.buf
- the buffer to append the resulting label to
-
getPackageFragmentLabel
public static void getPackageFragmentLabel(IPackageFragment pack, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a package fragment to aStyledString
. Considers the P_* flags.- Parameters:
pack
- the element to renderflags
- the rendering flags. Flags with names starting with P_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getPackageFragmentRootLabel
public static void getPackageFragmentRootLabel(IPackageFragmentRoot root, long flags, StringBuffer buf) Appends the label for a package fragment root to aStringBuffer
. Considers the ROOT_* flags.- Parameters:
root
- the element to renderflags
- the rendering flags. Flags with names starting with ROOT_' are considered.buf
- the buffer to append the resulting label to
-
getPackageFragmentRootLabel
public static void getPackageFragmentRootLabel(IPackageFragmentRoot root, long flags, org.eclipse.jface.viewers.StyledString result) Appends the label for a package fragment root to aStyledString
. Considers the ROOT_* flags.- Parameters:
root
- the element to renderflags
- the rendering flags. Flags with names starting with ROOT_' are considered.result
- the buffer to append the resulting label to- Since:
- 3.4
-
getContainerEntryLabel
public static String getContainerEntryLabel(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) throws JavaModelException Returns the label of a classpath container. The returned label is BiDi-processed withTextProcessor.process(String, String)
.- Parameters:
containerPath
- the path of the containerproject
- the project the container is resolved in- Returns:
- the label of the classpath container
- Throws:
JavaModelException
- when resolving of the container failed
-
getStyledContainerEntryLabel
public static org.eclipse.jface.viewers.StyledString getStyledContainerEntryLabel(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) Returns the styled label of a classpath container. The returned label is BiDi-processed withTextProcessor.process(String, String)
.- Parameters:
containerPath
- the path of the containerproject
- the project the container is resolved in- Returns:
- the label of the classpath container
- Since:
- 3.4
-
ALL_CATEGORY2
instead.