Rational Developer for Power Systems Software
V7.6

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

java.lang.Object
  extended by Composite
      extended by com.ibm.etools.iseries.rse.ui.widgets.QSYSBasePrompt
          extended by com.ibm.etools.iseries.rse.ui.widgets.QSYSProgramObjectPrompt
              extended by com.ibm.etools.iseries.rse.ui.widgets.QSYSModulePrompt
All Implemented Interfaces:
IIBMiHistoryKeys, IIBMiProgramPromptTypes

public class QSYSModulePrompt
extends QSYSProgramObjectPrompt
implements IIBMiHistoryKeys, IIBMiProgramPromptTypes

This re-usable composite widget is for prompting the user for a module name. The module name widget is a combo that lists special values and previously entered (historical) names. Beside the combo is a button with a Browse label for selecting an object from a remote list. Of course modules are qualified by library and pgm/srvpgm names so this also prompts for those.

The composite is layed as follows:


   Library: ______________________v  Browse...
   Program: ______________________v  Browse...
   Module : ______________________v  Browse...
 

You must specify whether this prompt is for a generic module name like ABC* or a scalar module name like ABC1. Beyond appropriate error checking it also affects the special-values contents of the dropdowns.

Furthermore, to help scope the history of the dropdown you must specify whether you are prompting for modules inside programs, or service programs, or both, via constants in IISeriesProgramPromptTypes.

See Also:

, setModuleChangeListener(IQSYSModulePromptListener)


Field Summary
protected  IQSYSSelectObjectAction browseModuleAction
           
protected  Button browseModuleButton
           
static String copyright
           
protected  ISeriesObjectFilterString moduleFilterString
           
protected  ValidatorIBMiObject moduleValidator
           
protected  SystemHistoryCombo promptModuleCombo
           
protected  Label promptModuleLabel
           
 
Fields inherited from class com.ibm.etools.iseries.rse.ui.widgets.QSYSProgramObjectPrompt
allowEmpty, allowGeneric, allowLibl, browseProgramButton, browseServiceProgramButton, CURLIB, filterString, LIBL, libValidator, listener, objTypes, PGM, pgmValidator, programRadioButton, promptProgramCombo, promptProgramLabel, promptServiceProgramCombo, promptServiceProgramLabel, serviceProgramRadioButton, SRVPGM
 
Fields inherited from class com.ibm.etools.iseries.rse.ui.widgets.QSYSBasePrompt
browseAction, browseButton, defaultConnection, enableBrowse, gridColumns, ignoreChanges, onlyConnection, promptCombo, promptLabel, rb, showNewConnection, testing
 
Fields inherited from interface com.ibm.etools.iseries.rse.ui.IIBMiHistoryKeys
ATTR_OBJ, Copyright, GENERIC_ATTR_OBJ, GENERIC_NAME_CMD, GENERIC_NAME_DTAARA, GENERIC_NAME_DTAQ, GENERIC_NAME_FILE, GENERIC_NAME_FILE_DSPF, GENERIC_NAME_FILE_DSPF_PRTF, GENERIC_NAME_FILE_DTA, GENERIC_NAME_FILE_PRTF, GENERIC_NAME_FILE_SRC, GENERIC_NAME_FILE_SRC_DTA, GENERIC_NAME_FLD, GENERIC_NAME_JOBD, GENERIC_NAME_LIB, GENERIC_NAME_LIB_NOLIBL, GENERIC_NAME_MBR, GENERIC_NAME_MODULE, GENERIC_NAME_MSGF, GENERIC_NAME_OBJ, GENERIC_NAME_PGM, GENERIC_NAME_PGM_SRVPGM, GENERIC_NAME_RCD, GENERIC_NAME_SRVPGM, GENERIC_PREFIX, GENERIC_TYPE_MBR, GENERIC_TYPE_OBJ, HISTORY_PREFIX, JOB_CURR_USERID, JOB_NAME, JOB_NUMBER, JOB_SUBSYSTEM, JOB_USER, KEY_NAME, NAME_ASPDEV, NAME_AUTL, NAME_AUTL_AUT, NAME_AUTL_CRTAUT, NAME_CMD, NAME_DTAARA, NAME_DTAQ, NAME_FILE, NAME_FILE_DSPF, NAME_FILE_DSPF_PRTF, NAME_FILE_DTA, NAME_FILE_PRTF, NAME_FILE_SRC, NAME_FILE_SRC_DTA, NAME_FLD, NAME_JOBD, NAME_LIB, NAME_LIB_NOCURLIB, NAME_LIB_NOLIBL, NAME_MBR, NAME_MODULE, NAME_MSGF, NAME_OBJ, NAME_PGM, NAME_PGM_SRVPGM, NAME_RCD, NAME_SRVPGM, RELEASE_JOB_COMMAND, SAVF_LIB_HISTORY_KEY, SAVF_OBJ_HISTORY_KEY, SAVF_RSTLIB_HISTORY_KEY, SAVF_SAVELIB_HISTORY_KEY, SPLF_FILE, SPLF_USER, STRING_FIND, TYPE_MBR, TYPE_OBJ
 
Fields inherited from interface com.ibm.etools.iseries.rse.ui.widgets.IIBMiProgramPromptTypes
PGMTYPE_PGM, PGMTYPE_PGM_OR_SRVPGM, PGMTYPE_SRVPGM
 
Constructor Summary
QSYSModulePrompt(Composite parent, int pgmType)
          Constructor when generic names are allowed and no special style is desired for the composite
QSYSModulePrompt(Composite parent, int style, boolean allowGeneric, boolean allowLibl, int pgmType)
          Constructor
QSYSModulePrompt(Composite parent, int style, int pgmType)
          Constructor when generic names are allowed
 
Method Summary
 void addBrowseButtonSelectionListener(SelectionListener listener)
          Register a listener interested in when the either the library or object or module browse button is selected
protected  void addModuleButtonSelectionListener()
          Enables our browse button for modules.
 void addModuleModifyListener(ModifyListener listener)
          Register a listener interested in module entry field modify events
 void addSelectionListener(SelectionListener listener)
          Register a listener interested in an item is selected in either the library combo box or the object combo box or the module object combo box
protected  IQSYSSelectObjectAction getModuleBrowseAction(Shell shell, IHost defaultConnection, boolean onlyConnection)
          Overridable method.
 Button getModuleBrowseButton()
          Return the module Browse...
 SystemHistoryCombo getModuleCombo()
          Return the combo box widget for the module prompt
protected  ISeriesObjectFilterString getModuleFilterString()
          Get the module filter string to use in building the quick filter string.
 String[] getModuleItems()
          Get the items in the module combo field
 String getModuleName()
          Get the user entered or selected module name.
protected  void populateModuleCombo(SystemHistoryCombo combo, boolean allowGeneric)
          Populates our module combo.
 void removeBrowseButtonSelectionListener(SelectionListener listener)
          Remove a previously set browse button selection listener.
 void removeModuleModifyListener(ModifyListener listener)
          Remove a previously set module entry field listener.
 void removeSelectionListener(SelectionListener listener)
          Remove a previously set combo box selection listener.
 void setEnabled(boolean enabled)
          Disable/Enable all the child controls.
 void setModuleBrowseButtonFocus()
          Set the focus to the module browse button
 void setModuleBrowseButtonToolTipText(String tip)
          Set the tooltip text for the module browse button
 void setModuleChangeListener(IQSYSModulePromptListener listener)
          Identify caller that is interested in being informed of live error checking status.
 boolean setModuleFocus()
          Set the focus to the module combo field
 void setModuleItems(String[] items)
          Set the items in the module combo field
 void setModuleName(String name)
          Set the module name displayed in the combo box.
 void setModulePromptLabel(String label)
          Set the module prompt label
 void setModuleToolTipText(String tip)
          Set the tooltip text for the module combo field
 void setModuleValidator(ValidatorIBMiObject objValidator)
          Set the module validator for syntax checking There is one supplied for you so you rarely need to call this.
 void setSystemConnection(IHost onlyConnection)
          Set the system connection to use when Browse is pressed.
Unlike setDefaultConnection, this has the result of not allowing the user to select or create any other connection.
 void updateHistory()
          Update the history with current entry field setting.
 SystemMessage validateLibInput()
          Validate library string, as it is typed, or in batch if you wish to call directly.
 SystemMessage validateModuleInput()
          Validate module name string, as it is typed, or in batch if you wish to call directly.
 SystemMessage validateObjInput()
          Validate object string, as it is typed, or in batch if you wish to call directly.
 
Methods inherited from class com.ibm.etools.iseries.rse.ui.widgets.QSYSProgramObjectPrompt
addLibraryModifyListener, addObjectModifyListener, addOurButtonSelectionListener, addRadioButtonsSelectionListener, createObjectWidgets, enableProgramPrompt, enableServiceProgramPrompt, getAcriveProgramObjectBrowseButton, getActiveProgramObjectCombo, getActiveProgramObjectItems, getActiveProgramObjectName, getActiveProgramObjectType, getBrowseAction, getLibraryBrowseButton, getLibraryCombo, getLibraryName, getLibraryPromptLabel, getObjectBrowseAction, getObjectFilterString, getObjectPromptLabel, getObjectTypes, getProgramCombo, getQualifiedName, getServiceProgramCombo, handleBrowseButtonSelectionEvent, init, isProgramRadioButtonSelected, isServiceProgramRadioButtonSelected, isSpecialName, populateLibraryCombo, populateProgramObjectCombo, removeLibraryModifyListener, removeObjectChangeListener, removeObjectModifyListener, removeRadioButtonSelectionListener, setActiveProgramObjectFocus, setActiveProgramObjectItems, setActiveProgramObjectName, setDefaultConnection, setLibraryBrowseButtonFocus, setLibraryBrowseButtonToolTipText, setLibraryFocus, setLibraryItems, setLibraryName, setLibraryPromptLabel, setLibraryToolTipText, setLibraryValidator, setObjectBrowseButtonFocus, setObjectBrowseButtonToolTipText, setObjectChangeListener, setObjectPromptLabel, setObjectToolTipText, setObjectTypes, setObjectValidator
 
Methods inherited from class com.ibm.etools.iseries.rse.ui.widgets.QSYSBasePrompt
addModifyListener, addSelectionChangedListener, createCombo, createHistoryCombo, createPushButton, createPushButton, getBrowseButton, getCombo, getGridColumns, getItems, getPromptLabel, getSelection, getText, lineUpWith, lineUpWith, prepareComposite, removeModifyListener, removeSelectionChangedListener, setBrowseButtonFocus, setBrowseButtonLabel, setBrowseButtonToolTipText, setButtonWidthHint, setButtonWidthHint, setFocus, setHost, setIgnoreChanges, setItems, setPromptLabel, setSelection, setShowNewConnectionPrompt, setText, setToolTipText, setWidthHint, showBrowseButton, showBrowseButton, updateHistory
 
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

promptModuleLabel

protected Label promptModuleLabel

promptModuleCombo

protected SystemHistoryCombo promptModuleCombo

browseModuleButton

protected Button browseModuleButton

moduleFilterString

protected ISeriesObjectFilterString moduleFilterString

moduleValidator

protected ValidatorIBMiObject moduleValidator

browseModuleAction

protected IQSYSSelectObjectAction browseModuleAction
Constructor Detail

QSYSModulePrompt

public QSYSModulePrompt(Composite parent,
                        int pgmType)
Constructor when generic names are allowed and no special style is desired for the composite

Parameters:
parent - Parent composite
pgmType - Pass one of the type constants in com.ibm.etools.iseries.core.ui.widgets.IISeriesProgramPromptTypes such as PGMTYPE_PGM
See Also:
#setDefaultConnection(SystemConnection)

QSYSModulePrompt

public QSYSModulePrompt(Composite parent,
                        int style,
                        int pgmType)
Constructor when generic names are allowed

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
pgmType - Pass one of the type constants in com.ibm.etools.iseries.core.ui.widgets.IISeriesProgramPromptTypes such as PGMTYPE_PGM
See Also:
#setDefaultConnection(SystemConnection)

QSYSModulePrompt

public QSYSModulePrompt(Composite parent,
                        int style,
                        boolean allowGeneric,
                        boolean allowLibl,
                        int pgmType)
Constructor

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
defaultConnection - The system connection to preselect when Browse is pressed.
allowGeneric - Pass true to allow generic names in the entry field
allowLibl - Pass false if allowGeneric is false, to restrict user from entering/selecting "*LIBL" for the library
pgmType - Pass one of the type constants in com.ibm.etools.iseries.core.ui.widgets.IISeriesProgramPromptTypes such as PGMTYPE_PGM
See Also:
#setDefaultConnection(SystemConnection)
Method Detail

setModuleChangeListener

public void setModuleChangeListener(IQSYSModulePromptListener listener)
Identify caller that is interested in being informed of live error checking status. Will be called back for either libary or object or module changes.


getModuleCombo

public SystemHistoryCombo getModuleCombo()
Return the combo box widget for the module prompt


getModuleName

public String getModuleName()
Get the user entered or selected module name. Same as calling QSYSBasePrompt.getText()


setModuleName

public void setModuleName(String name)
Set the module name displayed in the combo box. Same as calling QSYSBasePrompt.setText(String)


getModuleBrowseButton

public Button getModuleBrowseButton()
Return the module Browse... button widget


setModuleItems

public void setModuleItems(String[] items)
Set the items in the module combo field


getModuleItems

public String[] getModuleItems()
Get the items in the module combo field


setEnabled

public void setEnabled(boolean enabled)
Disable/Enable all the child controls.

Overrides:
setEnabled in class QSYSProgramObjectPrompt

setSystemConnection

public void setSystemConnection(IHost onlyConnection)
Set the system connection to use when Browse is pressed.
Unlike setDefaultConnection, this has the result of not allowing the user to select or create any other connection. If you call this, you probably also want to call QSYSBasePrompt.setShowNewConnectionPrompt(boolean).
If you do call QSYSBasePrompt.setShowNewConnectionPrompt(boolean) with false, then this method has the effect of either enabling or disabling the Browser button, depending if the connection is not-null or null, respectively. This is because if they cannot create a connection, and no connection is given, then there is no point in browsing. Note the button is enabled until you call this, so you probably will need to do a priming call with null, to disable it initially if the user selects their connection from another widget. It also means you want to do that priming call after calling QSYSBasePrompt.setShowNewConnectionPrompt(boolean) with false.

Overrides:
setSystemConnection in class QSYSProgramObjectPrompt
See Also:
#setDefaultConnection(SystemConnection), QSYSBasePrompt.setShowNewConnectionPrompt(boolean)

setModulePromptLabel

public void setModulePromptLabel(String label)
Set the module prompt label


setModuleToolTipText

public void setModuleToolTipText(String tip)
Set the tooltip text for the module combo field


setModuleBrowseButtonToolTipText

public void setModuleBrowseButtonToolTipText(String tip)
Set the tooltip text for the module browse button


setModuleFocus

public boolean setModuleFocus()
Set the focus to the module combo field


setModuleBrowseButtonFocus

public void setModuleBrowseButtonFocus()
Set the focus to the module browse button


addSelectionListener

public void addSelectionListener(SelectionListener listener)
Register a listener interested in an item is selected in either the library combo box or the object combo box or the module object combo box

Overrides:
addSelectionListener in class QSYSProgramObjectPrompt
See Also:
removeSelectionListener(SelectionListener)

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Remove a previously set combo box selection listener.

Overrides:
removeSelectionListener in class QSYSProgramObjectPrompt
See Also:
addSelectionListener(SelectionListener)

addBrowseButtonSelectionListener

public void addBrowseButtonSelectionListener(SelectionListener listener)
Register a listener interested in when the either the library or object or module browse button is selected

Overrides:
addBrowseButtonSelectionListener in class QSYSProgramObjectPrompt
See Also:
#removeNewButtonSelectionListener(SelectionListener)

removeBrowseButtonSelectionListener

public void removeBrowseButtonSelectionListener(SelectionListener listener)
Remove a previously set browse button selection listener.

Overrides:
removeBrowseButtonSelectionListener in class QSYSProgramObjectPrompt
See Also:
#addNewButtonSelectionListener(SelectionListener)

addModuleModifyListener

public void addModuleModifyListener(ModifyListener listener)
Register a listener interested in module entry field modify events

See Also:
removeModuleModifyListener(ModifyListener)

removeModuleModifyListener

public void removeModuleModifyListener(ModifyListener listener)
Remove a previously set module entry field listener.

See Also:
addModuleModifyListener(ModifyListener)

updateHistory

public void updateHistory()
Update the history with current entry field setting.

This is called automatically for you when setText is called. However, for non-readonly versions, you should still call this yourself when OK is successfully pressed on the dialog box.

Overrides:
updateHistory in class QSYSProgramObjectPrompt

setModuleValidator

public void setModuleValidator(ValidatorIBMiObject objValidator)
Set the module validator for syntax checking There is one supplied for you so you rarely need to call this.


getModuleBrowseAction

protected IQSYSSelectObjectAction getModuleBrowseAction(Shell shell,
                                                        IHost defaultConnection,
                                                        boolean onlyConnection)
Overridable method. Returns action to be called when Browse... pressed for the module Internal use.


populateModuleCombo

protected void populateModuleCombo(SystemHistoryCombo combo,
                                   boolean allowGeneric)
Populates our module combo. Internal use.


addModuleButtonSelectionListener

protected void addModuleButtonSelectionListener()
Enables our browse button for modules. Internal use.


getModuleFilterString

protected ISeriesObjectFilterString getModuleFilterString()
Get the module filter string to use in building the quick filter string. Caller will set library and program and module name!


validateLibInput

public SystemMessage validateLibInput()
Validate library string, as it is typed, or in batch if you wish to call directly. We override so we can enable/disable module's browse button.

Overrides:
validateLibInput in class QSYSProgramObjectPrompt

validateObjInput

public SystemMessage validateObjInput()
Validate object string, as it is typed, or in batch if you wish to call directly. We override so we can enable/disable module's browse button.

Overrides:
validateObjInput in class QSYSProgramObjectPrompt

validateModuleInput

public SystemMessage validateModuleInput()
Validate module name string, as it is typed, or in batch if you wish to call directly.


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.