本文整理汇总了Java中com.google.gwt.user.client.ui.TextBox.getText方法的典型用法代码示例。如果您正苦于以下问题:Java TextBox.getText方法的具体用法?Java TextBox.getText怎么用?Java TextBox.getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.TextBox
的用法示例。
在下文中一共展示了TextBox.getText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfiguration
import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的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: getState
import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
public Map<String, String> getState() {
Map<String, String> state = new HashMap<String, String>();
for (Iterator widIt = widgets.iterator(); widIt.hasNext();) {
Widget w = (Widget) widIt.next();
if (w instanceof TextBox) {
TextBox t = (TextBox) w;
if (t.getText() != null && !t.getText().equals("")) {
state.put(t.getName(), t.getText());
}
} else if (w instanceof ListBox) {
ListBox l = (ListBox) w;
state.put(l.getName(), l.getValue(l.getSelectedIndex()));
}
}
return state;
}
示例3: onClick
import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
@Override
public void onClick(ClickEvent event) {
TextBox appNameBox = getAppName();
String appName = appNameBox.getText();
if (appName == null || appName.length() == 0) {
Window.alert("ODK 2.0 App Name cannot be blank");
} else if ( !appName.equals(Preferences.getAppName()) ) {
SecureGWT.getPreferenceService().setOdkAppName(appName, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
hide();
AggregateUI.getUI().reportError(caught);
}
@Override
public void onSuccess(Void result) {
hide();
AggregateUI.getUI().clearError();
Preferences.updatePreferences(settingsChange);
}
});
}
}
示例4: getValue
import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
protected double getValue(TextBox textBox) {
try {
String text = textBox.getText();
return Double.valueOf(text);
} catch (Exception e) {
textBox.setValue("0");
return 0.0;
}
}