org.openide.util
Class Lookup.Item

java.lang.Object
  |
  +--org.openide.util.Lookup.Item
Direct Known Subclasses:
AbstractLookup.Pair
Enclosing class:
Lookup

public abstract static class Lookup.Item
extends Object

A single item in a lookup result. This wrapper provides unified access to not just the instance, but its class, a possible persistent identifier, and so on.

Since:
1.25

Constructor Summary
Lookup.Item()
           
 
Method Summary
abstract  String getDisplayName()
          Get a human presentable name for the item.
abstract  String getId()
          Get a persistent indentifier for the item.
abstract  Object getInstance()
          Get the instance itself.
abstract  Class getType()
          Get the implementing class of the instance.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Lookup.Item

public Lookup.Item()
Method Detail

getInstance

public abstract Object getInstance()
Get the instance itself.
Returns:
the instance or null if the instance cannot be created

getType

public abstract Class getType()
Get the implementing class of the instance.
Returns:
the class of the item

getId

public abstract String getId()
Get a persistent indentifier for the item. This identifier should uniquely represent the item within its containing lookup (and if possible within the global lookup as a whole). For example, it might represent the source of the instance as a file name. The ID may be persisted and in a later session used to find the same instance as was encountered earlier, by means of passing it into a lookup template.
Returns:
a string ID of the item

getDisplayName

public abstract String getDisplayName()
Get a human presentable name for the item. This might be used when summarizing all the items found in a lookup result in some part of a GUI.
Returns:
the string suitable for presenting the object to a user

toString

public String toString()
Overrides:
toString in class Object


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.