RSE
Release 1.0

org.eclipse.rse.ui.view
Class SystemAbstractAPIProvider

java.lang.Object
  extended byorg.eclipse.rse.ui.view.SystemAbstractAPIProvider
All Implemented Interfaces:
IAdaptable, ISystemViewInputProvider
Direct Known Subclasses:
SystemEmptyListAPIProviderImpl, SystemResourceSelectionInputProvider, SystemSelectRemoteObjectAPIProviderImpl, SystemTestFilterStringAPIProviderImpl, SystemViewAPIProviderForConnections, SystemViewAPIProviderForFilterPools, SystemViewAPIProviderForFilters, SystemViewAPIProviderForFilterStrings, SystemViewAPIProviderForSubSystems, SystemViewConnectionSelectionInputProvider

public abstract class SystemAbstractAPIProvider
extends Object
implements ISystemViewInputProvider

This is a base class that a provider of root nodes to the remote systems tree viewer part can use as a parent class.


Field Summary
protected  SystemMessageObject canceledObject
           
protected  Object[] emptyList
           
protected  SystemMessageObject errorObject
           
protected  Object[] msgList
           
protected  SystemMessageObject nullObject
           
protected  Shell shell
           
protected  ISystemRegistry sr
           
protected  Viewer viewer
           
 
Constructor Summary
SystemAbstractAPIProvider()
          Constructor
 
Method Summary
protected  Object[] checkForNull(Object[] children, boolean returnNullMsg)
          In getChildren, return checkForNull(children, true/false) vs your array directly.
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
protected  ISystemViewElementAdapter getAdapter(Object o)
          Returns the implementation of ISystemViewElement for the given object.
protected  Object[] getCancelledMessageObject()
          Return the "Operation cancelled by user" msg as an object array so can be used to answer getChildren()
protected  Object[] getFailedMessageObject()
          Return the "Operation failed" msg as an object array so can be used to answer getChildren()
protected  ISystemRemoteElementAdapter getRemoteAdapter(Object o)
          Returns the implementation of ISystemRemoteElement for the given object.
 Shell getShell()
          Return the shell of the current viewer
 Viewer getViewer()
          Return the viewer we are currently associated with
 void setShell(Shell shell)
          Set the shell in case it is needed for anything.
 void setViewer(Viewer viewer)
          Set the viewer in case it is needed for anything.
 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
 
Methods inherited from interface org.eclipse.rse.ui.view.ISystemViewInputProvider
getConnectionChildren, getSystemViewRoots, hasConnectionChildren, hasSystemViewRoots
 

Field Detail

shell

protected Shell shell

viewer

protected Viewer viewer

sr

protected ISystemRegistry sr

emptyList

protected Object[] emptyList

msgList

protected Object[] msgList

nullObject

protected SystemMessageObject nullObject

canceledObject

protected SystemMessageObject canceledObject

errorObject

protected SystemMessageObject errorObject
Constructor Detail

SystemAbstractAPIProvider

public SystemAbstractAPIProvider()
Constructor

Method Detail

getAdapter

public Object getAdapter(Class adapterType)
This is the method required by the IAdaptable interface. Given an adapter class type, return an object castable to the type, or null if this is not possible.

Specified by:
getAdapter in interface ISystemViewInputProvider

setShell

public void setShell(Shell shell)
Set the shell in case it is needed for anything. The label and content provider will call this.

Specified by:
setShell in interface ISystemViewInputProvider
Parameters:
shell - the shell being used by the viewer using this provider

getShell

public Shell getShell()
Return the shell of the current viewer

Specified by:
getShell in interface ISystemViewInputProvider
Returns:
the shell of the viewer we are currently associated with

setViewer

public void setViewer(Viewer viewer)
Set the viewer in case it is needed for anything. The label and content provider will call this.

Specified by:
setViewer in interface ISystemViewInputProvider
Parameters:
viewer - the viewer that uses this provider

getViewer

public Viewer getViewer()
Return the viewer we are currently associated with

Specified by:
getViewer in interface ISystemViewInputProvider
Returns:
the viewer we are currently associated with

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
Returns:
true to show the action bar (ie, toolbar) above the viewer. The action bar contains connection actions, predominantly.

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
Returns:
true to show the button bar above the viewer. The tool bar contains "Get List" and "Refresh" buttons and is typicall shown in dialogs that list only remote system objects.

showActions

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

Specified by:
showActions in interface ISystemViewInputProvider
Returns:
true to show right-click popup actions on objects in the tree.

checkForNull

protected Object[] checkForNull(Object[] children,
                                boolean returnNullMsg)
In getChildren, return checkForNull(children, true/false) vs your array directly. This method checks for a null array which not allow and replaces it with an empty array. If true is passed then it returns the "Empty list" message object if the array is null or empty


getCancelledMessageObject

protected Object[] getCancelledMessageObject()
Return the "Operation cancelled by user" msg as an object array so can be used to answer getChildren()


getFailedMessageObject

protected Object[] getFailedMessageObject()
Return the "Operation failed" msg as an object array so can be used to answer getChildren()


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
Returns:
true if we are listing connections or not, so we know whether we are interested in connection-add events

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.


RSE
Release 1.0

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