|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openoffice.ide.eclipse.core.gui.rows.LabeledRow
org.openoffice.ide.eclipse.core.gui.rows.ChoiceRow
public class ChoiceRow
Row class that could managed a combo box to select a value among others
In order to use this class correctly, please add items and define the default one. As every row type, don't forget to set the Modification listener to be notified of the value changes. This class supports internationalized items since the version 1.0.3.
LabeledRow
Field Summary |
---|
Fields inherited from class org.openoffice.ide.eclipse.core.gui.rows.LabeledRow |
---|
LAYOUT_COLUMNS, mBrowse, mField, mLabel, mListener, mProperty |
Constructor Summary | |
---|---|
ChoiceRow(org.eclipse.swt.widgets.Composite pParent,
java.lang.String pProperty)
Create a new choice row. |
|
ChoiceRow(org.eclipse.swt.widgets.Composite pParent,
java.lang.String pProperty,
java.lang.String pLabel)
Create a new choice row. |
|
ChoiceRow(org.eclipse.swt.widgets.Composite pParent,
java.lang.String pProperty,
java.lang.String pLabel,
java.lang.String pBrowse)
Create a new choice row with a button on the right. |
Method Summary | |
---|---|
void |
add(java.lang.String pItem)
Append the item at the end of the item list. |
void |
add(java.lang.String pItem,
int pIndex)
Adds the provided item at the provided position. |
void |
add(java.lang.String pText,
java.lang.String pValue)
adds an internationalized item at the end of the list. |
void |
add(java.lang.String pText,
java.lang.String pValue,
int pIndex)
Adds a translated item. |
void |
addAll(java.lang.String[] pItems)
Adds all the strings contained in items at the end of the item list. |
java.lang.String |
getItem(int pIndex)
Deprecated. This methods only returns the text of the item, use getValue() to get the selected value. |
int |
getItemCount()
Returns the number of items of the combo box. |
java.lang.String |
getValue()
Get or calculate the value of this property. |
java.lang.String |
getValue(int pIndex)
Returns the value of the i-th item. |
void |
remove(int pIndex)
Remove the item at the position corresponding to index. |
void |
remove(int pStart,
int pEnd)
Removes all the items between start and end positions. |
void |
remove(java.lang.String pText)
Removes the items with the provided text. |
void |
removeAll()
Removes all the items of the combo box. |
void |
select(int pIndex)
Select the item at the position corresponding to index. |
void |
select(java.lang.String pValue)
Set the provided text as the active item if the item is present in the choice. |
void |
setBrowseSelectionListener(org.eclipse.swt.events.SelectionListener pListener)
Set the listener for the browse button action. |
Methods inherited from class org.openoffice.ide.eclipse.core.gui.rows.LabeledRow |
---|
createContent, fillRow, fireFieldChangedEvent, getLabel, getProperty, removeFieldChangedlistener, setEnabled, setFieldChangedListener, setLabel, setTooltip, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChoiceRow(org.eclipse.swt.widgets.Composite pParent, java.lang.String pProperty, java.lang.String pLabel)
pParent
- the parent composite where to create the rawpProperty
- the property name of the rawpLabel
- label the label to print on the left of the rawpublic ChoiceRow(org.eclipse.swt.widgets.Composite pParent, java.lang.String pProperty, java.lang.String pLabel, java.lang.String pBrowse)
pParent
- the parent composite where to create the rowpProperty
- the property name of the rowpLabel
- label the label to print on the left of the rowpBrowse
- the label of the buttonpublic ChoiceRow(org.eclipse.swt.widgets.Composite pParent, java.lang.String pProperty)
pParent
- the parent compositepProperty
- the property name to use in eventsMethod Detail |
---|
public void setBrowseSelectionListener(org.eclipse.swt.events.SelectionListener pListener)
pListener
- the browse action listenerpublic void addAll(java.lang.String[] pItems)
pItems
- Array of items to appends to the existing ones.public void add(java.lang.String pText, java.lang.String pValue, int pIndex)
This method adds the text to the combo box and deals with its translation. If the text is already contained in the box, nothing will be done.
pText
- the translated item textpValue
- the item valuepIndex
- te item indexpublic void add(java.lang.String pText, java.lang.String pValue)
pText
- the internationalized textpValue
- the value of the itemadd(String, String, int)
public void add(java.lang.String pItem, int pIndex)
pItem
- text of the item to addpIndex
- position where to add the item in the listadd(java.lang.String, java.lang.String, int)
public void add(java.lang.String pItem)
pItem
- text of the item to appendadd(java.lang.String, java.lang.String, int)
public void remove(java.lang.String pText)
pText
- text of the items to removeCombo.remove(java.lang.String)
public void remove(int pIndex)
pIndex
- position of the item to removeCombo.remove(int)
public void remove(int pStart, int pEnd)
pStart
- position of the first item to removepEnd
- position of the last item to removeCombo.remove(int, int)
public void removeAll()
Combo.removeAll()
public void select(int pIndex)
pIndex
- position of the item to selectCombo.select(int)
public void select(java.lang.String pValue)
pValue
- value of the item to selectpublic java.lang.String getItem(int pIndex)
getValue()
to get the selected value.
pIndex
- position of the item to fetch
Combo.getItem(int)
public int getItemCount()
Combo.getItemCount()
public java.lang.String getValue()
LabeledRow
getValue
in class LabeledRow
public java.lang.String getValue(int pIndex)
pIndex
- the index of the value to get
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |