RSE
Release 1.0

org.eclipse.rse.ui.view
Class SystemSelectRemoteObjectAPIProviderImpl

java.lang.Object
  extended byorg.eclipse.rse.ui.view.SystemAbstractAPIProvider
      extended byorg.eclipse.rse.ui.view.SystemSelectRemoteObjectAPIProviderImpl
All Implemented Interfaces:
IAdaptable, ISystemViewInputProvider

public class SystemSelectRemoteObjectAPIProviderImpl
extends SystemAbstractAPIProvider
implements ISystemViewInputProvider

This class is a provider of root nodes to the remote systems tree viewer part.

It is used when the contents are used to allow the user to select a remote system object. The tree will begin with the filter pool references or filter references (depending on the user's preferences setting) of the given subsystem.

Alternatively, a filter string can be given and the contents will be the result of resolving that filter string.


Field Summary
protected  ISystemSelectRemoteObjectAPIProviderCaller caller
           
protected  org.eclipse.rse.internal.model.SystemNewConnectionPromptObject connPrompt
           
protected  Object[] connPromptAsArray
           
protected  String filterString
           
protected  String filterSuffix
           
protected  IHost[] inputConnections
           
protected  boolean listConnectionsMode
           
protected  boolean multiConnections
           
protected  String preSelectFilterChild
           
protected  Object preSelectFilterChildObject
           
protected  ISystemFilter[] quickFilters
           
protected  boolean showNewConnectionPrompt
           
protected  boolean singleConnectionMode
           
protected  ISubSystem subsystem
           
protected  ISystemViewElementAdapter subsystemAdapter
           
protected  String subsystemFactoryCategory
           
protected  String subsystemFactoryId
           
protected  String[] systemTypes
           
 
Fields inherited from class org.eclipse.rse.ui.view.SystemAbstractAPIProvider
canceledObject, emptyList, errorObject, msgList, nullObject, shell, sr, viewer
 
Constructor Summary
SystemSelectRemoteObjectAPIProviderImpl()
          Constructor when there is no subsystem yet
SystemSelectRemoteObjectAPIProviderImpl(ISubSystem subsystem)
          Constructor when there is a subsystem
SystemSelectRemoteObjectAPIProviderImpl(String factoryId, String factoryCategory, boolean showNewConnectionPrompt, String[] systemTypes)
          Constructor that takes the input needed to drive the list.
 
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 Simply passes the request on to the caller.
 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 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.
protected  ISubSystem[] getSubSystems(IHost selectedConnection)
          Given a connection, return the subsystem(s) appropriate for the given ssfactoryid or category
 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
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 setFilterString(String string)
          Set the filter string to use to resolve the inputs.
 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 setQuickFilters(ISystemFilter[] filters)
          Set the 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 setSubSystem(ISubSystem subsystem)
          Change the input subsystem
 void setSystemConnection(IHost connection, boolean onlyMode)
          Default or Restrict to a specific connection.
 void setSystemTypes(String[] 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 org.eclipse.rse.ui.view.SystemAbstractAPIProvider
checkForNull, getAdapter, getCancelledMessageObject, getFailedMessageObject, getShell, getViewer, setShell, setViewer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.ui.view.ISystemViewInputProvider
getAdapter, getShell, getViewer, setShell, setViewer
 

Field Detail

subsystem

protected ISubSystem subsystem

filterString

protected String filterString

subsystemAdapter

protected ISystemViewElementAdapter subsystemAdapter

listConnectionsMode

protected boolean listConnectionsMode

showNewConnectionPrompt

protected boolean showNewConnectionPrompt

singleConnectionMode

protected boolean singleConnectionMode

subsystemFactoryId

protected String subsystemFactoryId

subsystemFactoryCategory

protected String subsystemFactoryCategory

filterSuffix

protected String filterSuffix

systemTypes

protected String[] systemTypes

preSelectFilterChild

protected String preSelectFilterChild

preSelectFilterChildObject

protected Object preSelectFilterChildObject

quickFilters

protected ISystemFilter[] quickFilters

inputConnections

protected IHost[] inputConnections

connPrompt

protected org.eclipse.rse.internal.model.SystemNewConnectionPromptObject connPrompt

connPromptAsArray

protected Object[] connPromptAsArray

caller

protected ISystemSelectRemoteObjectAPIProviderCaller caller

multiConnections

protected boolean multiConnections
Constructor Detail

SystemSelectRemoteObjectAPIProviderImpl

public SystemSelectRemoteObjectAPIProviderImpl(String factoryId,
                                               String factoryCategory,
                                               boolean showNewConnectionPrompt,
                                               String[] systemTypes)
Constructor that takes the input needed to drive the list. Specifically, we need to know what connections to list, and when a connection is expanded, what subsystems to query for the remote objects.

This can be done by giving one of two possible pieces of information:

You must supply one of these. There is no need to supply both.

Also, it is often desired to restrict what system types the user can create new connections for. While this could be deduced from the first two pieces of information, it is safer to ask the caller to explicitly identify these. If null is passed, then there is no restrictions.

Parameters:
factoryId - The subsystemFactoryId to restrict connections and subsystems to An alternative to factoryCategory. Specify only one, pass null for the other.
factoryCategory - The subsystemFactory category to restrict connections and subsystems to. An alternative to factoryId. Specify only one, pass null for the other.
showNewConnectionPrompt - true if to show "New Connection" prompt, false if not to
systemTypes - Optional list of system types to restrict the "New Connection" wizard to. Pass null for no restrictions

SystemSelectRemoteObjectAPIProviderImpl

public SystemSelectRemoteObjectAPIProviderImpl(ISubSystem subsystem)
Constructor when there is a subsystem

Parameters:
subsystem - The subsystem that will resolve the filter string

SystemSelectRemoteObjectAPIProviderImpl

public SystemSelectRemoteObjectAPIProviderImpl()
Constructor when there is no subsystem yet

See Also:
setSubSystem(ISubSystem)
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(String[] 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:
IRSESystemType

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

setSubSystem

public void setSubSystem(ISubSystem subsystem)
Change the input subsystem


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.


setQuickFilters

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

See Also:
SystemFilterSimple

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.

Specified by:
getSystemViewRoots in interface ISystemViewInputProvider
Returns:
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

Specified by:
hasSystemViewRoots in interface ISystemViewInputProvider
Returns:
true if ISystemViewInputProvider.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.

Specified by:
getConnectionChildren in interface ISystemViewInputProvider
Parameters:
selectedConnection - the connection undergoing expansion
Returns:
the list of objects under the connection

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.

Specified by:
hasConnectionChildren in interface ISystemViewInputProvider
Parameters:
selectedConnection - the connection being shown in the viewer
Returns:
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.

Specified by:
showActionBar in interface ISystemViewInputProvider
Overrides:
showActionBar in class SystemAbstractAPIProvider

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.

Specified by:
showButtonBar in interface ISystemViewInputProvider
Overrides:
showButtonBar in class SystemAbstractAPIProvider

showActions

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

Specified by:
showActions in interface ISystemViewInputProvider
Overrides:
showActions in class SystemAbstractAPIProvider

showingConnections

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

Specified by:
showingConnections in interface ISystemViewInputProvider
Overrides:
showingConnections in class SystemAbstractAPIProvider

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 ssfactoryid or category


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.

Overrides:
getAdapter in class SystemAbstractAPIProvider

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.

Overrides:
getRemoteAdapter in class SystemAbstractAPIProvider

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

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.