Package com._1c.g5.v8.dt.ui.util
Class LabelUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.ui.util.LabelUtil
-
public final class LabelUtil extends Object
Miscellaneous utilities for obtaining model labels for UI-related purposes.- Restriction:
- This class is not intended to be sub-classed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetLabel(Object object)Obtains label for a given object.static StringgetPath(Object object, String pathSeparator)Obtains path string for a given object.static StringgetPath(Object object, String pathSeparator, Class<?> stopAfter)Obtains path string for a given object.static StringgetPath(Object object, String pathSeparator, Class<?> stopAfter, int fromIndex)Obtains path string for a given object.static StringgetPath(Object object, String pathSeparator, Class<?> stopAfter, int fromIndex, Predicate<Object> filter)Obtains path string for a given object.
-
-
-
Method Detail
-
getLabel
public static String getLabel(Object object)
Obtains label for a given object.- Parameters:
object- the object to obtain label for, cannot benull- Returns:
- obtained label or empty string if object has no label, never
null
-
getPath
public static String getPath(Object object, String pathSeparator)
Obtains path string for a given object.- Parameters:
object- the object to obtain path for, cannot benullpathSeparator- the path separator to use, cannot benull- Returns:
- obtained path or empty string if object has no path, never
null
-
getPath
public static String getPath(Object object, String pathSeparator, Class<?> stopAfter)
Obtains path string for a given object.- Parameters:
object- the object to obtain path for, cannot benullpathSeparator- the path separator to use, cannot benullstopAfter- path generation will be stopped after object of this class is encountered among parents ornullif not needed- Returns:
- obtained path or empty string if object has no path, never
null
-
getPath
public static String getPath(Object object, String pathSeparator, Class<?> stopAfter, int fromIndex)
Obtains path string for a given object.- Parameters:
object- the object to obtain path for, cannot benullpathSeparator- the path separator to use, cannot benullstopAfter- path generation will be stopped after object of this class is encountered among parents ornullif not neededfromIndex- the index of the occurrence of thestopAfterto use to stop, must be positive- Returns:
- obtained path or empty string if object has no path, never
null
-
getPath
public static String getPath(Object object, String pathSeparator, Class<?> stopAfter, int fromIndex, Predicate<Object> filter)
Obtains path string for a given object.- Parameters:
object- the object to obtain path for, cannot benullpathSeparator- the path separator to use, cannot benullstopAfter- path generation will be stopped after object of this class is encountered among parents ornullif not neededfromIndex- the index of the occurrence of thestopAfterto use to stop, must be positivefilter- whether need to skip objects and don't add to result path, separator will aslo be skipped, can benullif not needed; filter will be applied to each path element- Returns:
- obtained path or empty string if object has no path.
-
-