com.ibm.hi.customizer.beans.scci
Interface SCSelection

All Superinterfaces:
SCCustomComponent
All Known Subinterfaces:
SCChoice, SCList, SCRadioButton, SCSelectionList

public interface SCSelection
extends SCCustomComponent

SCSelection is the parent interface of the "selection" components: SCRadioButton, SCChoice, and SCList. Each of these components has a list of possible choices (of which one may be selected at a time) and a value sent to the host. Each item in the selection has two properties associated with it: the "displayText", which is what will be displayed to the user, and the "sendText", which is the String sent to the host upon selection.

See Also:
SCSelectionList, SCRadioButton

Method Summary
 java.lang.String getDisplayText()
          Get the selected displayText from the list.
 java.lang.String getDisplayText(int index)
          Gets the displayText at the specified index.
 int getItemCount()
          Gets the number of items in the list.
 int getSelectedIndex()
          Gets the index of the selected item.
 java.lang.String getSendText()
          Gets the selected sendText from the list.
 java.lang.String getSendText(int index)
          Gets the sendText at the specified index.
 boolean isIndexSelected(int index)
          Checks whether an index is selected.
 void select(int index)
          Selects the item at the specified index.
 void selectDisplayText(java.lang.String displayText)
          Selects the first occurrence of the specified displayText in the list.
 void selectItem(java.lang.String displayText, java.lang.String sendText)
          Selects the first occurrence of the specified displayText/sendText combination in the list.
 void selectSendText(java.lang.String sendText)
          Selects the first occurrence of the specified sendText in the list.
 void setDisplayText(java.lang.String displayText, int index)
          Replaces the displayText at the specified index.
 void setItem(java.lang.String displayText, java.lang.String sendText, int index)
          Replaces the displayText and sendText at the specified index.
 void setSendText(java.lang.String sendText, int index)
          Replaces the sendText at the specified index.
 
Methods inherited from interface com.ibm.hi.customizer.beans.scci.SCCustomComponent
getBackgroundColor, getCaption, getForegroundColor, getGlobalRead, getGlobalWrite, getHelpCaption, getHostLinkLength, getHostLinkPosition, getTabNumber, hasFocus, isTempHidden, isVisible, readGlobalVariable, requestFocus, setBackgroundColor, setCaption, setForegroundColor, setGlobalRead, setGlobalWrite, setHelpCaption, setTempHidden, setVisible, toString, writeGlobalVariable
 

Method Detail

getItemCount

public int getItemCount()
Gets the number of items in the list.
Returns:
the number of items in the list.

getDisplayText

public java.lang.String getDisplayText(int index)
Gets the displayText at the specified index.
Parameters:
index - the index of the list.
Returns:
the displayText at the specified index.
See Also:
getItemCount(), getSendText(int)

getSendText

public java.lang.String getSendText(int index)
Gets the sendText at the specified index.
Parameters:
index - the index of the list.
Returns:
the sendText at the specified index.
See Also:
getItemCount(), getDisplayText(int)

setItem

public void setItem(java.lang.String displayText,
                    java.lang.String sendText,
                    int index)
Replaces the displayText and sendText at the specified index.
Parameters:
displayText - the new displayText.
sendText - the new sendText.
index - the index to replace.

setDisplayText

public void setDisplayText(java.lang.String displayText,
                           int index)
Replaces the displayText at the specified index.
Parameters:
displayText - the new displayText.
index - the index to replace.

setSendText

public void setSendText(java.lang.String sendText,
                        int index)
Replaces the sendText at the specified index.
Parameters:
sendText - the new sendText.
index - the index to replace.

getSelectedIndex

public int getSelectedIndex()
Gets the index of the selected item.
Returns:
the index of the selected item, or -1 if no item is selected.
See Also:
select(int), isIndexSelected(int)

getDisplayText

public java.lang.String getDisplayText()
Get the selected displayText from the list.
Returns:
the selected displayText from the list, or an empty string if there is none, or null if no item is selected.
See Also:
select(int), isIndexSelected(int)

getSendText

public java.lang.String getSendText()
Gets the selected sendText from the list.
Returns:
the selected sendText from the list, or an empty string if there is none, or null if no item is selected
See Also:
select(int), isIndexSelected(int)

select

public void select(int index)
Selects the item at the specified index. If another index is selected, it will be deselected. If the index is out of range, the operation is ignored. If the index is already selected, the operation is ignored.
Parameters:
index - the index to select.
See Also:
getDisplayText(int), isIndexSelected(int)

selectItem

public void selectItem(java.lang.String displayText,
                       java.lang.String sendText)
Selects the first occurrence of the specified displayText/sendText combination in the list. If another index is selected, it will be deselected. If the index is already selected, the operation is ignored. If the displayText/sendText combination is not found, the operation is ignored.
Parameters:
displayText - the displayText to select.
sendText - the sendText to select.
See Also:
getDisplayText(int), getSendText(int), isIndexSelected(int)

selectDisplayText

public void selectDisplayText(java.lang.String displayText)
Selects the first occurrence of the specified displayText in the list. If another index is selected, it will be deselected. If the index is already selected, the operation is ignored. If the displayText is not found, the operation is ignored.
Parameters:
displayText - the displayText to select.
See Also:
getDisplayText(int), getSendText(int), isIndexSelected(int)

selectSendText

public void selectSendText(java.lang.String sendText)
Selects the first occurrence of the specified sendText in the list. If another index is selected, it will be deselected. If the index is already selected, the operation is ignored. If the sendText is not found, the operation is ignored.
Parameters:
sendText - the sendText to select.
See Also:
getDisplayText(int), getSendText(int), isIndexSelected(int)

isIndexSelected

public boolean isIndexSelected(int index)
Checks whether an index is selected.
Parameters:
index - the index to check
Returns:
true if the index is selected; false otherwise.
See Also:
select(int)