当前位置: 首页>>代码示例>>Java>>正文


Java ValueUpdater.update方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:HyperLinkCell.java

示例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);
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:20,代码来源:FilterTextInputCell.java

示例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);
        }
    }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:18,代码来源:AbstractSelectionCell.java

示例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);
    }
  }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:17,代码来源:ValueSelectionCell.java

示例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);
        }
    }
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:27,代码来源:DynamicSelectionCell.java

示例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);
        }
    }
}
 
开发者ID:kiegroup,项目名称:jbpm-data-modeler,代码行数:17,代码来源:DynamicSelectionCell.java

示例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);
        }
    }
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:11,代码来源:ClickableImageResourceCell.java

示例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);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:11,代码来源:IconCell.java

示例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);
  }
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:8,代码来源:LinkCell.java

示例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);
 }
 
开发者ID:waynedyck,项目名称:gwt-gantt,代码行数:19,代码来源:CellTextImpl.java

示例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);
    }
  }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:37,代码来源:FilterTextInputCell.java

示例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);
        }
    }
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:16,代码来源:DynamicSelectionCell.java

示例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);
        }
    }
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:16,代码来源:ComboCell.java

示例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);
  }
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:18,代码来源:EditTextCellPatched.java

示例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);
    }
  }
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:36,代码来源:CwCellValidation.java


注:本文中的com.google.gwt.cell.client.ValueUpdater.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。