Rational Developer for Power Systems Software
V7.6

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

java.lang.Object
  extended by Composite
      extended by com.ibm.etools.iseries.rse.ui.widgets.QSYSCCSIDPrompt

public class QSYSCCSIDPrompt
extends Composite

This is a base class for a re-usable composite widget for prompting the user for a CCSID. This is a common parameter on a number of iSeries commands.

The composite is layed as follows:


   pppppppp: ______________________v  
 

Child classes specify the prompt label and tooltip


Field Summary
protected static String[] CCSID_VALUES_WITH_CMDDFT
           
protected static String[] CCSID_VALUES_WITHOUT_CMDDFT
           
protected  ValidatorQSYSCCSIDValue ccsidValidator
           
static String copyright
           
protected  Label fillerLabel
           
protected  int gridColumns
           
protected  IQSYSCCSIDPromptListener listener
           
protected  Combo promptCombo
           
protected  Label promptLabel
           
protected  boolean showCmdDft
           
protected  boolean testing
           
 
Constructor Summary
QSYSCCSIDPrompt(Composite parent, int style)
          Constructor when *CMDDFT is to be shown as an option in the list
QSYSCCSIDPrompt(Composite parent, int style, boolean showCmdDft)
          Constructor when *CMDDFT is not to be shown as an option in the list
QSYSCCSIDPrompt(Composite parent, int style, boolean showCmdDft, int fillerLabelSpan)
          Constructor that allows for a filler label at the end for the purpose of lining up the combo to be the same size as the combo for other composite widgets that have a button to their right.
 
Method Summary
 void addModifyListener(ModifyListener listener)
          Register a listener interested in entry field modify events
 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.
 Combo 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.
 void lineUpWith(QSYSCCSIDPrompt 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 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 setCCSIDChangeListener(IQSYSCCSIDPromptListener listener)
          Identify caller that is interested in being informed of live error checking status
 void setEnabled(boolean enabled)
          Disable/Enable all the child controls.
 void setFillerLabelWidthHint(Control otherWidget)
          Set filler label width hint, based on the width of another widget
 void setFillerLabelWidthHint(int widthHint)
          Set filler label width hint
 boolean setFocus()
          Set the focus to the combo field
 void setItems(String[] items)
          Set the items in the combo field
 void setPromptLabel(String label)
          Set the prompt label
 void setSelection(ISelection selection)
           
 void setText(String name)
          Set the value 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.
 SystemMessage validateCCSIDInput()
          Validate CCSID values as they are entered
 
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

promptLabel

protected Label promptLabel

promptCombo

protected Combo promptCombo

fillerLabel

protected Label fillerLabel

gridColumns

protected int gridColumns

showCmdDft

protected boolean showCmdDft

testing

protected boolean testing

ccsidValidator

protected ValidatorQSYSCCSIDValue ccsidValidator

listener

protected IQSYSCCSIDPromptListener listener

CCSID_VALUES_WITH_CMDDFT

protected static final String[] CCSID_VALUES_WITH_CMDDFT

CCSID_VALUES_WITHOUT_CMDDFT

protected static final String[] CCSID_VALUES_WITHOUT_CMDDFT
Constructor Detail

QSYSCCSIDPrompt

public QSYSCCSIDPrompt(Composite parent,
                       int style)
Constructor when *CMDDFT is to be shown as an option in the list

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL

QSYSCCSIDPrompt

public QSYSCCSIDPrompt(Composite parent,
                       int style,
                       boolean showCmdDft)
Constructor when *CMDDFT is not to be shown as an option in the list

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
showCmdDft - True if you want "*CMDDFT" as an option in the list

QSYSCCSIDPrompt

public QSYSCCSIDPrompt(Composite parent,
                       int style,
                       boolean showCmdDft,
                       int fillerLabelSpan)
Constructor that allows for a filler label at the end for the purpose of lining up the combo to be the same size as the combo for other composite widgets that have a button to their right. The filler label has blanks for the text so is not visible.

Parameters:
parent - Parent composite
style - The SWT style flags for overall composite widget. Typically just pass SWT.NULL
showCmdDft - True if you want "*CMDDFT" as an option in the list
fillerLabelSpan - The number of columns the filler label is to span
Method Detail

lineUpWith

public 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. This method will do that, given the first composite widget. The trick to this though is that we need to know the size of other composite, which is not known until after the controls are all layed out. So only call this after all controls have been added to your dialog/wizard content area.


lineUpWith

public void lineUpWith(QSYSCCSIDPrompt otherWidget)
If a composite widget like this is used more than once on the same page, it is nice to line up the columns. This method will do that, given the first composite widget. The trick to this though is that we need to know the size of other composite, which is not known until after the controls are all layed out. So only call this after all controls have been added to your dialog/wizard content area.


lineUpWith

public 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. This method will do that, given the first composite widget. The trick to this though is that we need to know the size of other composite, which is not known until after the controls are all layed out. So only call this after all controls have been added to your dialog/wizard content area.


setText

public void setText(String name)
Set the value displayed in the combo box


getText

public String getText()
Get the user entered or selected name.


getCombo

public Combo getCombo()
Return the combo box widget


setWidthHint

public void setWidthHint(int widthHint)
Set the width hint for this whole composite Default is computed from children by the layout. Do not set this lightly, as it may cause problems with translated flavors.


setFillerLabelWidthHint

public void setFillerLabelWidthHint(int widthHint)
Set filler label width hint


setFillerLabelWidthHint

public void setFillerLabelWidthHint(Control otherWidget)
Set filler label width hint, based on the width of another widget


getGridColumns

public int getGridColumns()
Return the number of grid data columns within this composite. Will vary depending if there is a New button or not.


setItems

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


getItems

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


setEnabled

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


setPromptLabel

public void setPromptLabel(String label)
Set the prompt label


getPromptLabel

public Label getPromptLabel()
Get the prompt Label object


setToolTipText

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


setFocus

public boolean setFocus()
Set the focus to the combo field


setCCSIDChangeListener

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


addSelectionListener

public void addSelectionListener(SelectionListener listener)
Register a listener interested in an item is selected in the combo box

See Also:
removeSelectionListener(SelectionListener)

removeSelectionListener

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

See Also:
addSelectionListener(SelectionListener)

addModifyListener

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

See Also:
removeModifyListener(ModifyListener)

removeModifyListener

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

See Also:
addModifyListener(ModifyListener)

prepareComposite

protected Composite prepareComposite(int numColumns)
Prepares this composite control and sets the default layout data.

Parameters:
Number - of columns the new group will contain.

createCombo

public static Combo createCombo(Composite parent,
                                boolean readonly)
Creates a new combobox instance and sets the default layout data.

Does NOT set the widthHint as that causes problems. Instead the combo will consume what space is available within this composite.

Parameters:
parent - composite to put the button into.

addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)
Register a listener interested in an item is selected in the combo box

See Also:
#removeSelectionChangedListener(SelectionChangedListener)

removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)
Remove a previously set combo box selection listener.

See Also:
#addSelectionChangedListener(SelectionChangedListener)

getSelection

public ISelection getSelection()

setSelection

public void setSelection(ISelection selection)

validateCCSIDInput

public SystemMessage validateCCSIDInput()
Validate CCSID values as they are entered


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.