本文整理汇总了Java中com.google.gwt.user.client.TakesValue类的典型用法代码示例。如果您正苦于以下问题:Java TakesValue类的具体用法?Java TakesValue怎么用?Java TakesValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TakesValue类属于com.google.gwt.user.client包,在下文中一共展示了TakesValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DegreePlanTable
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public DegreePlanTable(TakesValue<CourseRequestInterface> requests, AssignmentProvider assignments) {
iRequests = requests;
iAssignments = assignments;
addStyleName("unitine-DegreePlanTable");
setAllowSelection(true);
setAllowMultiSelect(false);
List<UniTimeTableHeader> header = new ArrayList<UniTimeTableHeader>();
UniTimeTableHeader hIndent = new UniTimeTableHeader("");
header.add(hIndent);
UniTimeTableHeader hName = new UniTimeTableHeader(MESSAGES.colDegreeItemName(), 2);
header.add(hName);
UniTimeTableHeader hTitle = new UniTimeTableHeader(MESSAGES.colDegreeItemDescription());
header.add(hTitle);
UniTimeTableHeader hLimit = new UniTimeTableHeader(MESSAGES.colLimit());
header.add(hLimit);
UniTimeTableHeader hCredit = new UniTimeTableHeader(MESSAGES.colCredit());
header.add(hCredit);
UniTimeTableHeader hNote = new UniTimeTableHeader(MESSAGES.colNote());
header.add(hNote);
UniTimeTableHeader hReq = new UniTimeTableHeader(MESSAGES.colRequestPriority(), 2);
header.add(hReq);
addRow(null, header);
}
示例2: setChildWidget
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
/**
* Set the widget that the EditorPanel will display. This method will automatically call
* {@link #setEditor}.
*
* @param pwidget a {@link IsEditor} widget
*/
@Override
@UiChild(limit = 1, tagname = "widget")
public void setChildWidget(final TakesValue<T> pwidget) {
this.widget = (Widget) pwidget;
this.contents.add(this.widget);
this.setEditor(new ExtendedValueBoxEditor<>(pwidget, this));
if (pwidget instanceof HasFocusHandlers) {
((HasFocusHandlers) pwidget)
.addFocusHandler(pevent -> AbstractDecoratorWithLabel.this.addStyleToLabel());
}
if (pwidget instanceof HasBlurHandlers) {
((HasBlurHandlers) pwidget).addBlurHandler(pevent -> {
boolean hide = true;
if (AbstractDecoratorWithLabel.this.widget instanceof TakesValue<?>) {
hide = StringUtils.isEmpty(Objects
.toString(((TakesValue<?>) AbstractDecoratorWithLabel.this.widget).getValue(), null));
}
if (hide) {
AbstractDecoratorWithLabel.this.removeStyleFromLabel();
}
});
}
}
示例3: FormItemEditor
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public FormItemEditor(FormItem formItem) {
item = formItem;
item.setValidators(validator);
editor = TakesValueEditor.of(new TakesValue<T>() {
@Override
public void setValue(T value) {
item.setValue(value);
}
@Override
public T getValue() {
return (T) item.getValue();
}
});
}
示例4: ExtendedValueBoxEditor
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
/**
* constructor uses widget as base.
*
* @param ptakesValues widget which is able to set and get value from/to
* @param pdecorator corresponding decorator
*/
public ExtendedValueBoxEditor(final TakesValue<T> ptakesValues,
final AbstractDecorator<T> pdecorator) {
super(null);
this.messages = GWT.create(ExtendedValueBoxEditorMessages.class);
this.takesValues = ptakesValues;
this.decorator = pdecorator;
if (this.takesValues instanceof ValueBoxBase<?>) {
this.delegate = ((ValueBoxBase<T>) this.takesValues).asEditor().getDelegate();
}
}
示例5: setChildWidget
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
/**
* Set the widget that the EditorPanel will display. This method will automatically call
* {@link #setEditor}.
*
* @param pwidget a {@link IsEditor} widget
*/
@UiChild(limit = 1, tagname = "widget")
public void setChildWidget(final TakesValue<T> pwidget) {
this.widget = (Widget) pwidget;
this.contents.add(this.widget);
this.setEditor(new ExtendedValueBoxEditor<>(pwidget, this));
}
示例6: getValue
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public final T getValue() {
if (this.contents.getWidget() instanceof TakesValue<?>) {
return ((TakesValue<T>) this.contents.getWidget()).getValue();
} else {
return null;
}
}
示例7: setValue
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void setValue(final T pvalue, final boolean pfireEvents) {
if (this.contents.getWidget() instanceof TakesValue<?>) {
this.clearErrors();
if (this.contents.getWidget() instanceof HasValue<?>) {
((HasValue<T>) this.contents.getWidget()).setValue(pvalue, pfireEvents);
} else {
((TakesValue<T>) this.contents.getWidget()).setValue(pvalue);
}
}
}
示例8: clearErrors
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
@Override
public void clearErrors() {
super.clearErrors();
if (this.contents.getWidget() instanceof TakesValue<?>) {
if (StringUtils.isEmpty(
Objects.toString(((TakesValue<?>) this.contents.getWidget()).getValue(), null))) {
this.removeStyleFromLabel();
} else {
this.addStyleToLabel();
}
}
}
示例9: getValue
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
@Override
public <F> F getValue(String id) {
final WidgetBinding widgetBinding = bindings.get(id);
if (widgetBinding != null) {
TakesValue<?> hasValue = widgetBinding.widget;
if (hasValue != null) {
return (F) hasValue.getValue();
}
}
return null;
}
示例10: setValue
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
@Override
public <F> void setValue(String id, F value) {
final WidgetBinding widgetBinding = bindings.get(id);
if (widgetBinding != null) {
TakesValue<?> hasValue = widgetBinding.widget;
if (hasValue != null) {
((TakesValue<F>) hasValue).setValue(value);
}
}
}
示例11: testBindReadOnlyWidget
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public void testBindReadOnlyWidget() {
doTestBindWidget(new BindWidgetCallback() {
@Override
@SuppressWarnings("unchecked")
public HandlerRegistration bind(ViewEngine engine, String propertyId, IsWidget widget) {
return engine.bind(propertyId, (TakesValue<Object>) widget);
}
});
}
示例12: testUnbindReadOnlyWidget
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public void testUnbindReadOnlyWidget() {
doTestUnbindWidget(new BindWidgetCallback() {
@Override
@SuppressWarnings("unchecked")
public HandlerRegistration bind(ViewEngine engine, String propertyId, IsWidget widget) {
return engine.bind(propertyId, (TakesValue<Object>) widget);
}
});
}
示例13: getFieldValue
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
protected Object getFieldValue(FormField field) {
if (field.getWidget() instanceof HasValue) {
return ((HasValue) field.getWidget()).getValue();
} else if (field.getWidget() instanceof TakesValue) {
return ((TakesValue) field.getWidget()).getValue();
} else if (field.getWidget() instanceof HasText) {
return ((HasText) field.getWidget()).getText();
}
throw new IllegalStateException("Unexpected widget type: impossible to read the value");
}
示例14: setDefaultValueProvider
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public void setDefaultValueProvider(TakesValue<String> defaultValue) {
iDefaultValueProvider = defaultValue;
}
示例15: getDefaultValueProvider
import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public TakesValue<String> getDefaultValueProvider() {
return iDefaultValueProvider;
}