|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Provides the display name associated with a specified ObjectEntry
or ObjectType object.
Snap-ins must implement this interface to provide the display name
for the specified ObjectEntry or ObjectType object.
Two types of the getDisplayName method are available for snap-ins
to use: One associated with a specified ObjectEntry object, and the
other associated with a specified namespace and ObjectType object.
The name for the object is displayed next to an icon representing the object.
If the DisplayNameSnapin interface is not implemented a default
name will be used.
ObjectEntry,
ObjectType| Field Summary | |
static int |
FULLY_QUALIFIED
The user-readable fully-qualified version of the ObjectEntry
object's name. |
static int |
SHORT
The user-readable short version of the ObjectEntry object's name. |
| Method Summary | |
java.lang.String |
getDisplayName(ObjectEntry entry)
Returns the display name associated with the specified ObjectEntry
object in the tree. |
java.lang.String |
getDisplayName(java.lang.String namespace,
java.lang.String type)
Returns the display name associated with the specified namespace and object type. |
| Methods inherited from interface com.novell.application.console.snapin.Snapin |
getSnapinDescription,
getSnapinName,
initSnapin,
shutdownSnapin |
| Field Detail |
public static final int SHORT
ObjectEntry object's name.DisplayNameSnapinRev2.getDisplayName(com.novell.application.console.snapin.ObjectEntry, int),
Shell.getDisplayName(ObjectEntry, int)public static final int FULLY_QUALIFIED
ObjectEntry
object's name.DisplayNameSnapinRev2.getDisplayName(com.novell.application.console.snapin.ObjectEntry, int),
Shell.getDisplayName(ObjectEntry, int)| Method Detail |
public java.lang.String getDisplayName(java.lang.String namespace,
java.lang.String type)
You must return the display name associated with the namespace and
ObjectType that has the same name as the type parameter.
The name should be a localized name for the specified type. For example, if
you want to return a French name for a user, the object type parameter must
be "user" and the string returned would be a French name for user.
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 type 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 provides an example:
public String getDisplayName(String namespace, String type)
{
return type;
}
namespace - The namespace with which the ObjectType object is associated.type - The name of the ObjectType object whose name is to be
displayed in the tree or view.null if no name is provided.getDisplayName(com.novell.application.console.snapin.ObjectEntry),
DisplayIconSnapin.getDisplayIcon(java.lang.String, java.lang.String),
Shell.getDisplayName(java.lang.String, java.lang.String)public java.lang.String getDisplayName(ObjectEntry entry)
ObjectEntry
object in the tree.
You must return the display name that the shell will use to display
the specified ObjectEntry object in the tree or view.
The name of the object is displayed next to an image representing the object.
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 provides an example:
public String getDisplayName(ObjectEntry entry)
{
String name = entry.getName();
if(name.equals(""))
{
return "InvalidEntry";
};
int slash = name.lastIndexOf(File.separator);
if (slash > -1)
{
name = name.substring(slash + 1);
}
if(name.equals(""));
{
return "";
};
return name;
}
entry - The ObjectEntry object whose name is to be
displayed in the tree or view.null
if no display name is provided.getDisplayName(java.lang.String, java.lang.String),
DisplayIconSnapin.getDisplayIcon(com.novell.application.console.snapin.ObjectEntry),
Shell.getDisplayName(com.novell.application.console.snapin.ObjectEntry)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||