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


Java HasValueChangeHandlers类代码示例

本文整理汇总了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));
				}
			});

		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:21,代码来源:EventsExecutor.java

示例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);
					}
				}
			});
		}
	}

}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:18,代码来源:RendererHelper.java

示例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);
//						}
					}
				});
			}
		}

	}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:18,代码来源:RendererHelper.java

示例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);
  }
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:24,代码来源:BeanValidationInitializer.java

示例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());
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:31,代码来源:WidgetTestCase.java

示例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);
		}
	}
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:13,代码来源:GWTWidgets.java

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

示例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;
  }
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:11,代码来源:AbstractDecorator.java

示例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);
    }
  };
}
 
开发者ID:rodion-goritskov,项目名称:test-analytics-ng,代码行数:10,代码来源:CapabilitiesGridWidget.java

示例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)));
}
 
开发者ID:intendia-oss,项目名称:autorest,代码行数:4,代码来源:ExampleEntryPoint.java

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

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

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


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