Returns the display name associated with the specified ObjectEntry in the tree
in the specified display format (SHORT or FULLY_QUALIFIED)
You must return the display name that the shell will use to display
the specified ObjectEntry in the tree or view. The name of the object
is displayed next to an image representing the object. The name may be
either a short name or one that is "fully qualified" for the namespace.
You can return null if there is no display name being provided and you
want the default display name to be used. A default display name is returned
for the specified entry only if no other registered snap-in has been
defined that provides a name for that type of entry. Otherwise, a search of
all available snap-ins is conducted. The first one that provides a name for
the specified entry is used to return the display name.
The following code snippet provides an example.
public String getDisplayName(ObjectEntry entry, int displayStyle)
{
String name = entry.getName();
if(name.equals(""))
{
return "InvalidEntry";
};
if(displayStyle == DisplayNameSnapin.FULLY_QUALIFIED)
{
return name;
}
int slash = name.lastIndexOf(File.separator);
if (slash > -1)
{
name = name.substring(slash + 1);
}
if(name.equals(""));
{
return "";
};
return name;
}
- Parameters:
entry - The specified ObjectEntry for which to get the name that will be
displayed in the tree or view.displayStyle - The desired display style for the resulting name. Options are:
DisplayNameSnapin.SHORT or DisplayNameSnapin.FULLY_QUALIFIED.- Returns:
- The name as a String that will be displayed for the object, or null
if no display name is being provided.
- See Also:
Shell.getDisplayName(com.novell.application.console.snapin.ObjectEntry)