本文整理汇总了Java中com.google.gwt.cell.client.ValueUpdater.update方法的典型用法代码示例。如果您正苦于以下问题:Java ValueUpdater.update方法的具体用法?Java ValueUpdater.update怎么用?Java ValueUpdater.update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.cell.client.ValueUpdater
的用法示例。
在下文中一共展示了ValueUpdater.update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEnterKeyDown
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
protected void onEnterKeyDown(final Context context,
final Element parent,
final HyperLink value,
final NativeEvent event,
final ValueUpdater<HyperLink> valueUpdater) {
final Element element = event.getEventTarget().cast();
if (!parent.getFirstChildElement().equals(element)) {
return;
}
event.preventDefault();
event.stopPropagation();
if (valueUpdater != null) {
valueUpdater.update(value);
}
}
示例2: finishEditing
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
protected void finishEditing(Element parent, String value, Object key,
ValueUpdater<String> valueUpdater) {
String newValue = getInputElement(parent).getValue();
ViewData vd = getViewData(key);
if (vd == null) {
vd = new ViewData(value);
setViewData(key, vd);
}
vd.setCurrentValue(newValue);
if (valueUpdater != null && !vd.getCurrentValue().equals(vd.getLastValue())) {
vd.setLastValue(newValue);
valueUpdater.update(newValue);
}
super.finishEditing(parent, newValue, key, valueUpdater);
}
示例3: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onBrowserEvent(Context context, Element parent, T value,
NativeEvent event, ValueUpdater<T> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if (BrowserEvents.CHANGE.equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
T newValue = getValueAtIndex((K) key, select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
示例4: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element parent, T value,
NativeEvent event, ValueUpdater<T> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if (BrowserEvents.CHANGE.equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
T newValue = options.get(select.getSelectedIndex());
//setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
示例5: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(final Context context,
final Element parent,
final String value,
final NativeEvent event,
final ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context,
parent,
value,
event,
valueUpdater);
final String type = event.getType();
if ("change".equals(type)) {
final Object key = context.getKey();
final SelectElement select = parent.getFirstChild().cast();
final String newValue = options.get(select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent,
newValue,
key,
valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
示例6: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if (BrowserEvents.CHANGE.equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
String newValue = options.get(select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
示例7: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Cell.Context context, final Element parent, ImageResource value, NativeEvent event,
ValueUpdater<ImageResource> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
if (event.getType().equals("click")) {
if(valueUpdater != null) {
valueUpdater.update(value);
}
}
}
示例8: onEnterKeyDown
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
protected void onEnterKeyDown(final Context context,
final Element parent,
final String value,
final NativeEvent event,
final ValueUpdater<String> valueUpdater) {
if (valueUpdater != null) {
valueUpdater.update(value);
}
}
示例9: onEnterKeyDown
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
protected void onEnterKeyDown(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
if (valueUpdater != null) {
valueUpdater.update(value);
}
}
示例10: commit
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
/**
* Commit the current value.
*
* @param parent the parent element
* @param viewData the {@link ViewData} object
* @param valueUpdater the {@link ValueUpdater}
*/
private void commit(Context context, Element parent, ViewData viewData, ValueUpdater<String> valueUpdater) {
String originalText = viewData.getOriginal();
String value = updateViewData(parent, viewData, false);
value = validate(value, originalText);
viewData.setText(value);
clearInput(getInputElement(parent));
setValue(context, parent, value);
valueUpdater.update(value);
}
示例11: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的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);
}
}
}
示例12: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element parent, Pair<Long, String> value, NativeEvent event, ValueUpdater<Pair<Long, String>> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if ("change".equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
Pair<Long, String> newValue = options.get(select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
示例13: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Context context, Element parent, ComboItem value, NativeEvent event, ValueUpdater<ComboItem> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if ("change".equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
ComboItem newValue = options.get(select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
示例14: commit
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的package包/类
/**
* Commit the current value.
*
* @param context the context of the cell
* @param parent the parent Element
* @param viewData the {@link ViewData} object
* @param valueUpdater the {@link ValueUpdater}
*/
private void commit(Context context, Element parent, ViewData viewData,
ValueUpdater<String> valueUpdater) {
String value = updateViewData(parent, viewData, false);
clearInput(getInputElement(parent));
setValue(context, parent, viewData.getOriginal());
if (valueUpdater != null) {
valueUpdater.update(value);
}
}
示例15: onBrowserEvent
import com.google.gwt.cell.client.ValueUpdater; //导入方法依赖的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);
}
}
}