Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.actions.select
Class IBMiSelectAbstractQSYSAndRemoteFileOrFolderAction

java.lang.Object
  extended by SystemBaseDialogAction
      extended by com.ibm.etools.iseries.rse.ui.actions.select.IBMiSelectAbstractQSYSAndRemoteFileOrFolderAction
Direct Known Subclasses:
QSYSSelectMemberAndRemoteFileAction

public abstract class IBMiSelectAbstractQSYSAndRemoteFileOrFolderAction
extends SystemBaseDialogAction

The base class for all iSeries selection actions for libraries, objects, members, records and fields, and files and folders from remote files. Handles all common methods

To configure the dialog, call these input methods:

To override the default prompt labels and tooltip text, call these input methods:

After running, call these methods to get the output:


Field Summary
protected  boolean addButton
           
protected  IRemoteSelectionAddListener addButtonCallback
           
protected  Vector addFilterStrings
           
protected  String addLabel
           
protected  String addToolTipText
           
protected  int autoExpandDepth
           
static String copyright
           
protected  IHost defaultConnection
           
protected  QSYSSelectQSYSAndRemoteFileOrFolderDialog dlg
           
protected static Object[] EMPTY_OBJECT_ARRAY
           
protected static String[] EMPTY_STRING_ARRAY
           
protected  boolean fileMode
           
protected  boolean multipleSelectionMode
           
protected  String[] objTypes
           
protected  IHost onlyConnection
           
protected  IHost outputConnection
           
protected  String preSelectLibraryName
           
protected  String preSelectObjectName
           
protected  String rootLibraryName
           
protected  int selectionType
           
protected  boolean showLiblFilter
           
protected  boolean showNewConnectionPrompt
           
protected  boolean showPropertySheet
           
protected  boolean showPropertySheetDetailsButton
           
protected  boolean showPropertySheetDetailsButtonInitialState
           
protected  boolean showYourLibrariesPrompt
           
protected  String title
           
protected  String treeTip
           
protected  String verbage
           
 
Constructor Summary
IBMiSelectAbstractQSYSAndRemoteFileOrFolderAction(Shell shell, String label, String tooltip, int selectionType, boolean fileMode)
          Base constructor used by child classes, to supply their own action label.
 
Method Summary
 void addFilter(String filterString)
          Add a filter that users can expand to start their search.
 void addLibraryFilter(String libraryFilter)
          Add a library filter to the initial list shown when a connection is expanded The library name can be simple or generic.
protected  Dialog createDialog(Shell shell)
          If you decide to use the supplied run method as is, then you must override this method to create and return the dialog that is displayed by the default run method implementation.
protected  void enableAddMode(boolean enable)
          Child class method to tell us that add mode has been enabled.
 void enableAddMode(IRemoteSelectionAddListener caller)
          Enable Add mode.
protected  Object getDialogValue(Dialog dlg)
          Required by parent.
protected  SubSystem getFileSubSystem(IHost connection)
          Get the file subsystem given a connection
protected  QSYSSelectQSYSAndRemoteFileOrFolderDialog getSelectDialog(Shell shell)
          This is the overridable point for the dialog.
 Object getSelected()
          Return selected ISeriesXXX object
 IHost getSelectedConnection()
          Return selected connection
 Object[] getSelectedObjects()
          Return all selected objects.
 void reset()
          Reset all attributes to initial values.
 void setAddModeLabel(String addLabel, String addToolTipText)
          Set the Add button label and tooltip text.
 void setAutoExpandDepth(int depth)
          Specify the zero-based auto-expand level for the tree.
 void setDefaultConnection(IHost conn)
          Set the connection to pre-select and expand
 void setDialogTitle(String title)
          Set the dialog title.
 void setMessage(String message)
          Set the message shown at the top.
 void setMultipleSelectionMode(boolean multiple)
          Set multiple selection mode.
 void setObjectTypes(String[] objTypes)
          Set the object types and attributes to subset by.
 void setPreSelection(IHost connection, String libraryName)
          Set an library to preselect.
 void setPreSelection(IHost connection, String libraryName, String objectName)
          Set an object to preselect.
 void setRootLibrary(IHost connection, String libraryName)
          Set the root library from which to start listing objects.
 void setSelectionTreeToolTipText(String tip)
          Set the tooltip text for the remote systems tree from which an item is selected.
 void setSelectionValidator(IValidatorRemoteSelection selectionValidator)
          Specify a validator to use when the user selects a remote object This allows you to decide if OK should be enabled or not for that remote object.
 void setShowLiblFilter(boolean show)
          Set to false to not show "*LIBL" library filter on initial expand of a connection.
 void setShowNewConnectionPrompt(boolean show)
          Set to true if a "New Connection..." special connection is to be shown for creating new connections
 void setShowPropertySheet(boolean show)
          Show the property sheet on the right hand side, to show the properties of the selected object.
 void setShowPropertySheet(boolean show, boolean initialState)
          Show the property sheet on the right hand side, to show the properties of the selected object.
 void setShowYourLibrariesPrompt(boolean show)
          Set to false to not show "YourLibraries..." special filter prompt
 void setSystemConnection(IHost conn)
          Set the system connection to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

dlg

protected QSYSSelectQSYSAndRemoteFileOrFolderDialog dlg

selectionType

protected int selectionType

fileMode

protected boolean fileMode

autoExpandDepth

protected int autoExpandDepth

onlyConnection

protected IHost onlyConnection

defaultConnection

protected IHost defaultConnection

addButtonCallback

protected IRemoteSelectionAddListener addButtonCallback

addFilterStrings

protected Vector addFilterStrings

title

protected String title

verbage

protected String verbage

treeTip

protected String treeTip

addLabel

protected String addLabel

addToolTipText

protected String addToolTipText

rootLibraryName

protected String rootLibraryName

preSelectLibraryName

protected String preSelectLibraryName

preSelectObjectName

protected String preSelectObjectName

objTypes

protected String[] objTypes

addButton

protected boolean addButton

showPropertySheet

protected boolean showPropertySheet

showPropertySheetDetailsButtonInitialState

protected boolean showPropertySheetDetailsButtonInitialState

showPropertySheetDetailsButton

protected boolean showPropertySheetDetailsButton

showNewConnectionPrompt

protected boolean showNewConnectionPrompt

showYourLibrariesPrompt

protected boolean showYourLibrariesPrompt

showLiblFilter

protected boolean showLiblFilter

multipleSelectionMode

protected boolean multipleSelectionMode

outputConnection

protected IHost outputConnection

EMPTY_OBJECT_ARRAY

protected static final Object[] EMPTY_OBJECT_ARRAY

EMPTY_STRING_ARRAY

protected static final String[] EMPTY_STRING_ARRAY
Constructor Detail

IBMiSelectAbstractQSYSAndRemoteFileOrFolderAction

public IBMiSelectAbstractQSYSAndRemoteFileOrFolderAction(Shell shell,
                                                         String label,
                                                         String tooltip,
                                                         int selectionType,
                                                         boolean fileMode)
Base constructor used by child classes, to supply their own action label.

Method Detail

setSystemConnection

public void setSystemConnection(IHost conn)
Set the system connection to use. Unlike setDefaultConnection, this method means you do not want to allow the user to select another connection.

See Also:
#setDefaultConnection(SystemConnection)

setDefaultConnection

public void setDefaultConnection(IHost conn)
Set the connection to pre-select and expand


setShowNewConnectionPrompt

public void setShowNewConnectionPrompt(boolean show)
Set to true if a "New Connection..." special connection is to be shown for creating new connections


setShowYourLibrariesPrompt

public void setShowYourLibrariesPrompt(boolean show)
Set to false to not show "YourLibraries..." special filter prompt


setShowLiblFilter

public void setShowLiblFilter(boolean show)
Set to false to not show "*LIBL" library filter on initial expand of a connection. Default is true. If you turn off this and you turn off setShowYourLibrariesPrompt, then the expansion of a connection will be an empty list. So, you must call addLibraryFilter to supply your own, or call setRootLibrary such that expanding a connection immediately lists the contens of that library as per the objTypes setting.


enableAddMode

protected void enableAddMode(boolean enable)
Child class method to tell us that add mode has been enabled. Child class handles saving and processing the caller


setAddModeLabel

public void setAddModeLabel(String addLabel,
                            String addToolTipText)
Set the Add button label and tooltip text. Pass null for either to use the default.


enableAddMode

public void enableAddMode(IRemoteSelectionAddListener caller)
Enable Add mode. This means the OK button is replaced with an Add button, and the Cancel with a Close button. When Add is pressed, the caller is called back. The dialog is not exited until Close is pressed.

When any remote object is selected, the caller is called back to decide to enable the Add button or not.


setShowPropertySheet

public void setShowPropertySheet(boolean show)
Show the property sheet on the right hand side, to show the properties of the selected object.

Default is false


setShowPropertySheet

public void setShowPropertySheet(boolean show,
                                 boolean initialState)
Show the property sheet on the right hand side, to show the properties of the selected object.

This overload shows a Details>>> button so the user can decide if they want to see the property sheet.

Parameters:
show - True if to show the property sheet within the dialog
initialState - True if the property is to be initially displayed, false if it is not to be displayed until the user presses the Details button.

addFilter

public void addFilter(String filterString)
Add a filter that users can expand to start their search.

This is really a filter string versus a filter, but it is realized in the GUI as a temporary filter.


addLibraryFilter

public void addLibraryFilter(String libraryFilter)
Add a library filter to the initial list shown when a connection is expanded The library name can be simple or generic.


setObjectTypes

public void setObjectTypes(String[] objTypes)
Set the object types and attributes to subset by. Each String can be a simple type like "*FILE" or a type and attribute, colon-separated, like "*FILE:DSPF".


setRootLibrary

public void setRootLibrary(IHost connection,
                           String libraryName)
Set the root library from which to start listing objects. What this means is that when a connection is expanded, the user will immediately see the contents of the given library, subject to the object types you have specified via setObjectTypes.

Parameters:
connection - The connection to the remote system containing the root library
libraryName - The name of the library to start listing from

setPreSelection

public void setPreSelection(IHost connection,
                            String libraryName)
Set an library to preselect. This will:


setPreSelection

public void setPreSelection(IHost connection,
                            String libraryName,
                            String objectName)
Set an object to preselect. This will:


setMultipleSelectionMode

public void setMultipleSelectionMode(boolean multiple)
Set multiple selection mode. Default is single selection only.

If you set this to true you must use getSelectedObjects()

Further, if you turn this on, it has the side effect of allowing the user to select any remote object. The assumption being if you are prompting for children, you also want to allow the user to select a parent, with the meaning being that all children within the parent are implicitly selected.

To restrict what types of objects can be selected, use #setSelectionValidator(com.ibm.etools.systems.core.ui.IValidatorRemoteSelection)


setSelectionValidator

public void setSelectionValidator(IValidatorRemoteSelection selectionValidator)
Specify a validator to use when the user selects a remote object This allows you to decide if OK should be enabled or not for that remote object.


setAutoExpandDepth

public void setAutoExpandDepth(int depth)
Specify the zero-based auto-expand level for the tree. The default is zero, meaning only show the connections


reset

public void reset()
Reset all attributes to initial values. Useful when reusing an action object


setDialogTitle

public void setDialogTitle(String title)
Set the dialog title. Must be called prior to run().


setMessage

public void setMessage(String message)
Set the message shown at the top. Default is "Browse for library"


setSelectionTreeToolTipText

public void setSelectionTreeToolTipText(String tip)
Set the tooltip text for the remote systems tree from which an item is selected.


getSelected

public Object getSelected()
Return selected ISeriesXXX object


getSelectedObjects

public Object[] getSelectedObjects()
Return all selected objects. This method will return an array of one unless you have called setMultipleSelectionMode(true)!

It will always return null if the user cancelled the dialog.

See Also:
setMultipleSelectionMode(boolean)

getSelectedConnection

public IHost getSelectedConnection()
Return selected connection


createDialog

protected Dialog createDialog(Shell shell)
If you decide to use the supplied run method as is, then you must override this method to create and return the dialog that is displayed by the default run method implementation.

If you override run with your own, then simply implement this to return null as it won't be used.

See Also:
#run()

getFileSubSystem

protected SubSystem getFileSubSystem(IHost connection)
Get the file subsystem given a connection


getSelectDialog

protected QSYSSelectQSYSAndRemoteFileOrFolderDialog getSelectDialog(Shell shell)
This is the overridable point for the dialog.


getDialogValue

protected Object getDialogValue(Dialog dlg)
Required by parent.


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.