|
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.ObjectComposite
com.ibm.etools.iseries.rse.ui.widgets.QSYSBasePrompt
public abstract class QSYSBasePrompt
This is a base class for a re-usable composite widget for prompting the user for a remote object name. The composite is layed as follows:
pppppppp: ______________________v Browse...
Child classes specify the prompt label and tooltip, the combo contents and the browse-button action.
Field Summary | |
---|---|
protected IIBMiSelectAction |
browseAction
|
protected Button |
browseButton
|
static String |
copyright
|
protected IHost |
defaultConnection
|
protected boolean |
enableBrowse
|
protected int |
gridColumns
|
protected boolean |
ignoreChanges
|
protected boolean |
onlyConnection
|
protected SystemHistoryCombo |
promptCombo
|
protected Label |
promptLabel
|
protected ResourceBundle |
rb
|
protected boolean |
showNewConnection
|
protected boolean |
testing
|
Constructor Summary | |
---|---|
QSYSBasePrompt(Composite parent,
int style,
String historyKey,
IHost defaultConnection,
String label,
String tooltip,
String browseLabel,
String browseTooltip)
Constructor when the default connection is already known |
|
QSYSBasePrompt(Composite parent,
int style,
String historyKey,
String label,
String tooltip,
String browseLabel,
String browseTooltip)
Constructor when the default connection is not yet known |
Method Summary | |
---|---|
void |
addBrowseButtonSelectionListener(SelectionListener listener)
Register a listener interested in when the browse button is selected |
void |
addModifyListener(ModifyListener listener)
Register a listener interested in entry field modify events |
protected void |
addOurButtonSelectionListener()
|
void |
addSelectionChangedListener(ISelectionChangedListener listener)
Register a listener interested in an item is selected in the combo box |
void |
addSelectionListener(SelectionListener listener)
Register a listener interested in an item is selected in the combo box |
static Combo |
createCombo(Composite parent,
boolean readonly)
Creates a new combobox instance and sets the default layout data. |
static SystemHistoryCombo |
createHistoryCombo(Composite parent,
String key,
boolean readonly)
Creates a new historical combobox instance and sets the default layout data. |
protected static Button |
createPushButton(Composite group,
ResourceBundle bundle,
String key)
|
protected static Button |
createPushButton(Composite group,
String label)
|
protected abstract IIBMiSelectAction |
getBrowseAction(Shell shell,
IHost defaultConnection,
boolean onlyConnection)
Overridable method. |
Button |
getBrowseButton()
Return the Browse... |
SystemHistoryCombo |
getCombo()
Return the combo box widget |
int |
getGridColumns()
Return the number of grid data columns within this composite. |
String[] |
getItems()
Get the items in the combo field |
Label |
getPromptLabel()
Get the prompt Label object |
ISelection |
getSelection()
|
String |
getText()
Get the user entered or selected name. |
void |
lineUpWith(IBMiConnectionCombo otherWidget)
If a composite widget like this is used more than once on the same page, it is nice to line up the columns. |
void |
lineUpWith(QSYSBasePrompt otherWidget)
If a composite widget like this is used more than once on the same page, it is nice to line up the columns. |
protected Composite |
prepareComposite(int numColumns)
Prepares this composite control and sets the default layout data. |
void |
removeBrowseButtonSelectionListener(SelectionListener listener)
Remove a previously set browse button selection listener. |
void |
removeModifyListener(ModifyListener listener)
Remove a previously set entry field listener. |
void |
removeSelectionChangedListener(ISelectionChangedListener listener)
Remove a previously set combo box selection listener. |
void |
removeSelectionListener(SelectionListener listener)
Remove a previously set combo box selection listener. |
void |
setBrowseButtonFocus()
Set the focus to the browse button |
void |
setBrowseButtonLabel(String label)
Set the tooltip text for the browse button |
void |
setBrowseButtonToolTipText(String tip)
Set the tooltip text for the browse button |
void |
setButtonWidthHint(Control otherWidget)
Set button width hint, based on the width of another widget |
void |
setButtonWidthHint(int widthHint)
Set button width hint |
void |
setDefaultConnection(IHost defaultConnection)
Set the default connection to preselect when Browse is pressed. |
void |
setEnabled(boolean enabled)
Disable/Enable all the child controls. |
boolean |
setFocus()
Set the focus to the combo field |
void |
setHost(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 |
setIgnoreChanges(boolean ignoreChanges)
Turn on or off ignore changes mode. |
void |
setItems(String[] items)
Set the items in the combo field |
void |
setPromptLabel(String label)
Set the prompt label |
void |
setSelection(ISelection selection)
|
void |
setShowNewConnectionPrompt(boolean showNewConnection)
Sets whether a "New Connection..." special connection is shown in the tree when Browse is pressed. |
void |
setText(String name)
Set the name displayed in the combo box |
void |
setToolTipText(String tip)
Set the tooltip text for the combo field |
void |
setWidthHint(int widthHint)
Set the width hint for this whole composite Default is computed from children by the layout. |
boolean |
showBrowseButton()
Return whether or not we are to show the browse button |
void |
showBrowseButton(boolean show)
Enable or disable the showing of the Browse button. |
void |
updateHistory()
Update the history with current entry field setting. |
void |
updateHistory(boolean refresh)
Update the history with current entry field setting and refresh the ui to reflect it. |
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 promptLabel
protected SystemHistoryCombo promptCombo
protected Button browseButton
protected int gridColumns
protected IHost defaultConnection
protected IIBMiSelectAction browseAction
protected ResourceBundle rb
protected boolean onlyConnection
protected boolean enableBrowse
protected boolean testing
protected boolean ignoreChanges
protected boolean showNewConnection
Constructor Detail |
---|
public QSYSBasePrompt(Composite parent, int style, String historyKey, String label, String tooltip, String browseLabel, String browseTooltip)
parent
- Parent compositestyle
- The SWT style flags for overall composite widget. Typically just pass SWT.NULLhistoryKey
- The key to use to save and restore historical values for the combo widgetrb
- The resourcebundle from which to get the label and tooltiprbLabelKey
- The label key root for the resource bundle strings. We will append "label" and "tooltip"
to get the prompt text and tooltip text for the combo field.rbBrowseKey
- The browse button key root for the resource bundle strings. We will append "label" and "tooltip"
to get the button text and tooltip text.public QSYSBasePrompt(Composite parent, int style, String historyKey, IHost defaultConnection, String label, String tooltip, String browseLabel, String browseTooltip)
parent
- Parent compositestyle
- The SWT style flags for overall composite widget. Typically just pass SWT.NULLhistoryKey
- The key to use to save and restore historical values for the combo widgetdefaultConnection
- The system connection to preselect when Browse is pressed.rb
- The resourcebundle from which to get the label and tooltiprbLabelKey
- The label key root for the resource bundle strings. We will append "label" and "tooltip"
to get the prompt text and tooltip text for the combo field.rbBrowseKey
- The browse button key root for the resource bundle strings. We will append "label" and "tooltip"
to get the button text and tooltip text.Method Detail |
---|
public void lineUpWith(QSYSBasePrompt otherWidget)
public void lineUpWith(IBMiConnectionCombo otherWidget)
public void setDefaultConnection(IHost defaultConnection)
#setSystemConnection(SystemConnection)
, this method assumes the
user is allowed to choose from multiple connections, and we are merely defaulting
the selection to this one.
#setSystemConnection(SystemConnection)
public void setBrowseButtonLabel(String label)
public void setHost(IHost onlyConnection)
setShowNewConnectionPrompt(boolean)
.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 setShowNewConnectionPrompt(boolean)
with false.
#setDefaultConnection(SystemConnection)
,
setShowNewConnectionPrompt(boolean)
public void showBrowseButton(boolean show)
setShowNewConnectionPrompt(boolean)
public boolean showBrowseButton()
public void setShowNewConnectionPrompt(boolean showNewConnection)
showNewConnection
- - true to allow users to create a new connection while browsing, false o/wshowBrowseButton(boolean)
public void setIgnoreChanges(boolean ignoreChanges)
protected abstract IIBMiSelectAction getBrowseAction(Shell shell, IHost defaultConnection, boolean onlyConnection)
public void setText(String name)
public String getText()
public SystemHistoryCombo getCombo()
public void setWidthHint(int widthHint)
public void setButtonWidthHint(int widthHint)
public void setButtonWidthHint(Control otherWidget)
public int getGridColumns()
public Button getBrowseButton()
public void setItems(String[] items)
public String[] getItems()
public void setEnabled(boolean enabled)
public void setPromptLabel(String label)
public Label getPromptLabel()
public void setToolTipText(String tip)
public void setBrowseButtonToolTipText(String tip)
public boolean setFocus()
public void setBrowseButtonFocus()
public void addSelectionListener(SelectionListener listener)
removeSelectionListener(SelectionListener)
public void removeSelectionListener(SelectionListener listener)
addSelectionListener(SelectionListener)
public void addBrowseButtonSelectionListener(SelectionListener listener)
#removeNewButtonSelectionListener(SelectionListener)
public void removeBrowseButtonSelectionListener(SelectionListener listener)
#addNewButtonSelectionListener(SelectionListener)
public void addModifyListener(ModifyListener listener)
removeModifyListener(ModifyListener)
public void removeModifyListener(ModifyListener listener)
addModifyListener(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.
public void updateHistory(boolean refresh)
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.
protected Composite prepareComposite(int numColumns)
Number
- of columns the new group will contain.public static Combo createCombo(Composite parent, boolean readonly)
Does NOT set the widthHint as that causes problems. Instead the combo will consume what space is available within this composite.
parent
- composite to put the button into.public static SystemHistoryCombo createHistoryCombo(Composite parent, String key, boolean readonly)
Does NOT set the widthHint as that causes problems. Instead the combo will consume what space is available within this composite.
parent
- composite to put the button into.protected static Button createPushButton(Composite group, String label)
protected static Button createPushButton(Composite group, ResourceBundle bundle, String key)
protected void addOurButtonSelectionListener()
public void addSelectionChangedListener(ISelectionChangedListener listener)
#removeSelectionChangedListener(SelectionChangedListener)
public void removeSelectionChangedListener(ISelectionChangedListener listener)
#addSelectionChangedListener(SelectionChangedListener)
public ISelection getSelection()
public void setSelection(ISelection selection)
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |