Rational Developer for Power Systems Software
V7.6

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

java.lang.Object
  extended by com.ibm.etools.iseries.rse.ui.widgets.QSYSSelectJobForm
All Implemented Interfaces:
IQSYSSelectionTypes

public class QSYSSelectJobForm
extends Object
implements IQSYSSelectionTypes

A reusable form for prompting for a library, object or member on a remote iSeries system.

This form is designed to look and feel like the Windows Browse For dialogs. That means there is only two controls: an output label to show what is selected and a tree viewer for finding the item to select. Unlike we Windows, we don't let the user type in a name.

Call these methods to configure the typical functionality of the dialog

Call these methods to configure the more advanced functionality of the dialog

Call these methods to configure the text on the dialog

After running, call these methods to get the output:


Field Summary
protected  int autoExpandDepth
           
protected  Object caller
           
protected  boolean callerInstanceOfSystemPromptDialog
           
protected  boolean callerInstanceOfWizardPage
           
protected  IBMiConnection connection
           
protected  boolean contentsCreated
           
static String copyright
           
protected  boolean initDone
           
protected  QSYSSelectJobAPIProvider inputProvider
           
protected  String jobFilterString
           
protected  Vector listeners
           
protected  ISystemMessageLine msgLine
           
protected  boolean multipleSelectionMode
           
protected  Text nameEntryValue
           
protected  SystemRemoteObjectMatcher objectMatcher
           
protected  Composite outerParent
           
protected  Object[] outputObjects
           
protected  ISystemFilter preSelectFilter
           
protected  Composite ps_composite
           
protected  ResourceBundle rb
           
protected  int selectionType
           
protected  IValidatorRemoteSelection selectionValidator
           
protected  boolean showJobListOnStartup
           
protected  Label spacer1
           
protected  Label spacer2
           
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
QSYSSelectJobForm(ISystemMessageLine msgLine, Object caller, IBMiConnection connection, int selectionType)
          Constructor
 
Method Summary
 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.
 IBMiConnection getConnection()
          Return selected connection
protected  Object getFirstSelection(ISelection selection)
          Return first item currently selected.
 Control getInitialFocusControl()
          Return control to recieve initial focus
 boolean getMultipleSelectionMode()
          Return the multiple selection mode state
 Object getSelectedObject()
          Return first selected object
 Object[] getSelectedObjects()
          Return all selected objects.
protected  Object[] getSelections(ISelection selection)
          Return all items currently selected.
 SystemViewForm getSystemViewForm()
          Return the embedded System Tree object.
 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 selectionChangeEvent)
          User selected something in the tree.
 void setConnection(IBMiConnection connection)
          Set the connection to restrict the user to seeing
protected  void setErrorMessage(SystemMessage msg)
           
 void setJobFilterString(String filterString)
          Add a string filter to select a list of jobs to display
 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.
 void setPageComplete()
          Inform caller of page-complete status of this form
 void setPreSelection(IHost connection, String libraryName, String objectName)
          Set an object to preselect.
 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 setShowJobListOnStartup(boolean show)
          Set to false if don't want to see the list of job for the specified job filter string as soon as the dialog comes up.
 void setShowNewConnectionPrompt(boolean show)
          Set to true if a "New Connection..." special connection is to be shown for creating new connections
 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

msgLine

protected ISystemMessageLine msgLine

outerParent

protected Composite outerParent

ps_composite

protected Composite ps_composite

verbage

protected String verbage

treeTip

protected String treeTip

selectionType

protected int selectionType

showJobListOnStartup

protected boolean showJobListOnStartup

multipleSelectionMode

protected boolean multipleSelectionMode

objectMatcher

protected SystemRemoteObjectMatcher objectMatcher

listeners

protected Vector listeners

selectionValidator

protected IValidatorRemoteSelection selectionValidator

outputObjects

protected Object[] outputObjects

connection

protected IBMiConnection connection

inputProvider

protected QSYSSelectJobAPIProvider inputProvider

preSelectFilter

protected ISystemFilter preSelectFilter

jobFilterString

protected String jobFilterString

rb

protected ResourceBundle rb

initDone

protected boolean initDone

contentsCreated

protected boolean contentsCreated

callerInstanceOfWizardPage

protected boolean callerInstanceOfWizardPage

callerInstanceOfSystemPromptDialog

protected boolean callerInstanceOfSystemPromptDialog

caller

protected Object caller

autoExpandDepth

protected int autoExpandDepth
Constructor Detail

QSYSSelectJobForm

public QSYSSelectJobForm(ISystemMessageLine msgLine,
                         Object caller,
                         IBMiConnection connection,
                         int selectionType)
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 IISeriesSelectionTypes
srcFilesOnly - If the selection type is files or members, indicate whether to restrict to source files
See Also:
setConnection(IBMiConnection), setShowNewConnectionPrompt(boolean), setSelectionTreeToolTipText(String)
Method Detail

setConnection

public void setConnection(IBMiConnection connection)
Set the connection to restrict the user to seeing


setShowJobListOnStartup

public void setShowJobListOnStartup(boolean show)
Set to false if don't want to see the list of job for the specified job filter string as soon as the dialog comes up. Default value is true


setShowNewConnectionPrompt

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


setSelectionTreeToolTipText

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


setMessage

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


setJobFilterString

public void setJobFilterString(String filterString)
Add a string filter to select a list of jobs to display

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


createFilterByPrompting

public 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.

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

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 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)

getConnection

public IBMiConnection getConnection()
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


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

selectionChanged

public void selectionChanged(SelectionChangedEvent selectionChangeEvent)
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(SystemMessage msg)

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.