com.ibm.as400.opnav
Class NativeListManager

java.lang.Object
  |
  +--com.ibm.as400.opnav.NativeListManager

public class NativeListManager
extends java.lang.Object
implements ListManager, WindowsListManager, SortingListManager, PublicObjectListManager, FilteringListManager

A class which interfaces with an existing Windows native dll that manages this list.

Since:
v5r1m0
See Also:
ListManager, WindowsListManager, SortingListManager

Fields inherited from interface com.ibm.as400.opnav.ListManager
LIST_CLOSED, LIST_COMPLETE, LIST_ERROR, LIST_INCOMPLETE, OBJECT_HASPROPERTIES, OBJECT_HASSUBCONTAINERS, OBJECT_IMPLEMENTSPROPERTIES, OBJECT_ISCONTAINER, OBJECT_ISDROPTARGET, OBJECT_ISGUICONTAINER, OBJECT_ISTREELIST, OBJECT_OPENEXPANDED, OBJECT_SELECTED, SINGLE_SELECTION
 
Fields inherited from interface com.ibm.as400.opnav.WindowsListManager
DEFAULT_ICON, OPEN_ICON
 
Fields inherited from interface com.ibm.as400.opnav.SortingListManager
SORT_ASCENDING, SORT_DESCENDING
 
Constructor Summary
NativeListManager(java.lang.String classID)
          Constructs a NativeListManager class which wrappers an OLE IA4HierarchyFolder interface.
 
Method Summary
 void close()
          Frees all list resources.
 int getAttributes(ItemIdentifier item)
          Returns the attributes of a list object.
 java.lang.String getColumnData(ItemIdentifier item, int columnID)
          Returns the data for a list column.
 ColumnDescriptor[] getColumnInfo()
          Returns the column headings for this list.
 java.lang.String getErrorMessage()
          Returns an error message.
 java.lang.String getFilterDescription()
          Returns a text description of the current include criteria.
 int getIconIndex(ItemIdentifier item, int flags)
          Returns the icon index into the plug-in's resource DLL for a list object.
 java.lang.String getImageFile(ItemIdentifier item, int flags)
          Returns the image file name for a list object.
 int getItemCount()
          Returns the total count of objects in the list.
 java.lang.Object getListObject(ObjectName objName)
          Returns a cached list object.
 java.lang.Object getPublicListObject(ObjectName objName)
          Returns a public cached list object.
 ColumnDescriptor[] getSortingColumnInfo()
          Indicates whether multiple sorting is enabled for a list, and which columns it is enabled on.
 int getStatus()
          Returns the current status of the list.
 WindowsToolBarInfo getWindowsToolBarInfo(ObjectName selectedItem)
          Returns the toolbar information for a container in the Operations Navigator hierarchy.
 void initialize(ObjectName container)
          Identifies the container to be enumerated.
 boolean isSortingEnabled()
          Indicates whether sorting is enabled for a list.
 ItemIdentifier itemAt(int index)
          Returns the item identifier for a list object.
 void open()
          Prepares the list for enumeration.
 void prepareToExit()
          Provides notification that the application is terminating.
 boolean sortOnColumn(int columnID, int sortOrder)
          Sorts the list on the specified table column in a view of system objects.
 boolean sortOnColumns(ColumnDescriptor[] cd)
          Sorts the lists on the specified table column in a view of system objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeListManager

public NativeListManager(java.lang.String classID)
Constructs a NativeListManager class which wrappers an OLE IA4HierarchyFolder interface. The Window's class ID must be passed to the constructor. The interface may require changes to work correcty from it's new location in the hierarchy.
Parameters:
classID - The OLE Class ID (CLSID) of the class to be loaded.
Since:
v5r1m0
Method Detail

initialize

public void initialize(ObjectName container)
Identifies the container to be enumerated. This method is called immediately after this object is instantiated.
Specified by:
initialize in interface ListManager
Parameters:
container - The container whose contents the user wishes to display.
Since:
v5r1m0
See Also:
ObjectName

open

public void open()
Prepares the list for enumeration. This method is called when the user initially selects a container. Once it has been called, getStatus should return a value other than LIST_CLOSED.

open is called on a data thread so that long running operations will not degrade the performance of the user interface.

Specified by:
open in interface ListManager
Since:
v5r1m0

getStatus

public int getStatus()
Returns the current status of the list. This method is called after the list has been opened to learn whether the open attempt was successful.
Specified by:
getStatus in interface ListManager
Returns:
a status constant which reflects the current list status.
Since:
v5r1m0

getErrorMessage

public java.lang.String getErrorMessage()
Returns an error message. This method is called after getStatus has returned a value of LIST_ERROR. The returned message should be in a form suitable for displaying to the user.
Specified by:
getErrorMessage in interface ListManager
Returns:
null if no error message is available.
Since:
v5r1m0

getItemCount

public int getItemCount()
Returns the total count of objects in the list.

This method is called after the list has been successfully opened. If getStatus returned a value of LIST_COMPLETE, this method should return the total number of objects in the list. If getStatus returned LIST_INCOMPLETE, this method should return the number of objects currently known to be in the list.

Specified by:
getItemCount in interface ListManager
Returns:
the number of objects in the list.
Since:
v5r1m0

itemAt

public ItemIdentifier itemAt(int index)
Returns the item identifier for a list object.

This method is called repeatedly when populating the view of a container. Long running operations should be avoided.

Specified by:
itemAt in interface ListManager
Parameters:
index - the zero-based index of the item for which an item identifier is requested.
Returns:
the item identifier that describes the object at the specified position in the list.
Since:
v5r1m0
See Also:
ItemIdentifier

getAttributes

public int getAttributes(ItemIdentifier item)
Returns the attributes of a list object.

This method is called repeatedly when populating the view of a container. Long running operations should be avoided.

Specified by:
getAttributes in interface ListManager
Parameters:
item - the item identifier for the object whose attributes are to be retrieved.
Returns:
the integer sum of the attribute constants.
Since:
v5r1m0
See Also:
ItemIdentifier

getImageFile

public java.lang.String getImageFile(ItemIdentifier item,
                                     int flags)
Returns the image file name for a list object.

This method is called repeatedly when populating the view of a container. Long running operations should be avoided.

Specified by:
getImageFile in interface ListManager
Parameters:
item - the item identifier for the object whose image file name is to be retrieved.
flags - the constants which reflect the status of the object.
Returns:
the name of the image file containing the icon for the object.
Since:
v5r1m0
See Also:
ItemIdentifier

getColumnInfo

public ColumnDescriptor[] getColumnInfo()
Returns the column headings for this list. This method is called after the list has been successfully opened.
Specified by:
getColumnInfo in interface ListManager
Returns:
an array of ColumnDescriptor objects that describe the column headings for this list.
Since:
v5r1m0
See Also:
ColumnDescriptor

getColumnData

public java.lang.String getColumnData(ItemIdentifier item,
                                      int columnID)
Returns the data for a list column.

This method is called repeatedly when populating the view of a container. Long running operations should be avoided.

Specified by:
getColumnData in interface ListManager
Parameters:
item - the item identifier for the object whose column data is to be retrieved.
columnID - the numeric ID that identifies the column.
Returns:
the data for the specified column converted to a String.
Since:
v5r1m0
See Also:
ItemIdentifier

getListObject

public java.lang.Object getListObject(ObjectName objName)
Returns a cached list object. This method is called when another interface implementation requires access to the proxy object that represents a resource on the system being managed.
Specified by:
getListObject in interface ListManager
Parameters:
objName - the name of the object for which a proxy will be retrieved.
Returns:
the cached proxy object.
Since:
v5r1m0

close

public void close()
Frees all list resources. This method is called when the user closes a view of a container, or when a refresh of the container's contents is requested. Once it has been called, getStatus should return a value of LIST_CLOSED.
Specified by:
close in interface ListManager
Since:
v5r1m0
See Also:
ObjectName

prepareToExit

public void prepareToExit()
Provides notification that the application is terminating. This method is called when the user closes the application. It provides the implementation with the opportunity to clean up any connection handles and save any persistent data.
Specified by:
prepareToExit in interface ListManager
Since:
v5r1m0

getIconIndex

public int getIconIndex(ItemIdentifier item,
                        int flags)
Returns the icon index into the plug-in's resource DLL for a list object.

Called repeatedly when populating the view of a container. Long running operations should be avoided.

Specified by:
getIconIndex in interface WindowsListManager
Parameters:
item - The item identifier for the object whose icon index is to be retrieved.
flags - A constant which indicates the type of icon requested.
Returns:
The index into the plug-in's resource DLL of the icon for the object.
Since:
v5r1m0
See Also:
ItemIdentifier

getWindowsToolBarInfo

public WindowsToolBarInfo getWindowsToolBarInfo(ObjectName selectedItem)
Returns the toolbar information for a container in the Operations Navigator hierarchy. The toolbar information includes the resource ID of the toolbar bitmap, and an array of TBButtonDescriptors which contain the control information associated with each toolbar button.
Specified by:
getWindowsToolBarInfo in interface WindowsListManager
Returns:
an instance of WindowsToolBarInfo.
Since:
v5r1m0
See Also:
WindowsToolBarInfo

isSortingEnabled

public boolean isSortingEnabled()
Indicates whether sorting is enabled for a list. This method is called when the user initially selects a container of system objects to determine whether the user interface should enable sorting. It lets ListManager implementations delegate to other ListManagers which may or may not support sorting.
Specified by:
isSortingEnabled in interface SortingListManager
Returns:
true if the list can be sorted; false otherwise.
Since:
v5r1m0

sortOnColumn

public boolean sortOnColumn(int columnID,
                            int sortOrder)
Sorts the list on the specified table column in a view of system objects. This method is called when the user has requested a sort of the list items on a given table column. The SortingListManager implementation should update its state information indicating the order in which items are to be sorted. On return from this method, the user interface will immediately refresh the list by calling ListManager.close followed by ListManager.open.
Specified by:
sortOnColumn in interface SortingListManager
Parameters:
columnID - the numeric ID identifying the column to sort on, as specified in the column descriptor.
sortOrder - SORT_ASCENDING if the list is to be sorted in ascending order; SORT_DESCENDING if the list is to be sorted in descending order.
Returns:
true if sorting on the specified column is supported; false otherwise.
See Also:
ListManager, ListManager.getColumnInfo()

getPublicListObject

public java.lang.Object getPublicListObject(ObjectName objName)
Returns a public cached list object. This method is called when another interface implementation requires access to the public object that represents a resource on the system being managed.
Specified by:
getPublicListObject in interface PublicObjectListManager
Parameters:
objName - the name of the object for which a public object reference will be retrieved.
Returns:
the cached public object.
Since:
v5r1m0

getFilterDescription

public java.lang.String getFilterDescription()
Returns a text description of the current include criteria. This method is called when the user interface needs to provide an indication that the list has been filtered. The returned string should describe the include criteria currently in effect, and should be in a form suitable for displaying to the user.
Specified by:
getFilterDescription in interface FilteringListManager
Returns:
the text description of the current include criteria.
Since:
v5r1m0

getSortingColumnInfo

public ColumnDescriptor[] getSortingColumnInfo()
Description copied from interface: SortingListManager
Indicates whether multiple sorting is enabled for a list, and which columns it is enabled on. This method is called when the user initially selects a container of system objects to determine whether the user interface should enable multiple sorting. Return an array including all of the columns that support multiple sorting. If there are none, return an empty array. NOTE: This is currently supported only in the Java Consloe.
Specified by:
getSortingColumnInfo in interface SortingListManager
Tags copied from interface: SortingListManager
Returns:
an array of ColumnDescriptor objects

sortOnColumns

public boolean sortOnColumns(ColumnDescriptor[] cd)
Description copied from interface: SortingListManager
Sorts the lists on the specified table column in a view of system objects. This method is called when the user has requested a sort of the list items on a given table column. The SortingListManager implementation should update its state information indicating the order in which columns are to be sorted. On return from this method, the user interface will immediately refresh the list by calling ListManager.close followed by ListManager.open. It is assumed that the columns will be sorted in ascending order. NOTE: This is currently supported only in the Java Consloe.
Specified by:
sortOnColumns in interface SortingListManager
Tags copied from interface: SortingListManager
Parameters:
columns - The array of the ColumnDescriptors of the columns you want sorted.
Returns:
true if sorting on the specified columns is supported; false otherwise.
See Also:
ListManager, ListManager.getColumnInfo()