Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.view
Class SelectQSYSAndRemoteObjectAPIProvider

java.lang.Object
  extended by SystemAbstractAPIProvider
      extended by com.ibm.etools.iseries.rse.ui.view.SelectQSYSAndRemoteObjectAPIProvider

public class SelectQSYSAndRemoteObjectAPIProvider
extends SystemAbstractAPIProvider

This class is a provider of root nodes to the remote systems tree viewer part, optimized for selecting of iSeries QSYS file system objects and files on remote file systems. It is used in the ISeriesSelectQSYSAndRemoteFileOrFolderForm class.

It allows setting of an object filter string that is used to subset the object list by name and/or type, independent of the libraries. That is, a user might start by seeing a list of libraries on the library list, but when each is expanded the objects returned are subsetted by that object filter.


Field Summary
protected  ISystemSelectRemoteObjectAPIProviderCaller caller
           
protected  SystemNewConnectionPromptObject connPrompt
           
protected  Object[] connPromptAsArray
           
protected  String filterString
           
protected  String filterSuffix
           
protected  ISeriesFieldFilterString fldListFilterString
           
protected  String fldNameFilter
           
protected  IHost[] inputConnections
           
protected  ISystemFilter[] iSeriesQuickFilters
           
protected  boolean listConnectionsMode
           
protected  String mbrNameFilter
           
protected  String[] mbrTypesFilter
           
protected  ISeriesMemberFilterString memberListFilterString
           
protected  boolean multiConnections
           
protected  ISeriesObjectFilterString objectListFilterString
           
protected  String objNameFilter
           
protected  String[] objTypesFilter
           
protected  String preSelectFilterChild
           
protected  Object preSelectFilterChildObject
           
protected  boolean rcdOrFldMode
           
protected  ISystemFilter[] remoteQuickFilters
           
protected  boolean showNewConnectionPrompt
           
protected  boolean showWorkspaceFolder
           
protected  boolean singleConnectionMode
           
protected  SubSystem subsystem
           
protected  ISystemViewElementAdapter subsystemAdapter
           
protected  String[] subsystemFactoryCategories
           
protected  IRSESystemType[] systemTypes
           
 
Constructor Summary
SelectQSYSAndRemoteObjectAPIProvider()
          Constructor.
 
Method Summary
 ISystemFilter createFilterByPrompting(ISystemFilter filterPrompt, Shell shell)
          Prompt the user to create a new filter as a result of the user expanding a promptable transient filter
 String decorateFilterString(Object selectedObject, String inputFilterString)
          Adorn filter string with any relative attributes requested.
 boolean filtersNeedDecoration(Object selectedObject)
          For performance reasons, pre-check to see if filter decoration is even necessary...
protected  ISystemViewElementAdapter getAdapter(Object o)
          Returns the implementation of ISystemViewElement for the given object.
 Object[] getConnectionChildren(IHost selectedConnection)
          This method is called by the connection adapter when the user expands a connection.
protected  Object[] getConnections()
          Return the connections appropriate for our subsystem factory ID or category requirements.
 String getFieldFilterStringUsingNameFilter(String library, String file, String rcdToExpand)
          Return the filter string for resolving children of a record, using pre-supplied field name filtering criteria
 String getMemberFilterStringUsingNameAndTypeFilter(String library, String fileToExpand)
          Return the filter string for resolving children of a file, using pre-supplied member name and type filtering criteria
 String getObjectFilterStringUsingNameAndTypeFilter(String libraryToExpand)
          Return the filter string for resolving children of a library, using pre-supplied object name and type filtering criteria
 String getPreSelectFilterChild()
          Get the name of the item to select when the first filter is expanded.
 Object getPreSelectFilterChildObject()
          Get the actual object of the item to select when the first filter is expanded.
protected  ISystemRemoteElementAdapter getRemoteAdapter(Object o)
          Returns the implementation of ISystemRemoteElement for the given object.
 boolean getShowWorkspaceFolder()
          Returns whether the workspace folder will be shown under Local connections.
protected  ISubSystem[] getSubSystems(IHost selectedConnection)
          Given a connection, return the subsystem(s) appropriate for the given factories.
 Object[] getSystemViewRoots()
          Return the children objects to consistute the root elements in the system view tree.
 boolean hasConnectionChildren(IHost selectedConnection)
          This method is called by the connection adapter when deciding to show a plus-sign or not beside a connection.
 boolean hasSystemViewRoots()
          Return true if getSystemViewRoots() will return a non-empty list
 boolean isRecordAndFieldMode()
          Query if this is a special mode for listing records or fields.
protected  Object[] resolveFilterString(ISubSystem subsystem, String filterString)
          Return the result of asking a given subsystem to resolve a filter string
 void setCaller(ISystemSelectRemoteObjectAPIProviderCaller caller)
          Set the caller to callback to for some events, such as the expansion of a prompting transient filter.
 void setFieldNameFilter(String fldNameFilter)
          Set the name use to filter fields when a record is expanded.
 void setFilterString(String string)
          Set the filter string to use to resolve the inputs.
 void setISeriesQuickFilters(ISystemFilter[] filters)
          Set the iSeries quick filters to be exposed to the user.
 void setMemberNameAndTypeFilter(String mbrNameFilter, String[] mbrTypesFilter)
          Set the name and type to use to filter members when a file is expanded.
 void setObjectNameAndTypeFilter(String objNameFilter, String[] objTypesFilter)
          Set the name and type to use to filter objects when a library is expanded.
 void setPreSelectFilterChild(String name)
          Set child of the first filter to preselect
 void setPreSelectFilterChildObject(Object obj)
          Set actual child object of the first filter to preselect.
 void setRecordAndFieldMode(boolean set)
          Specify this is a special mode for listing records or fields.
 void setRemoteQuickFilters(ISystemFilter[] filters)
          Set the iSeries quick filters to be exposed to the user.
 void setShowNewConnectionPrompt(boolean show)
          Specify whether the user should see the "New Connection..." special connection prompt
 void setShowWorkspaceFolder(boolean showWorkspaceFolder)
          Show the workspace folder under Local connections, or not.
 void setSystemConnection(IHost connection, boolean onlyMode)
          Default or Restrict to a specific connection.
 void setSystemTypes(IRSESystemType[] systemTypes)
          Specify system types to restrict what types of connections the user can create, and see.
 boolean showActionBar()
          Return true to show the action bar (ie, toolbar) above the viewer.
 boolean showActions()
          Return true to show right-click popup actions on objects in the tree.
 boolean showButtonBar()
          Return true to show the button bar above the viewer.
 boolean showingConnections()
          Return true if we are listing connections or not, so we know whether we are interested in connection-add events
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subsystem

protected SubSystem subsystem

filterString

protected String filterString

subsystemAdapter

protected ISystemViewElementAdapter subsystemAdapter

listConnectionsMode

protected boolean listConnectionsMode

showNewConnectionPrompt

protected boolean showNewConnectionPrompt

singleConnectionMode

protected boolean singleConnectionMode

subsystemFactoryCategories

protected String[] subsystemFactoryCategories

filterSuffix

protected String filterSuffix

systemTypes

protected IRSESystemType[] systemTypes

preSelectFilterChild

protected String preSelectFilterChild

preSelectFilterChildObject

protected Object preSelectFilterChildObject

iSeriesQuickFilters

protected ISystemFilter[] iSeriesQuickFilters

remoteQuickFilters

protected ISystemFilter[] remoteQuickFilters

inputConnections

protected IHost[] inputConnections

connPrompt

protected SystemNewConnectionPromptObject connPrompt

connPromptAsArray

protected Object[] connPromptAsArray

caller

protected ISystemSelectRemoteObjectAPIProviderCaller caller

multiConnections

protected boolean multiConnections

objectListFilterString

protected ISeriesObjectFilterString objectListFilterString

objNameFilter

protected String objNameFilter

objTypesFilter

protected String[] objTypesFilter

memberListFilterString

protected ISeriesMemberFilterString memberListFilterString

mbrNameFilter

protected String mbrNameFilter

mbrTypesFilter

protected String[] mbrTypesFilter

fldListFilterString

protected ISeriesFieldFilterString fldListFilterString

fldNameFilter

protected String fldNameFilter

rcdOrFldMode

protected boolean rcdOrFldMode

showWorkspaceFolder

protected boolean showWorkspaceFolder
Constructor Detail

SelectQSYSAndRemoteObjectAPIProvider

public SelectQSYSAndRemoteObjectAPIProvider()
Constructor.

Method Detail

setCaller

public void setCaller(ISystemSelectRemoteObjectAPIProviderCaller caller)
Set the caller to callback to for some events, such as the expansion of a prompting transient filter.


setShowNewConnectionPrompt

public void setShowNewConnectionPrompt(boolean show)
Specify whether the user should see the "New Connection..." special connection prompt


setSystemTypes

public void setSystemTypes(IRSESystemType[] systemTypes)
Specify system types to restrict what types of connections the user can create, and see. This will override subsystemFactoryId,if that has been set!

See Also:
com.ibm.etools.systems.core.ISystemTypes

setSystemConnection

public void setSystemConnection(IHost connection,
                                boolean onlyMode)
Default or Restrict to a specific connection. If default mode, it is preselected. If only mode, it is the only connection listed.

Parameters:
connection - The connection to default or restrict to
onlyMode - true if this is to be the only connection shown in the list

setFilterString

public void setFilterString(String string)
Set the filter string to use to resolve the inputs. If this is an absolute filter string, it gets turned into a quick filter string, so that the user sees it and can expand it. If it is a relative filter string to apply to all expansions, it is used to decorate all filtering as the user drills down.


setISeriesQuickFilters

public void setISeriesQuickFilters(ISystemFilter[] filters)
Set the iSeries quick filters to be exposed to the user. These will be shown to the user when they expand a connection.

See Also:
com.ibm.etools.systems.filters.impl.SystemFilterSimpleImpl

setRemoteQuickFilters

public void setRemoteQuickFilters(ISystemFilter[] filters)
Set the iSeries quick filters to be exposed to the user. These will be shown to the user when they expand a connection.

See Also:
com.ibm.etools.systems.filters.impl.SystemFilterSimpleImpl

setPreSelectFilterChild

public void setPreSelectFilterChild(String name)
Set child of the first filter to preselect


getPreSelectFilterChild

public String getPreSelectFilterChild()
Get the name of the item to select when the first filter is expanded. Called by the filter adapter.


setPreSelectFilterChildObject

public void setPreSelectFilterChildObject(Object obj)
Set actual child object of the first filter to preselect. Called by the filter adapter once the children are resolved and a match on the name is found.


getPreSelectFilterChildObject

public Object getPreSelectFilterChildObject()
Get the actual object of the item to select when the first filter is expanded. Called by the GUI form after expansion, so it can select this object


decorateFilterString

public String decorateFilterString(Object selectedObject,
                                   String inputFilterString)
Adorn filter string with any relative attributes requested. Eg "/nf" for folders only


filtersNeedDecoration

public boolean filtersNeedDecoration(Object selectedObject)
For performance reasons, pre-check to see if filter decoration is even necessary...


getSystemViewRoots

public Object[] getSystemViewRoots()
Return the children objects to consistute the root elements in the system view tree.


hasSystemViewRoots

public boolean hasSystemViewRoots()
Return true if getSystemViewRoots() will return a non-empty list


getConnectionChildren

public Object[] getConnectionChildren(IHost selectedConnection)
This method is called by the connection adapter when the user expands a connection. This method must return the child objects to show for that connection.


setShowWorkspaceFolder

public void setShowWorkspaceFolder(boolean showWorkspaceFolder)
Show the workspace folder under Local connections, or not.

Parameters:
showWorkspaceFolder - true to show the workspace folder, false to not show it.

getShowWorkspaceFolder

public boolean getShowWorkspaceFolder()
Returns whether the workspace folder will be shown under Local connections.

Returns:
true if the option to show the workspace folder is on, false otherwise.

hasConnectionChildren

public boolean hasConnectionChildren(IHost selectedConnection)
This method is called by the connection adapter when deciding to show a plus-sign or not beside a connection. Return true if this connection has children to be shown.


showActionBar

public boolean showActionBar()
Return true to show the action bar (ie, toolbar) above the viewer. The action bar contains connection actions, predominantly. We return false.


showButtonBar

public boolean showButtonBar()
Return true to show the button bar above the viewer. The tool bar contains "Get List" and "Refresh" buttons and is typically shown in dialogs that list only remote system objects. We return false.


showActions

public boolean showActions()
Return true to show right-click popup actions on objects in the tree. We return true.


showingConnections

public boolean showingConnections()
Return true if we are listing connections or not, so we know whether we are interested in connection-add events


getConnections

protected Object[] getConnections()
Return the connections appropriate for our subsystem factory ID or category requirements.


getSubSystems

protected ISubSystem[] getSubSystems(IHost selectedConnection)
Given a connection, return the subsystem(s) appropriate for the given factories.


resolveFilterString

protected Object[] resolveFilterString(ISubSystem subsystem,
                                       String filterString)
Return the result of asking a given subsystem to resolve a filter string


getAdapter

protected ISystemViewElementAdapter getAdapter(Object o)
Returns the implementation of ISystemViewElement for the given object. Returns null if the adapter is not defined or the object is not adaptable.


getRemoteAdapter

protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
Returns the implementation of ISystemRemoteElement for the given object. Returns null if this object does not adaptable to this.


createFilterByPrompting

public ISystemFilter createFilterByPrompting(ISystemFilter filterPrompt,
                                             Shell shell)
                                      throws Exception
Prompt the user to create a new filter as a result of the user expanding a promptable transient filter

Simply passes the request on to the caller.

NOT SUPPORTED YET!

Returns:
the filter created by the user or null if they cancelled the prompting
Throws:
Exception

setRecordAndFieldMode

public void setRecordAndFieldMode(boolean set)
Specify this is a special mode for listing records or fields. In this mode, when *FILE objects are expanded, records are listed instead of members. Once a record is available it can be expanded to fields.


isRecordAndFieldMode

public boolean isRecordAndFieldMode()
Query if this is a special mode for listing records or fields. In this mode, when *FILE objects are expanded, records are listed instead of members. Once a record is available it can be expanded to fields.


setObjectNameAndTypeFilter

public void setObjectNameAndTypeFilter(String objNameFilter,
                                       String[] objTypesFilter)
Set the name and type to use to filter objects when a library is expanded. Either can be null to mean "all". Each object type filter is of the form "type:attr".


setMemberNameAndTypeFilter

public void setMemberNameAndTypeFilter(String mbrNameFilter,
                                       String[] mbrTypesFilter)
Set the name and type to use to filter members when a file is expanded. Either can be null to mean "all".


setFieldNameFilter

public void setFieldNameFilter(String fldNameFilter)
Set the name use to filter fields when a record is expanded. Can be null to mean "all".


getObjectFilterStringUsingNameAndTypeFilter

public String getObjectFilterStringUsingNameAndTypeFilter(String libraryToExpand)
Return the filter string for resolving children of a library, using pre-supplied object name and type filtering criteria


getMemberFilterStringUsingNameAndTypeFilter

public String getMemberFilterStringUsingNameAndTypeFilter(String library,
                                                          String fileToExpand)
Return the filter string for resolving children of a file, using pre-supplied member name and type filtering criteria


getFieldFilterStringUsingNameFilter

public String getFieldFilterStringUsingNameFilter(String library,
                                                  String file,
                                                  String rcdToExpand)
Return the filter string for resolving children of a record, using pre-supplied field name filtering criteria


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.