Rational Developer for Power Systems Software
V7.6

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

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.QSYSLibraryPrompt
All Implemented Interfaces:
IIBMiHistoryKeys

public class QSYSLibraryPrompt
extends QSYSBasePrompt
implements IIBMiHistoryKeys

This re-usable composite widget is for prompting the user for a library name. The library 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 a library from a remote list.

The composite is layed as follows:


   Library: ______________________v  Browse...
 

You must specify whether this prompt is for a generic library name like ABC* or a scalar library name like ABC1. Beyond appropriate error checking it also affects the special-values contents of the dropdown. Both will show *LIBL and *CURLIB, but only Generic library prompts will support *ALL, *ALLUSR and *USRLIBL.

See Also:
setLibraryChangeListener(IQSYSLibraryPromptListener)

Field Summary
protected  boolean allowCurLib
           
protected  boolean allowGeneric
           
protected  boolean allowLibl
           
static String copyright
           
protected  ValidatorIBMiLibrary libValidator
           
protected  IQSYSLibraryPromptListener listener
           
 
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
 
Constructor Summary
QSYSLibraryPrompt(Composite parent)
          Constructor when generic names are allowed and no special style is desired for the composite
QSYSLibraryPrompt(Composite parent, int style)
          Constructor when generic names are allowed
QSYSLibraryPrompt(Composite parent, int style, boolean allowSpecialAndGenericLibs)
          Constructor when you only want to allow real library names, not generic or *libl or *curlib, or you want to allow everything including *libl, *curlib, *alllibl, *usrlibl, etc
QSYSLibraryPrompt(Composite parent, int style, boolean allowGeneric, boolean allowLibl)
          Constructor with all possible options
QSYSLibraryPrompt(Composite parent, int style, boolean allowGeneric, boolean allowLibl, String historyKey)
          Constructor with all possible options including ability to specify your own history key to use
QSYSLibraryPrompt(Composite parent, int style, boolean allowSpecialAndGenericLibs, String historyKey)
          Constructor when you only want to allow real library names, not generic or *libl or *curlib and want to specify your own history key for the combo, or you want to allow everything including *libl, *curlib, *alllibl, *usrlibl, etc
 
Method Summary
protected  void addOurButtonSelectionListener()
          Library's Browse button pressed handler
 boolean allowsGeneric()
          Returns whether generics are allowed.
protected  IIBMiSelectAction getBrowseAction(Shell shell, IHost defaultConnection, boolean onlyConnection)
          Overridable method.
 String getLibraryName()
          Get the user entered or selected library name.
 ValidatorIBMiLibrary getLibraryValidator()
          Get the library validator in case you want to effect it.
protected  void populateCombo(SystemHistoryCombo combo, boolean allowGeneric, boolean allowLibl)
          Populates the library combo.
 void removeLibraryChangeListener()
          Clear listener set by call to setLibraryChangeListener
 void setDefaultConnection(IHost defaultConnection)
          Set the default connection to preselect when Browse is pressed.
 void setIHost(IHost onlyConnection)
          Set the system connection to use when Browse is pressed.
 void setLibraryChangeListener(IQSYSLibraryPromptListener listener)
          Identify caller that is interested in being informed of live error checking status
 void setLibraryName(String name)
          Set the library name displayed in the combo box.
 void setLibraryPromptLabel(String label)
          Set the library prompt label.
 void setLibraryValidator(ValidatorIBMiLibrary libValidator)
          Set the library validator for syntax checking.
 SystemMessage validateLibInput()
          Validate library 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.QSYSBasePrompt
addBrowseButtonSelectionListener, addModifyListener, addSelectionChangedListener, addSelectionListener, createCombo, createHistoryCombo, createPushButton, createPushButton, getBrowseButton, getCombo, getGridColumns, getItems, getPromptLabel, getSelection, getText, lineUpWith, lineUpWith, prepareComposite, removeBrowseButtonSelectionListener, removeModifyListener, removeSelectionChangedListener, removeSelectionListener, setBrowseButtonFocus, setBrowseButtonLabel, setBrowseButtonToolTipText, setButtonWidthHint, setButtonWidthHint, setEnabled, setFocus, setHost, setIgnoreChanges, setItems, setPromptLabel, setSelection, setShowNewConnectionPrompt, setText, setToolTipText, setWidthHint, showBrowseButton, showBrowseButton, updateHistory, 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

allowGeneric

protected boolean allowGeneric

allowLibl

protected boolean allowLibl

allowCurLib

protected boolean allowCurLib

listener

protected IQSYSLibraryPromptListener listener

libValidator

protected ValidatorIBMiLibrary libValidator
Constructor Detail

QSYSLibraryPrompt

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

Parameters:
parent - Parent composite
See Also:
#setDefaultHost(IHost)

QSYSLibraryPrompt

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

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
See Also:
#setDefaultHost(IHost)

QSYSLibraryPrompt

public QSYSLibraryPrompt(Composite parent,
                         int style,
                         boolean allowSpecialAndGenericLibs)
Constructor when you only want to allow real library names, not generic or *libl or *curlib, or you want to allow everything including *libl, *curlib, *alllibl, *usrlibl, etc

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
boolean - Pass false to only allow a real library name, pass true to allow generic names and *CURLIB and *LIBL
See Also:
#setDefaultHost(IHost)

QSYSLibraryPrompt

public QSYSLibraryPrompt(Composite parent,
                         int style,
                         boolean allowSpecialAndGenericLibs,
                         String historyKey)
Constructor when you only want to allow real library names, not generic or *libl or *curlib and want to specify your own history key for the combo, or you want to allow everything including *libl, *curlib, *alllibl, *usrlibl, etc

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
boolean - Pass false to only allow a real library name, pass true to allow generic names and *CURLIB and *LIBL
historyKey - The key to use for the history, or null to use our default. Only needed if you want a unique history.
See Also:
#setDefaultHost(IHost)

QSYSLibraryPrompt

public QSYSLibraryPrompt(Composite parent,
                         int style,
                         boolean allowGeneric,
                         boolean allowLibl)
Constructor with all possible options

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
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"
See Also:
#setDefaultHost(IHost)

QSYSLibraryPrompt

public QSYSLibraryPrompt(Composite parent,
                         int style,
                         boolean allowGeneric,
                         boolean allowLibl,
                         String historyKey)
Constructor with all possible options including ability to specify your own history key to use

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
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"
historyKey - The key to use for the history, or null to use our default. Only needed if you want a unique history.
See Also:
#setDefaultHost(IHost)
Method Detail

setLibraryChangeListener

public void setLibraryChangeListener(IQSYSLibraryPromptListener listener)
Identify caller that is interested in being informed of live error checking status


removeLibraryChangeListener

public void removeLibraryChangeListener()
Clear listener set by call to setLibraryChangeListener


setDefaultConnection

public void setDefaultConnection(IHost defaultConnection)
Set the default connection to preselect when Browse is pressed. This still allows users to select or create other connections.

Overrides:
setDefaultConnection in class QSYSBasePrompt
See Also:
setIHost(IHost)

setIHost

public void setIHost(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.

See Also:
#setDefaultHost(IHost)

setLibraryPromptLabel

public void setLibraryPromptLabel(String label)
Set the library prompt label. Default is "Library:"


getLibraryName

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


setLibraryName

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


setLibraryValidator

public void setLibraryValidator(ValidatorIBMiLibrary libValidator)
Set the library validator for syntax checking. There is one supplied for you so you rarely need to call this.


getLibraryValidator

public ValidatorIBMiLibrary getLibraryValidator()
Get the library validator in case you want to effect it.


allowsGeneric

public boolean allowsGeneric()
Returns whether generics are allowed.


getBrowseAction

protected IIBMiSelectAction getBrowseAction(Shell shell,
                                            IHost defaultConnection,
                                            boolean onlyConnection)
Overridable method. Internal use. Returns action to be called when Browse... pressed.

Specified by:
getBrowseAction in class QSYSBasePrompt

populateCombo

protected void populateCombo(SystemHistoryCombo combo,
                             boolean allowGeneric,
                             boolean allowLibl)
Populates the library combo. Internal use.


addOurButtonSelectionListener

protected void addOurButtonSelectionListener()
Library's Browse button pressed handler

Overrides:
addOurButtonSelectionListener in class QSYSBasePrompt

validateLibInput

public SystemMessage validateLibInput()
Validate library 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.