Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.widgets
Class QSYSSelectQSYSForm

java.lang.Object
  extended by com.ibm.etools.iseries.rse.ui.widgets.QSYSSelectQSYSForm
All Implemented Interfaces:
IQSYSSelectionTypes
Direct Known Subclasses:
ClSelectCommandForm, QSYSSaveAsForm

public class QSYSSelectQSYSForm
extends Object
implements IQSYSSelectionTypes


Field Summary
protected  IRemoteSelectionAddListener addButtonCallback
           
protected  boolean addMode
           
protected  int autoExpandDepth
           
protected  Object caller
           
protected  boolean callerInstanceOfSystemPromptDialog
           
protected  boolean callerInstanceOfWizardPage
           
protected  boolean contentsCreated
           
protected  Hashtable convertedObjects
           
static String copyright
           
protected  IHost defaultConnection
           
protected  ISystemFilter[] defaultFilters
           
protected  boolean forceDefaultFiltersNull
           
protected  boolean initDone
           
protected  SelectQSYSObjectAPIProvider inputProvider
           
protected  ISystemFilter liblQuickFilter
           
protected  Vector listeners
           
protected  ISystemMessageLine msgLine
           
protected  boolean multipleSelectionMode
           
protected  Text nameEntryValue
           
protected  SystemRemoteObjectMatcher objectMatcher
           
protected  Composite outerParent
           
protected  IHost outputConnection
           
protected  Object[] outputObjects
           
protected  ISystemFilter preSelectFilter
           
protected  SystemPropertySheetForm ps
           
protected  Composite ps_composite
           
protected  ResourceBundle rb
           
protected  int selectionType
           
protected  IValidatorRemoteSelection selectionValidator
           
protected  boolean showLiblFilter
           
protected  boolean showPropertySheet
           
protected  boolean showYourLibrariesPrompt
           
protected  Label spacer1
           
protected  Label spacer2
           
protected  ISystemRegistry sr
           
protected  boolean srcFilesOnly
           
protected  SystemViewForm tree
           
protected  String treeTip
           
protected  String verbage
           
protected  Label verbageLabel
           
 
Fields inherited from interface com.ibm.etools.iseries.rse.ui.widgets.IQSYSSelectionTypes
BROWSEFOR_ANY, BROWSEFOR_COMMAND, BROWSEFOR_CRT_COMMAND, BROWSEFOR_DTAARA, BROWSEFOR_DTAQ, BROWSEFOR_FIELD, BROWSEFOR_FILE, BROWSEFOR_JOB, BROWSEFOR_JOBD, BROWSEFOR_JOBQ, BROWSEFOR_LIBRARY, BROWSEFOR_MEMBER, BROWSEFOR_MESSAGE, BROWSEFOR_MODULE, BROWSEFOR_MSGF, BROWSEFOR_OBJECT, BROWSEFOR_PGM, BROWSEFOR_PGM_MODULE, BROWSEFOR_PGMSRVPGM, BROWSEFOR_PROCEDURE, BROWSEFOR_RECORD, BROWSEFOR_SRVPGM, Copyright
 
Constructor Summary
QSYSSelectQSYSForm(ISystemMessageLine msgLine, Object caller, int selectionType, boolean srcFilesOnly)
          Constructor
 
Method Summary
 void addFilter(ISystemFilter filter)
          Add a filter that users can expand to start their search.
 void addFilter(String filterString)
          Add a filter that users can expand to start their search.
 void addFilters(Vector<String> filterStrings)
          Add one or more filters that users can expand to start their search.
protected  ISystemFilter[] addQuickFilter(ISystemFilter newFilter)
          Add a filter to the default filter list
 void addSelectionChangedListener(ISelectionChangedListener l)
          Add a listener to selection change events in the tree
protected  void clearErrorMessage()
           
 Control createContents(Shell shell, Composite parent)
          In this method, we populate the given SWT container with widgets and return the container to the caller.
 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 (one of the ones created above).
protected  ISystemFilter createQuickFilter(String name, String filterString)
          Create a transient filter given the name and filter string
 void enableAddMode(IRemoteSelectionAddListener caller)
          Enable Add mode.
protected  ISystemViewElementAdapter getAdapter(Object o)
          Returns the implementation of ISystemViewElement for the given object.
protected  Object getFirstSelection(ISelection selection)
          Return first item currently selected.
 Control getInitialFocusControl()
          Return control to recieve initial focus
protected  ISystemFilter getLiblQuickFilter()
          Create a commonly needed transient filter for *LIBL
 boolean getMultipleSelectionMode()
          Return the multiple selection mode state
protected  ISystemFilter[] getQuickFilters()
          Build and return array of transient filters to be shown when the user expands a connection
protected  ISystemRemoteElementAdapter getRemoteAdapter(Object o)
          Returns the implementation of ISystemRemoteElement for the given object.
 IHost getSelectedConnection()
          Return selected connection
 Object getSelectedObject()
          Return first selected object
 Object[] getSelectedObjects()
          Return all selected objects.
protected  Object[] getSelections(ISelection selection)
          Return all items currently selected.
protected  Shell getShell()
          Return shell of parent dialog or wizard
 SystemViewForm getSystemViewForm()
          Return the embedded System Tree object.
protected  IHost internalGetConnection()
          Return the current connection
 boolean isPageComplete()
          This method can be called by the dialog or wizard page host, to decide whether to enable or disable the next, final or ok buttons.
 void removeSelectionChangedListener(ISelectionChangedListener l)
          Remove a listener for selection change events
 void selectionChanged(SelectionChangedEvent e)
          User selected something in the tree.
 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
protected  void setErrorMessage(String msg)
           
protected  void setErrorMessage(SystemMessage msg)
           
 void setMemberTypes(String[] mbrTypes)
          Set the members types and attributes to subset by, when the selection mode is members
 void setMessage(String message)
          Set the message shown as the text at the top of the form.
 void setMessageLine(ISystemMessageLine msgLine)
          Often the message line is null at the time of instantiation, so we have to call this after it is created.
 void setMultipleSelectionMode(boolean multiple)
          Set multiple selection mode.
protected  void setNameText(String text)
          Set the hidden name field that enables the OK button
 void setObjectTypes(String[] objTypes)
          Set the object types and attributes to subset by, when the selection mode is anything but libraries.
 void setPageComplete()
          Inform caller of page-complete status of this form
 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 setRootLibrary(QSYSRemoteLibrary library)
          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 file or folder.
 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 setShowYourLibrariesPrompt(boolean show)
          Set to false to not show "YourLibraries..." special filter prompt
 void setSystemConnection(IHost conn)
          Set the connection to restrict the user to seeing
 boolean toggleShowPropertySheet(Shell shell, Control contents)
          Show or hide the property sheet.
 boolean verify()
          Completes processing of the wizard page or dialog.
 
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

verbageLabel

protected Label verbageLabel

spacer1

protected Label spacer1

spacer2

protected Label spacer2

nameEntryValue

protected Text nameEntryValue

tree

protected SystemViewForm tree

ps

protected SystemPropertySheetForm ps

msgLine

protected ISystemMessageLine msgLine

outerParent

protected Composite outerParent

ps_composite

protected Composite ps_composite

sr

protected ISystemRegistry sr

verbage

protected String verbage

treeTip

protected String treeTip

selectionType

protected int selectionType

srcFilesOnly

protected boolean srcFilesOnly

showLiblFilter

protected boolean showLiblFilter

showPropertySheet

protected boolean showPropertySheet

showYourLibrariesPrompt

protected boolean showYourLibrariesPrompt

forceDefaultFiltersNull

protected boolean forceDefaultFiltersNull

addMode

protected boolean addMode

multipleSelectionMode

protected boolean multipleSelectionMode

objectMatcher

protected SystemRemoteObjectMatcher objectMatcher

defaultConnection

protected IHost defaultConnection

addButtonCallback

protected IRemoteSelectionAddListener addButtonCallback

listeners

protected Vector listeners

selectionValidator

protected IValidatorRemoteSelection selectionValidator

outputObjects

protected Object[] outputObjects

outputConnection

protected IHost outputConnection

rb

protected ResourceBundle rb

inputProvider

protected SelectQSYSObjectAPIProvider inputProvider

liblQuickFilter

protected ISystemFilter liblQuickFilter

convertedObjects

protected Hashtable convertedObjects

defaultFilters

protected ISystemFilter[] defaultFilters

preSelectFilter

protected ISystemFilter preSelectFilter

initDone

protected boolean initDone

contentsCreated

protected boolean contentsCreated

caller

protected Object caller

callerInstanceOfWizardPage

protected boolean callerInstanceOfWizardPage

callerInstanceOfSystemPromptDialog

protected boolean callerInstanceOfSystemPromptDialog

autoExpandDepth

protected int autoExpandDepth
Constructor Detail

QSYSSelectQSYSForm

public QSYSSelectQSYSForm(ISystemMessageLine msgLine,
                          Object caller,
                          int selectionType,
                          boolean srcFilesOnly)
Constructor

Parameters:
msgLine - A GUI widget capable of writing error messages to.
caller - The wizardpage or dialog hosting this form.
selectionType - An enumeration indicating the type of object to browse for, as specified in IQSYSSelectionTypes
srcFilesOnly - If the selection type is files or members, indicate whether to restrict to source files
See Also:
setSystemConnection(IHost), setShowNewConnectionPrompt(boolean), setSelectionTreeToolTipText(String)
Method Detail

setSystemConnection

public void setSystemConnection(IHost conn)
Set the connection to restrict the user to seeing


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.


setMessage

public void setMessage(String message)
Set the message shown as the text at the top of the form. Eg, "Select a file"


setSelectionTreeToolTipText

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


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.


addFilter

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

This is really a filter versus a filter string, so you can decide on the name


addFilters

public void addFilters(Vector<String> filterStrings)
Add one or more filters that users can expand to start their search.

These are really filter strings versus filters, but they are realized in the GUI as temporary filters.

Parameters:
filterstrings - Vector of strings or SystemFilter objects

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.

Not applicable for select-library mode.

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

setRootLibrary

public void setRootLibrary(QSYSRemoteLibrary library)
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.

Not applicable for select-library mode.

Parameters:
library - An ISeriesLibrary object

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:


setObjectTypes

public void setObjectTypes(String[] objTypes)
Set the object types and attributes to subset by, when the selection mode is anything but libraries.

Each String can be a simple type like "*FILE" or a type and attribute, colon-separated, like "*FILE:DSPF".

Here are the default object types per selection type:


  if (selectionType == BROWSEFOR_FILE)
          setObjectTypes(new String[] {"*FILE:*"});
        else if (selectionType == BROWSEFOR_MEMBER)
    setObjectTypes(new String[] {"*FILE:PF-*"});
        else if (selectionType == BROWSEFOR_FIELD)
          setObjectTypes(new String[] {"*FILE:PF-DTA"});                
        else if (selectionType == BROWSEFOR_RECORD)
          setObjectTypes(new String[] {"*FILE:DSPF", "*FILE:PRTF"});            
        else if (selectionType == BROWSEFOR_COMMAND)
          setObjectTypes(new String[] {"*CMD"});                
 


setMemberTypes

public void setMemberTypes(String[] mbrTypes)
Set the members types and attributes to subset by, when the selection mode is members

Each String can be a simple type like "RPG" or a generic string like "RPG*"


setAutoExpandDepth

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


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


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.

The caller will be called back when any remote object(s) is/are selected to decide whether to enable the Add button. It is also called when Add is pressed.


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 members, say, you also want to allow the user to select a file, with the meaning being that all members within the file are implicitly selected.


addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener l)
Add a listener to selection change events in the tree


removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener l)
Remove a listener for selection change events


setSelectionValidator

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


getSelectedObject

public Object getSelectedObject()
Return first selected object


getSelectedObjects

public Object[] getSelectedObjects()
Return all selected objects.

See Also:
setMultipleSelectionMode(boolean)

getSelectedConnection

public IHost getSelectedConnection()
Return selected connection


getSystemViewForm

public SystemViewForm getSystemViewForm()
Return the embedded System Tree object. Will be null until createContents is called.


getMultipleSelectionMode

public boolean getMultipleSelectionMode()
Return the multiple selection mode state


setMessageLine

public void setMessageLine(ISystemMessageLine msgLine)
Often the message line is null at the time of instantiation, so we have to call this after it is created.


getInitialFocusControl

public Control getInitialFocusControl()
Return control to recieve initial focus


toggleShowPropertySheet

public boolean toggleShowPropertySheet(Shell shell,
                                       Control contents)
Show or hide the property sheet. This is called after the contents are created when the user toggles the Details button.

Parameters:
shell - Use getShell() in your dialog or wizard page
contents - Use getContents() in your dialog or wizard page
Returns:
new state -> true if showing, false if hiding

createContents

public Control createContents(Shell shell,
                              Composite parent)
In this method, we populate the given SWT container with widgets and return the container to the caller.

Parameters:
parent - The parent composite

verify

public boolean verify()
Completes processing of the wizard page or dialog. If this method returns true, the wizard/dialog will close; otherwise, it will stay active.

Returns:
true if no errors

internalGetConnection

protected IHost internalGetConnection()
Return the current connection


setNameText

protected void setNameText(String text)
Set the hidden name field that enables the OK button


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.


selectionChanged

public void selectionChanged(SelectionChangedEvent e)
User selected something in the tree.


getFirstSelection

protected Object getFirstSelection(ISelection selection)
Return first item currently selected.


getSelections

protected Object[] getSelections(ISelection selection)
Return all items currently selected.


isPageComplete

public boolean isPageComplete()
This method can be called by the dialog or wizard page host, to decide whether to enable or disable the next, final or ok buttons. It returns true if the minimal information is available and is correct.


setPageComplete

public void setPageComplete()
Inform caller of page-complete status of this form


clearErrorMessage

protected void clearErrorMessage()

setErrorMessage

protected void setErrorMessage(String msg)

setErrorMessage

protected void setErrorMessage(SystemMessage msg)

getQuickFilters

protected ISystemFilter[] getQuickFilters()
Build and return array of transient filters to be shown when the user expands a connection


addQuickFilter

protected ISystemFilter[] addQuickFilter(ISystemFilter newFilter)
Add a filter to the default filter list


createQuickFilter

protected ISystemFilter createQuickFilter(String name,
                                          String filterString)
Create a transient filter given the name and filter string


getLiblQuickFilter

protected ISystemFilter getLiblQuickFilter()
Create a commonly needed transient filter for *LIBL


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 (one of the ones created above).

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

getShell

protected Shell getShell()
Return shell of parent dialog or wizard


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.