All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.as400.vaccess.VObject

public interface VObject
The VObject interface defines the representation of an AS/400 resource for use in various models and panes in this package.

An object has any number of properties. These are attributes of the object itself and are identified by property identifiers. Every object has at least name and desctiption properties, and most will define more.

Many of these methods are not called directly by programs. Instead, they are called by the AS/400 panes to respond to the user interface as needed.

Most errors are reported as ErrorEvents rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.

VObject objects generate the following events:

An implementation of this interface should pass on all events fired by its actions and properties pane to its listeners.


Variable Index

 o DESCRIPTION_PROPERTY
Property identifier for the description.
 o NAME_PROPERTY
Property identifier for the name.

Method Index

 o addErrorListener(ErrorListener)
Adds a listener to be notified when an error occurs.
 o addVObjectListener(VObjectListener)
Adds a listener to be notified when a VObject is changed, created, or deleted.
 o addWorkingListener(WorkingListener)
Adds a listener to be notified when work starts and stops on potentially long-running operations.
 o getActions()
Returns the list of actions that can be performed.
 o getDefaultAction()
Returns the default action.
 o getIcon(int, boolean)
Returns the icon.
 o getPropertiesPane()
Returns the properties pane.
 o getPropertyValue(Object)
Returns a property value.
 o getText()
Returns the descriptive text associated with this object.
 o load()
Loads information about the object from the AS/400.
 o removeErrorListener(ErrorListener)
Removes an error listener.
 o removeVObjectListener(VObjectListener)
Removes a VObjectListener.
 o removeWorkingListener(WorkingListener)
Removes a working listener.

Variables

 o NAME_PROPERTY
 public static final Object NAME_PROPERTY
Property identifier for the name.

 o DESCRIPTION_PROPERTY
 public static final Object DESCRIPTION_PROPERTY
Property identifier for the description.

Methods

 o addErrorListener
 public abstract void addErrorListener(ErrorListener listener)
Adds a listener to be notified when an error occurs.

Parameters:
listener - The listener.
 o addVObjectListener
 public abstract void addVObjectListener(VObjectListener listener)
Adds a listener to be notified when a VObject is changed, created, or deleted.

Parameters:
listener - The listener.
 o addWorkingListener
 public abstract void addWorkingListener(WorkingListener listener)
Adds a listener to be notified when work starts and stops on potentially long-running operations.

Parameters:
listener - The listener.
 o getActions
 public abstract VAction[] getActions()
Returns the list of actions that can be performed. This is called when the user brings up a popup menu on this VObject. The popup menu will contain a menu item for each returned VAction.

Returns:
The actions, or null if there are no actions.
 o getDefaultAction
 public abstract VAction getDefaultAction()
Returns the default action. This is called when the user double-clicks on this VObject. The returned action will then be performed.

Returns:
The default action, or null if there is no default action.
 o getIcon
 public abstract Icon getIcon(int size,
                              boolean open)
Returns the icon. This is called to determine which icon to show with this VObject.

Parameters:
size - The icon size, either 16 or 32. If any other value is given, then return a default.
open - true for the open icon; false for the closed icon. If there is only one icon, then this parameter has no effect.
Returns:
The icon, or null if there is none.
 o getPropertiesPane
 public abstract VPropertiesPane getPropertiesPane()
Returns the properties pane. This is called when the user selects the "Properties" menu item on this VObject's popup menu. The return VPropertiesPane object will be presented as a properties dialog.

Returns:
The properties pane, or null if there is none.
 o getPropertyValue
 public abstract Object getPropertyValue(Object propertyIdentifier)
Returns a property value. This is called in order to fill the contents of cells in an AS400DetailsPane or AS400DetailsModel object.

An implementation of this interface should describe the properties that it supports. At minimum, it should support the following property identifiers:
Property Return value
NAME_PROPERTY Returns the VObject itself ("this"). This will be rendered using an icon and a name.
DESCRIPTION_PROPERTY Returns a text description of the VObject.

Parameters:
propertyIdentifier - The property identifier.
Returns:
The property value, or null if the property identifier is not recognized.
 o getText
 public abstract String getText()
Returns the descriptive text associated with this object. This is called when rendering the VObject in a user interface.

Returns:
The descriptive text associated with this object.
 o load
 public abstract void load()
Loads information about the object from the AS/400.

 o removeErrorListener
 public abstract void removeErrorListener(ErrorListener listener)
Removes an error listener.

Parameters:
listener - The listener.
 o removeVObjectListener
 public abstract void removeVObjectListener(VObjectListener listener)
Removes a VObjectListener.

Parameters:
listener - The listener.
 o removeWorkingListener
 public abstract void removeWorkingListener(WorkingListener listener)
Removes a working listener.

Parameters:
listener - The listener.

All Packages  Class Hierarchy  This Package  Previous  Next  Index