use of com.google.gwt.dom.client.LabelElement in project che by eclipse.
the class CustomComboBox method setItemText.
/**
* Sets the text associated with the item at a given index.
*
* @param index
* the index of the item to be set
* @param text
* the item's new text
* @throws IndexOutOfBoundsException
* if the index is out of range
*/
public void setItemText(int index, String text) {
checkIndex(index);
final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
final LabelElement labelElement = (LabelElement) optionElement.getElementsByTagName("label").getItem(0);
labelElement.setInnerText(text);
if (selectedIndex == index) {
currentInputElement.setValue(text);
}
}
use of com.google.gwt.dom.client.LabelElement in project che by eclipse.
the class CustomComboBox method getItemText.
/**
* Gets the text associated with the item at the specified index.
*
* @param index
* the index of the item whose text is to be retrieved
* @return the text associated with the item
* @throws IndexOutOfBoundsException
* if the index is out of range
*/
public String getItemText(int index) {
checkIndex(index);
final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
final InputElement labelElement = (InputElement) optionElement.getElementsByTagName("input").getItem(0);
return labelElement.getValue();
}
use of com.google.gwt.dom.client.LabelElement in project che by eclipse.
the class CustomListBox method getItemText.
/**
* Gets the text associated with the item at the specified index.
*
* @param index
* the index of the item whose text is to be retrieved
* @return the text associated with the item
* @throws IndexOutOfBoundsException
* if the index is out of range
*/
public String getItemText(int index) {
checkIndex(index);
final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
final LabelElement labelElement = (LabelElement) optionElement.getElementsByTagName("label").getItem(0);
return labelElement.getInnerText();
}
use of com.google.gwt.dom.client.LabelElement in project che by eclipse.
the class CustomListBox method setItemText.
/**
* Sets the text associated with the item at a given index.
*
* @param index
* the index of the item to be set
* @param text
* the item's new text
* @throws IndexOutOfBoundsException
* if the index is out of range
*/
public void setItemText(int index, String text) {
checkIndex(index);
final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
final LabelElement labelElement = (LabelElement) optionElement.getElementsByTagName("label").getItem(0);
labelElement.setInnerText(text);
if (selectedIndex == index) {
currentItemLabel.setInnerText(text);
}
}
Aggregations