本文整理汇总了Java中com.google.gwt.dom.client.InputElement.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java InputElement.getValue方法的具体用法?Java InputElement.getValue怎么用?Java InputElement.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.InputElement
的用法示例。
在下文中一共展示了InputElement.getValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doChange
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
private void doChange(FormEvent event) {
InputElement e = InputElement.as(event.target);
String val = e.getValue();
setState(State.make(val));
}
示例2: getItemText
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
/**
* 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();
}
示例3: getValue
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
/**
* Gets the value associated with the item at a given index.
*
* @param index the index of the item to be retrieved
* @return the item's associated value
* @throws IndexOutOfBoundsException if the index is out of range
*/
public String getValue(int index) {
checkIndex(index);
final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
final InputElement inputElement =
(InputElement) optionElement.getElementsByTagName("input").getItem(0);
return inputElement.getValue();
}
示例4: updateViewData
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
/**
* Update the view data based on the current value.
*
* @param parent the parent element
* @param viewData the {@link ViewData} object to update
* @param isEditing true if in edit mode
* @return the new value
*/
private String updateViewData(Element parent, ViewData viewData,
boolean isEditing) {
InputElement input = (InputElement) parent.getFirstChild();
String value = input.getValue();
viewData.setText(value);
viewData.setEditing(isEditing);
return value;
}
示例5: onBrowserEvent
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
// Ignore events that don't target the input.
InputElement input = getInputElement(parent);
Element target = event.getEventTarget().cast();
if (!input.isOrHasChild(target)) {
return;
}
String eventType = event.getType();
Object key = context.getKey();
if (BrowserEvents.BLUR.equals(eventType)) {
finishEditing(parent, value, key, valueUpdater);
} else if (BrowserEvents.CHANGE.equals(eventType) ||
BrowserEvents.KEYUP.equals(eventType) ||
PASTE.equals(eventType)) {
ViewData vd = getViewData(key);
if (vd == null) {
vd = new ViewData(value);
setViewData(key, vd);
}
String newValue = input.getValue();
vd.setCurrentValue(input.getValue());
if (valueUpdater != null && !vd.getCurrentValue().equals(vd.getLastValue())) {
vd.setLastValue(newValue);
valueUpdater.update(newValue);
}
}
}
示例6: onBrowserEvent
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
// Ignore events that don't target the input.
Element target = event.getEventTarget().cast();
if (!parent.getFirstChildElement().isOrHasChild(target)) {
return;
}
Object key = context.getKey();
ValidationData viewData = getViewData(key);
String eventType = event.getType();
if ("change".equals(eventType)) {
InputElement input = parent.getFirstChild().cast();
// Mark cell as containing a pending change
input.getStyle().setColor("blue");
// Save the new value in the view data.
if (viewData == null) {
viewData = new ValidationData();
setViewData(key, viewData);
}
String newValue = input.getValue();
viewData.setValue(newValue);
finishEditing(parent, newValue, key, valueUpdater);
// Update the value updater, which updates the field updater.
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
示例7: updateViewData
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
/**
* Update the view data based on the current value.
* @param parent the parent element
* @param viewData the {@link ViewData} object to update
* @param isEditing true if in edit mode
* @return the new value
*/
private String updateViewData( Element parent,
ViewData viewData,
boolean isEditing ) {
InputElement input = (InputElement) parent.getFirstChild();
String value = input.getValue();
viewData.setText( value );
viewData.setEditing( isEditing );
return value;
}
示例8: postSuperRefresh
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public void postSuperRefresh() {
String action="com.jcommerce.gwt.server.BrandGWTAction";
String method="";
if(getCurState().getIsEdit()) {
method = "update";
idField.setValue(getCurState().getId());
}else {
method = "add";
idField.setValue(null);
}
formPanel.setAction(GWTHttpDynaForm.constructURL(action, method));
boolean enabled = fufLogo.isEnabled();
boolean isreadonly = fufLogo.isReadOnly();
System.out.println("isenabled? "+enabled+", readonly? "+isreadonly);
fufLogo.reset();
fufLogo.setValue("");
isreadonly = fufLogo.isReadOnly();
enabled = fufLogo.isEnabled();
System.out.println("isenabled? "+enabled+", readonly? "+isreadonly);
InputElement ele = fufLogo.getFileInput();
if(ele!=null) {
String val = ele.getValue();
String type = ele.getType();
String name = ele.getName();
System.out.println("val: +"+val+", type="+type+", name="+name);
}
fufLogo.setEnabled(true);
fufLogo.setReadOnly(false);
}
示例9: getData
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
@Override
public String getData(final InputElement input, String attribute) {
return input.getValue();
}
示例10: updateViewData
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
/**
* Update the view data based on the current value.
*
* @param parent
* the parent element
* @param viewData
* the {@link ViewData} object to update
* @param isEditing
* true if in edit mode
* @return the new value
*/
private TaskGridNameCellDetails updateViewData(Element parent, ViewData viewData,
boolean isEditing) {
InputElement input = (InputElement) parent.getFirstChild();
String value = input.getValue();
viewData.setText(value);
viewData.setEditing(isEditing);
return viewData.getTask();
}
示例11: updateViewData
import com.google.gwt.dom.client.InputElement; //导入方法依赖的package包/类
/**
* Update the view data based on the current value.
*
* @param parent
* the parent element
* @param viewData
* the {@link ViewData} object to update
* @param isEditing
* true if in edit mode
* @return the new value
*/
private Task updateViewData(Element parent, ViewData viewData, boolean isEditing) {
InputElement input = (InputElement) parent.getFirstChild();
String value = input.getValue();
viewData.setText(value);
viewData.setEditing(isEditing);
return viewData.getTask();
}