本文整理匯總了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();
}