|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Composite com.ibm.etools.iseries.rse.ui.widgets.QSYSBasePrompt com.ibm.etools.iseries.rse.ui.widgets.QSYSObjectPrompt
public class QSYSObjectPrompt
This re-usable composite widget is for prompting the user for an object name. The object 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 objects are qualified by library names so this also prompts for the library.
The composite is layed as follows:
Library: ______________________v Browse...
Object : ______________________v Browse...
You must specify whether this prompt is for a generic object name like ABC* or a scalar object name like ABC1. Beyond appropriate error checking it also affects the special-values contents of the dropdown.
setObjectChangeListener(IQSYSObjectPromptListener)
Field Summary | |
---|---|
protected boolean |
allowGeneric
|
protected boolean |
allowLibl
|
protected IQSYSSelectObjectAction |
browseObjectAction
|
protected Button |
browseObjectButton
|
static String |
copyright
|
protected ISeriesObjectFilterString |
filterString
|
protected String |
historyKey
|
protected String |
libHistoryKey
|
protected String |
libName
|
protected ValidatorIBMiLibrary |
libValidator
|
protected IQSYSObjectPromptListener |
listener
|
protected String |
objectName
|
protected String[] |
objTypes
|
protected ValidatorIBMiObject |
objValidator
|
protected SystemHistoryCombo |
promptObjectCombo
|
protected Label |
promptObjectLabel
|
Fields inherited from class com.ibm.etools.iseries.rse.ui.widgets.QSYSBasePrompt |
---|
browseAction, browseButton, defaultConnection, enableBrowse, gridColumns, ignoreChanges, onlyConnection, promptCombo, promptLabel, rb, showNewConnection, testing |
Constructor Summary | |
---|---|
QSYSObjectPrompt(Composite parent)
Constructor when generic names are allowed and no special style is desired for the composite |
|
QSYSObjectPrompt(Composite parent,
int style)
Constructor when generic names are allowed |
|
QSYSObjectPrompt(Composite parent,
int style,
boolean allowGeneric,
boolean allowLibl)
Constructor when you want to affect whether generic and *LIBL names are allowed for the library |
|
QSYSObjectPrompt(Composite parent,
int style,
boolean allowGeneric,
boolean allowLibl,
String libraryHistoryKey,
String objectHistoryKey)
Full constructor when you want to affect whether generic and *LIBL names are allowed for the library, and you want to specify unique history keys for the combo boxes. |
Method Summary | |
---|---|
void |
addBrowseButtonSelectionListener(SelectionListener listener)
Register a listener interested in when the either the library or object browse button is selected |
void |
addLibraryModifyListener(ModifyListener listener)
Register a listener interested in library entry field modify events |
protected void |
addObjectButtonSelectionListener()
Enables our browse button for objects. |
void |
addObjectModifyListener(ModifyListener listener)
Register a listener interested in object entry field modify events |
protected void |
addOurButtonSelectionListener()
Library's Browse button pressed handler |
void |
addSelectionListener(SelectionListener listener)
Register a listener interested in an item is selected in either the library combo box or the object combo box |
boolean |
allowsGeneric()
Returns whether generics are allowed. |
protected void |
createObjectWidgets(boolean allowGeneric)
Create our unique object-related widgets. |
protected IIBMiSelectAction |
getBrowseAction(Shell shell,
IHost defaultConnection,
boolean onlyConnection)
Overridable method. |
Button |
getLibraryBrowseButton()
Return the library Browse... |
SystemHistoryCombo |
getLibraryCombo()
Return the combo box widget for the library prompt |
String |
getLibraryName()
Get the user entered or selected library name. |
Label |
getLibraryPromptLabel()
Return the library prompt label widget. |
protected IQSYSSelectObjectAction |
getObjectBrowseAction(Shell shell,
IHost defaultConnection,
boolean onlyConnection)
Overridable method. |
Button |
getObjectBrowseButton()
Return the object Browse... |
SystemHistoryCombo |
getObjectCombo()
Return the combo box widget for the object prompt |
protected ISeriesObjectFilterString |
getObjectFilterString()
Get the object filter string to use in building the quick filter string. |
String[] |
getObjectItems()
Get the items in the object combo field |
String |
getObjectName()
Get the user entered or selected object name. |
Label |
getObjectPromptLabel()
Return the object prompt label widget |
protected String[] |
getObjectTypes()
Override from parent so we can set the file types for the browse button's default filter |
String |
getQualifiedName()
Get the qualified name: lib/obj |
protected void |
init(boolean allowGeneric,
boolean allowLibl)
Do initialization. |
protected boolean |
isSpecialName(String nameWithAsterisk)
Overridable method to distinguish between a generic name like *A and a special name like *USRPRF |
protected void |
populateLibraryCombo(SystemHistoryCombo combo,
boolean allowGeneric,
boolean allowLibl)
Populates our library combo. |
protected void |
populateObjectCombo(SystemHistoryCombo combo,
boolean allowGeneric)
Populates our object combo. |
void |
removeBrowseButtonSelectionListener(SelectionListener listener)
Remove a previously set browse button selection listener. |
void |
removeLibraryModifyListener(ModifyListener listener)
Remove a previously set library entry field listener. |
void |
removeObjectChangeListener()
Remove object change listener previously set in setProgramChangeListener |
void |
removeObjectModifyListener(ModifyListener listener)
Remove a previously set object entry field listener. |
void |
removeSelectionListener(SelectionListener listener)
Remove a previously set combo box selection listener. |
void |
setDefaultConnection(IHost defaultConnection)
Set the default connection to preselect when Browse is pressed. |
void |
setEnabled(boolean enabled)
Disable/Enable all the child controls. |
void |
setLibraryBrowseButtonFocus()
Set the focus to the library browse button |
void |
setLibraryBrowseButtonToolTipText(String tip)
Set the tooltip text for the library browse button |
boolean |
setLibraryFocus()
Set the focus to the library combo field |
void |
setLibraryItems(String[] items)
Set the items in the library combo field |
void |
setLibraryName(String name)
Set the library name displayed in the combo box. |
void |
setLibraryPromptLabel(String label)
Set the Library prompt label text |
void |
setLibraryToolTipText(String tip)
Set the tooltip text for the library combo field |
void |
setLibraryValidator(ValidatorIBMiLibrary libValidator)
Set the library validator for syntax checking There is one supplied for you so you rarely need to call this. |
void |
setObjectBrowseButtonFocus()
Set the focus to the object browse button |
void |
setObjectBrowseButtonToolTipText(String tip)
Set the tooltip text for the object browse button |
void |
setObjectChangeListener(IQSYSObjectPromptListener listener)
Identify caller that is interested in being informed of live error checking status. |
boolean |
setObjectFocus()
Set the focus to the object combo field |
void |
setObjectItems(String[] items)
Set the items in the object combo field |
void |
setObjectName(String name)
Set the object name displayed in the combo box. |
void |
setObjectPromptLabel(String label)
Set the Object prompt label text |
void |
setObjectToolTipText(String tip)
Set the tooltip text for the object combo field |
void |
setObjectTypes(String[] types)
Set the object types to filter by. |
void |
setObjectValidator(ValidatorIBMiObject objValidator)
Set the object 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 |
validateObjInput()
Validate object string, as it is typed, or in batch if you wish to call directly. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String copyright
protected Label promptObjectLabel
protected SystemHistoryCombo promptObjectCombo
protected Button browseObjectButton
protected IQSYSObjectPromptListener listener
protected boolean allowGeneric
protected boolean allowLibl
protected String[] objTypes
protected ISeriesObjectFilterString filterString
protected ValidatorIBMiLibrary libValidator
protected ValidatorIBMiObject objValidator
protected IQSYSSelectObjectAction browseObjectAction
protected String historyKey
protected String libHistoryKey
protected String objectName
protected String libName
Constructor Detail |
---|
public QSYSObjectPrompt(Composite parent)
parent
- Parent composite#setDefaultConnection(SystemConnection)
public QSYSObjectPrompt(Composite parent, int style)
parent
- Parent compositestyle
- The SWT style flags for overall composite widget. Typically just pass SWT.NULL#setDefaultConnection(SystemConnection)
public QSYSObjectPrompt(Composite parent, int style, boolean allowGeneric, boolean allowLibl)
parent
- Parent compositestyle
- The SWT style flags for overall composite widget. Typically just pass SWT.NULLdefaultConnection
- The system connection to preselect when Browse is pressed.allowGeneric
- Pass true to allow generic names in the entry fieldallowLibl
- Pass false if allowGeneric is false, to restrict user from entering/selecting "*LIBL" for the library#setDefaultConnection(SystemConnection)
public QSYSObjectPrompt(Composite parent, int style, boolean allowGeneric, boolean allowLibl, String libraryHistoryKey, String objectHistoryKey)
parent
- Parent compositestyle
- The SWT style flags for overall composite widget. Typically just pass SWT.NULLdefaultConnection
- The system connection to preselect when Browse is pressed.allowGeneric
- Pass true to allow generic names in the entry fieldallowLibl
- Pass false if allowGeneric is false, to restrict user from entering/selecting "*LIBL" for the librarylibraryHistoryKey
- Pass the key value to use for the library combo, or null to use the default supplied keyobjectHistoryKey
- Pass the key value to use for the object combo, or null to use the default supplied key#setDefaultConnection(SystemConnection)
,
SystemHistoryCombo#setDefaultHistory(String[])
Method Detail |
---|
public void setObjectChangeListener(IQSYSObjectPromptListener listener)
public void removeObjectChangeListener()
public void setDefaultConnection(IHost defaultConnection)
setDefaultConnection
in class QSYSBasePrompt
#setSystemConnection(SystemConnection)
public SystemHistoryCombo getLibraryCombo()
public SystemHistoryCombo getObjectCombo()
public String getLibraryName()
QSYSBasePrompt.getText()
public void setLibraryName(String name)
QSYSBasePrompt.setText(String)
public String getObjectName()
QSYSBasePrompt.getText()
public void setObjectName(String name)
QSYSBasePrompt.setText(String)
public void setObjectTypes(String[] types)
public String getQualifiedName()
public Button getLibraryBrowseButton()
public Button getObjectBrowseButton()
public void setLibraryItems(String[] items)
public void setObjectItems(String[] items)
public String[] getObjectItems()
public void setSystemConnection(IHost onlyConnection)
QSYSBasePrompt.setShowNewConnectionPrompt(boolean)
.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.
#setDefaultConnection(SystemConnection)
,
QSYSBasePrompt.setShowNewConnectionPrompt(boolean)
public void setEnabled(boolean enabled)
setEnabled
in class QSYSBasePrompt
public void setLibraryPromptLabel(String label)
public void setObjectPromptLabel(String label)
public Label getLibraryPromptLabel()
public Label getObjectPromptLabel()
public void setLibraryToolTipText(String tip)
public void setObjectToolTipText(String tip)
public void setLibraryBrowseButtonToolTipText(String tip)
public void setObjectBrowseButtonToolTipText(String tip)
public boolean setLibraryFocus()
public boolean setObjectFocus()
public void setLibraryBrowseButtonFocus()
public void setObjectBrowseButtonFocus()
public void addSelectionListener(SelectionListener listener)
addSelectionListener
in class QSYSBasePrompt
removeSelectionListener(SelectionListener)
public void removeSelectionListener(SelectionListener listener)
removeSelectionListener
in class QSYSBasePrompt
addSelectionListener(SelectionListener)
public void addBrowseButtonSelectionListener(SelectionListener listener)
addBrowseButtonSelectionListener
in class QSYSBasePrompt
#removeNewButtonSelectionListener(SelectionListener)
public void removeBrowseButtonSelectionListener(SelectionListener listener)
removeBrowseButtonSelectionListener
in class QSYSBasePrompt
#addNewButtonSelectionListener(SelectionListener)
public void addLibraryModifyListener(ModifyListener listener)
removeLibraryModifyListener(ModifyListener)
public void addObjectModifyListener(ModifyListener listener)
removeObjectModifyListener(ModifyListener)
public void removeLibraryModifyListener(ModifyListener listener)
addLibraryModifyListener(ModifyListener)
public void removeObjectModifyListener(ModifyListener listener)
addObjectModifyListener(ModifyListener)
public void updateHistory()
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.
updateHistory
in class QSYSBasePrompt
public void setLibraryValidator(ValidatorIBMiLibrary libValidator)
public void setObjectValidator(ValidatorIBMiObject objValidator)
protected void createObjectWidgets(boolean allowGeneric)
protected void init(boolean allowGeneric, boolean allowLibl)
public boolean allowsGeneric()
protected IIBMiSelectAction getBrowseAction(Shell shell, IHost defaultConnection, boolean onlyConnection)
getBrowseAction
in class QSYSBasePrompt
protected IQSYSSelectObjectAction getObjectBrowseAction(Shell shell, IHost defaultConnection, boolean onlyConnection)
protected void populateLibraryCombo(SystemHistoryCombo combo, boolean allowGeneric, boolean allowLibl)
protected void populateObjectCombo(SystemHistoryCombo combo, boolean allowGeneric)
protected void addOurButtonSelectionListener()
addOurButtonSelectionListener
in class QSYSBasePrompt
protected void addObjectButtonSelectionListener()
protected boolean isSpecialName(String nameWithAsterisk)
protected String[] getObjectTypes()
protected ISeriesObjectFilterString getObjectFilterString()
public SystemMessage validateLibInput()
public SystemMessage validateObjInput()
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |