本文整理汇总了Java中com.google.gwt.user.client.ui.ListBox.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java ListBox.getValue方法的具体用法?Java ListBox.getValue怎么用?Java ListBox.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.ListBox
的用法示例。
在下文中一共展示了ListBox.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfiguration
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private String getConfiguration() {
String conf = iConfiguration;
for (MatchResult matcher = iRegExp.exec(conf); matcher != null; matcher = iRegExp.exec(conf)) {
Element element = DOM.getElementById(matcher.getGroup(1));
String value = "";
if ("select".equalsIgnoreCase(element.getTagName())) {
ListBox list = ListBox.wrap(element);
for (int i = 0; i < list.getItemCount(); i++) {
if (list.isItemSelected(i))
value += (value.isEmpty() ? "" : ",") + list.getValue(i);
}
} else if ("input".equalsIgnoreCase(element.getTagName())) {
TextBox text = TextBox.wrap(element);
value = text.getText();
} else {
Hidden hidden = Hidden.wrap(element);
value = hidden.getValue();
}
conf = conf.replace("${" + matcher.getGroup(1) + "}", value);
}
return conf;
}
示例2: loadAndSetDayHour
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
public void loadAndSetDayHour(ListBox day_list, HourListBox hour_list, ListBox minute_list, int year, int month, int day, int hour, int min) {
// Load the valid days for this month (which as set above) and year.
days(day_list, year, month);
if ( day < Integer.valueOf(day_list.getValue(0)).intValue() ) {
day_list.setSelectedIndex(0);
} else if ( day > Integer.valueOf(day_list.getValue(day_list.getItemCount() - 1)).intValue() ) {
day_list.setSelectedIndex(day_list.getItemCount() - 1);
} else {
for (int i = 0; i < day_list.getItemCount(); i++) {
String v = day_list.getValue(i);
if ( v.equals(GeoUtil.format_two(day)) ) {
day_list.setSelectedIndex(i);
}
}
}
loadAndSetHour(hour_list, minute_list, year, month, Integer.valueOf(day_list.getValue(day_list.getSelectedIndex())).intValue(), hour, min);
}
示例3: moveAllItems
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private Set<String> moveAllItems(ListBox source, ListBox target) {
final Set<String> movedItems = new HashSet<String>();
int size = source.getItemCount();
for (int i = 0; i < size; i++) {
movedItems.add(source.getValue(i));
final String text = source.getItemText(i);
final String value = source.getValue(i);
target.addItem(text, value);
target.setItemSelected(target.getItemCount() - 1, true);
}
target.setFocus(true);
if (source.getItemCount() > 0) {
target.setSelectedIndex(0);
}
source.clear();
return movedItems;
}
示例4: setValueOfDocFieldWidget
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private void setValueOfDocFieldWidget(String name, String value) {
for (EditableWidgetStorage editableWidgetStorage : docFieldWidgets) {
if (editableWidgetStorage.getData().getName().equals(name)) {
if (editableWidgetStorage.isListBox) {
ListBox listBoxwidget = editableWidgetStorage.getListBoxwidget();
if (listBoxwidget != null) {
for (int i = 0; i < listBoxwidget.getItemCount(); i++) {
String listBoxValue = listBoxwidget.getValue(i);
if (listBoxValue.equals(value)) {
listBoxwidget.setSelectedIndex(i);
break;
}
}
}
} else {
ValidatableWidget<TextBox> textBoxWidget = editableWidgetStorage.getTextBoxWidget();
if (textBoxWidget != null) {
textBoxWidget.getWidget().setValue(value);
}
}
break;
}
}
}
示例5: getValueOfDocFieldWidget
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
/**
* To get Value Of Document Field Widget.
*
* @param name String
* @return String
*/
public String getValueOfDocFieldWidget(String name) {
String value = null;
for (EditableWidgetStorage editableWidgetStorage : docFieldWidgets) {
String nameOfWidget = editableWidgetStorage.getData().getName();
if (nameOfWidget.equals(name)) {
if (editableWidgetStorage.isListBox) {
ListBox listBoxwidget = editableWidgetStorage.getListBoxwidget();
if (listBoxwidget != null) {
value = listBoxwidget.getValue(listBoxwidget.getSelectedIndex());
}
} else {
ValidatableWidget<TextBox> textBoxWidget = editableWidgetStorage.getTextBoxWidget();
if (textBoxWidget != null) {
value = textBoxWidget.getWidget().getValue();
}
}
break;
}
}
return value;
}
示例6: setFieldValue
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
protected void setFieldValue(ListBox field, String value) {
try {
for (int i = 0; i < field.getItemCount(); i++) {
String v = field.getValue(i);
if (v.equals(value)) {
field.setSelectedIndex(i);
return;
}
}
field.setSelectedIndex(0);
} catch (Exception e) {
field.setSelectedIndex(0);
}
}
示例7: setPassive
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private void setPassive(ListBox lb, String name) {
int n = lb.getItemCount();
if ((name != null) && (name.length() > 0)) {
for (int i = 0; i < n; i++) {
String value = lb.getValue(i);
if (value.equals(name)) {
lb.setSelectedIndex(i);
return;
}
}
}
lb.setSelectedIndex(0);
}
示例8: selectSkill
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private void selectSkill(ListBox list, ActiveSkill skill) {
for (int i = 0; i < list.getItemCount(); i++) {
String value = list.getValue(i);
if (skill != null) {
if (value.equals(skill.name())) {
list.setSelectedIndex(i);
return;
}
} else {
if ((value == null) || (value.trim().length() == 0)) {
list.setSelectedIndex(i);
return;
}
}
}
list.setSelectedIndex(0);
}
示例9: selectRune
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private void selectRune(ActiveSkill skill, Anchor anchor2, ListBox list2,
Rune rune) {
if (rune == null) {
list2.setSelectedIndex(0);
} else {
int n = list2.getItemCount();
for (int i = 0; i < n; i++) {
String value = list2.getValue(i);
if (value.equals(rune.name())) {
list2.setSelectedIndex(i);
break;
}
}
}
this.setRuneAnchor(skill, anchor2, rune);
}
示例10: selectSkill
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private void selectSkill(Anchor anchor, ListBox list, ActiveSkill skill,
Anchor anchor2, ListBox list2) {
if (skill == null) {
list.setSelectedIndex(0);
} else {
int n = list.getItemCount();
for (int i = 0; i < n; i++) {
String value = list.getValue(i);
if (value.equals(skill.name())) {
list.setSelectedIndex(i);
break;
}
}
}
this.setSkillAnchor(anchor, skill);
this.setRunes(anchor2, list2, skill);
}
示例11: loadAndSetMonthDayHour
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private void loadAndSetMonthDayHour(ListBox month_list, ListBox day_list, HourListBox hour_list, ListBox minute_list, int year, int month, int day, int hour, int min) {
// Load the valid months for this year.
months(month_list, year);
int low_month_number = monthToInt(month_list.getValue(0));
int hi_month_number = monthToInt(month_list.getValue(month_list.getItemCount() - 1));
DateTime requested_instance = new DateTime(year, month, day, hour, min, chrono).withZone(DateTimeZone.UTC);
String month_name = monthFormat.print(requested_instance.getMillis());
if ( month < low_month_number ) {
// If the current month is before the first month in the list
// set to the first month.
month_list.setSelectedIndex(0);
} else if ( month > hi_month_number) {
// If the current month is after the last month in the list
// set to the last month.
month_list.setSelectedIndex(month_list.getItemCount() - 1);
} else {
// Else set to that month
for (int i = 0; i < month_list.getItemCount(); i++) {
String v = month_list.getValue(i);
if ( v.equals(month_name) ) {
month_list.setSelectedIndex(i);
}
}
}
int selected_month = monthToInt(month_list.getValue(month_list.getSelectedIndex()));
loadAndSetDayHour(day_list, hour_list, minute_list, year, selected_month, day, hour, min);
}
示例12: onChange
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
@Override
public void onChange(ChangeEvent event) {
if (xAnalysisWidget.isActive()) {
eventBus.fireEventFromSource(new WidgetSelectionChangeEvent(false), event.getSource());
ListBox analysisAxis = (ListBox) event.getSource();
String v = analysisAxis.getValue(analysisAxis.getSelectedIndex());
setAnalysisAxes(v);
}
}
示例13: getListBoxSelectedStyleName
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
/**
* Allows to retrieve the selected style name from the list box
* @param listBox the list box to get the selected style from
* @return the style selected by the user in this box
*/
public String getListBoxSelectedStyleName( final ListBox listBox ) {
final int selectedIndex = listBox.getSelectedIndex();
if( selectedIndex == -1 ) {
//Nothing is selected yet, return the fist element in the list
return listBox.getValue( 0 );
} else {
//An item is selected, get its value
return listBox.getValue( selectedIndex );
}
}
示例14: populateFilters
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
protected void populateFilters(final ReviewValidateTable table) {
ListBox listBox = table.getPriorityListBox();
int selectedIndex = listBox.getSelectedIndex();
if (selectedIndex != 0) {
String selectedValue = listBox.getValue(selectedIndex);
filters[0] = new DataFilter("priority", selectedValue);
} else {
filters[0] = new DataFilter("priority", "0");
}
if (table.isReview()) {
filters[1] = new DataFilter("status", "9");
} else {
filters[1] = new DataFilter("status", "10");
}
}
示例15: getBool
import com.google.gwt.user.client.ui.ListBox; //导入方法依赖的package包/类
private static InheritableBoolean getBool(ListBox box) {
int i = box.getSelectedIndex();
if (i >= 0) {
final String selectedValue = box.getValue(i);
if (selectedValue.startsWith(InheritableBoolean.INHERIT.name())) {
return InheritableBoolean.INHERIT;
}
return InheritableBoolean.valueOf(selectedValue);
}
return InheritableBoolean.INHERIT;
}