本文整理汇总了Java中com.google.gwt.event.logical.shared.HasValueChangeHandlers类的典型用法代码示例。如果您正苦于以下问题:Java HasValueChangeHandlers类的具体用法?Java HasValueChangeHandlers怎么用?Java HasValueChangeHandlers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HasValueChangeHandlers类属于com.google.gwt.event.logical.shared包,在下文中一共展示了HasValueChangeHandlers类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValueChanged
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
public void setValueChanged(JavaScriptObject aValue) {
if (valueChanged != aValue) {
if (valueChangedReg != null) {
valueChangedReg.removeHandler();
valueChangedReg = null;
}
valueChanged = aValue;
if (component instanceof HasValueChangeHandlers<?>) {
valueChangedReg = ((HasValueChangeHandlers<Object>) component).addValueChangeHandler(new ValueChangeHandler<Object>() {
@Override
public void onValueChange(ValueChangeEvent<Object> event) {
JavaScriptObject published = ((HasPublished) event.getSource()).getPublished();
executeEvent(valueChanged, EventsPublisher.publishSourcedEvent(published));
}
});
}
}
}
示例2: addChangeListenerForWindowModified
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
private static void addChangeListenerForWindowModified(final ComponentGVO vo, UIObject ui, final String uuid) {
if (ui != null) {
if (ui instanceof HasValueChangeHandlers) {
HasValueChangeHandlers hasValueChangeHandlers = (HasValueChangeHandlers) ui;
hasValueChangeHandlers.addValueChangeHandler(new ValueChangeHandler() {
public void onValueChange(ValueChangeEvent event) {
WindowPanel window = ClientApplicationContext.getInstance().getWindow(vo.getWindow(), uuid);
if (window != null && window instanceof QWindowPanel) {
((QWindowPanel) window).setModified(true);
}
}
});
}
}
}
示例3: addChangeListenerForWindowModified
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
private static void addChangeListenerForWindowModified(final ComponentGVO vo, UIObject ui, final String uuid) {
if (ui != null) {
if (ui instanceof HasValueChangeHandlers) {
HasValueChangeHandlers hasValueChangeHandlers = (HasValueChangeHandlers) ui;
hasValueChangeHandlers.addValueChangeHandler(new ValueChangeHandler() {
public void onValueChange(ValueChangeEvent event) {
// WindowPanel window = ClientApplicationContext.getInstance().getWindow(vo.getWindow(), uuid);
// if (window != null && window instanceof QWindowPanel) {
// ((QWindowPanel) window).setModified(true);
// }
}
});
}
}
}
示例4: initializeEditors
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
/**
* initialize one editor.
*
* @param editor editor to initialize
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public void initializeEditors(final Object editor) {
if (editor instanceof HasValueChangeHandlers && this.valueChangeHandler != null) {
((HasValueChangeHandlers) editor).addValueChangeHandler(this.valueChangeHandler);
// if widget has a value change handler, validate on change
if (this.validateOnVueChangeHandler != null) {
((HasValueChangeHandlers) editor).addValueChangeHandler(this.validateOnVueChangeHandler);
}
}
// if widget has a key up handler, validate on key up
if (editor instanceof HasKeyUpHandlers && this.validateOnKeyUpHandler != null) {
((HasKeyUpHandlers) editor).addKeyUpHandler(this.validateOnKeyUpHandler);
}
// try to submit form on return
if (editor instanceof HasKeyPressHandlers && this.commitOnReturnHandler != null) {
((HasKeyPressHandlers) editor).addKeyPressHandler(this.commitOnReturnHandler);
}
}
示例5: checkValueChangeEvent
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
public static <H extends HasValueChangeHandlers & HasValue & HasEnabled & HasAttachHandlers> void checkValueChangeEvent(
H widget, Object value, Object secondValue) {
assertNotSame(value, secondValue);
// Widget must be enabled before firing the event
widget.setEnabled(true);
assertTrue(widget.isEnabled());
// Ensure the widget is attached to the root panel
assertTrue(widget.isAttached());
// Register value change handler that listens when the widget
// set the value
final boolean[] isValueChanged = {false};
widget.addValueChangeHandler(event -> isValueChanged[0] = true);
// By default setValue(boolean) will not fire the value change event.
widget.setValue(value);
assertEquals(value, widget.getValue());
// Expected result : false
assertFalse(isValueChanged[0]);
// Calling setValue(value, fireEvents) with fireEvents set to false
widget.setValue(secondValue, false);
// Expected result : secondValue
assertEquals(secondValue, widget.getValue());
// Expected result : false
assertFalse(isValueChanged[0]);
// Calling setValue(value, fireEvents) with fireEvents set to true
widget.setValue(value, true);
// Expected result : true
assertTrue(isValueChanged[0]);
// Expected result : value
assertEquals(value, widget.getValue());
}
示例6: addValueChangeHandler
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
/**
* Sets the ValueChange() event handler in many widgets
* @param handler the handler
* @param widgets the widgets
*/
public static <T> void addValueChangeHandler(final ValueChangeHandler<T> handler,final HasValueChangeHandlers<T>... widgets) {
if (handler != null && widgets != null && widgets.length > 0) {
for (HasValueChangeHandlers<T> w : widgets) {
if (w != null) w.addValueChangeHandler(handler);
}
}
}
示例7: registerItemValueChangeHandler
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
public void registerItemValueChangeHandler(final Widget item) {
if (item instanceof HasValueChangeHandlers) {
HasValueChangeHandlers<Boolean> hasValueChangeHandlers = (HasValueChangeHandlers<Boolean>)item;
hasValueChangeHandlers.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent<Boolean> event) {
doItemValueChange(event);
}
});
}
}
示例8: addValueChangeHandler
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public final HandlerRegistration addValueChangeHandler(final ValueChangeHandler<T> phandler) {
if (this.contents.getWidget() instanceof HasValueChangeHandlers<?>) {
return ((HasValueChangeHandlers<T>) this.contents.getWidget())
.addValueChangeHandler(phandler);
} else {
return null;
}
}
示例9: cellClickHandler
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
private ClickHandler cellClickHandler(final int row, final int column) {
final HasValueChangeHandlers<Pair<Component, Attribute>> self = this;
return new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
cellClicked(row, column);
}
};
}
示例10: valueChange
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
public static <T> Observable<ValueChangeEvent<T>> valueChange(HasValueChangeHandlers<T> source) {
return Observable.create(s -> register(s, source.addValueChangeHandler(s::onNext)));
}
示例11: addValueChangeHandler
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
public HandlerRegistration addValueChangeHandler(ValueChangeHandler handler) {
if (uiObject instanceof HasValueChangeHandlers) {
return ((HasValueChangeHandlers)uiObject).addValueChangeHandler(handler);
}
return null;
}
示例12: addValueChangeHandler
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
public HandlerRegistration addValueChangeHandler(ValueChangeHandler handler) {
if (textbox instanceof HasValueChangeHandlers) {
return ((HasValueChangeHandlers)textbox).addValueChangeHandler(handler);
}
return null;
}
示例13: fireValueChangeEvent
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; //导入依赖的package包/类
/**
* Fires a {@link ValueChangeEvent} to a given handler
*
* @param value The value that is changing
* @param handler The handler that will receive the event
*/
private <T> void fireValueChangeEvent(T value, ValueChangeHandler<T> handler) {
HasValueChangeHandlers<T> mock = new MockHasValueChangeHandlers<T>();
mock.addValueChangeHandler(handler);
ValueChangeEvent.fire(mock, value);
}