Java 类com.google.gwt.user.client.TakesValue 实例源码

项目:unitimes    文件:DegreePlanTable.java   
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);
}
项目:unitime    文件:DegreePlanTable.java   
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);
}
项目:gwt-bean-validators    文件:AbstractDecoratorWithLabel.java   
/**
 * 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();
      }
    });
  }
}
项目:geomajas-project-client-gwt    文件:FormItemEditor.java   
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();
        }
    });
}
项目:gwt-bean-validators    文件:ExtendedValueBoxEditor.java   
/**
 * 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();
  }
}
项目:gwt-bean-validators    文件:AbstractDecorator.java   
/**
 * 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));
}
项目:gwt-bean-validators    文件:AbstractDecorator.java   
@SuppressWarnings("unchecked")
@Override
public final T getValue() {
  if (this.contents.getWidget() instanceof TakesValue<?>) {
    return ((TakesValue<T>) this.contents.getWidget()).getValue();
  } else {
    return null;
  }
}
项目:gwt-bean-validators    文件:AbstractDecorator.java   
@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);
    }
  }
}
项目:gwt-bean-validators    文件:AbstractDecoratorWithLabel.java   
@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();
    }
  }
}
项目:turbogwt-databind    文件:ViewEngine.java   
@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;
}
项目:turbogwt-databind    文件:ViewEngine.java   
@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);
        }
    }
}
项目:turbogwt-databind    文件:DatabindViewEngineTest.java   
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);
        }
    });
}
项目:turbogwt-databind    文件:DatabindViewEngineTest.java   
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);
        }
    });
}
项目:kie-wb-common    文件:FieldStateValidatorImpl.java   
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");
}
项目:unitimes    文件:FilterBox.java   
public void setDefaultValueProvider(TakesValue<String> defaultValue) {
    iDefaultValueProvider = defaultValue;
}
项目:unitimes    文件:FilterBox.java   
public TakesValue<String> getDefaultValueProvider() {
    return iDefaultValueProvider;
}
项目:unitimes    文件:UniTimeFilterBox.java   
public void setDefaultValueProvider(TakesValue<String> defaultValue) {
    iFilter.getWidget().setDefaultValueProvider(defaultValue);
}
项目:unitimes    文件:UniTimeFilterBox.java   
public TakesValue<String> getDefaultValueProvider() {
    return iFilter.getWidget().getDefaultValueProvider();
}
项目:gwt-module-config    文件:Setting.java   
public <S extends TakesValue<T> & TakesComment> void from(S obj) {
    this.setComment(obj.getComment());
    this.setValue(obj.getValue());
}
项目:gwt-module-config    文件:Setting.java   
public <S extends TakesValue<T> & TakesComment> void to(S obj) {
    obj.setComment(this.getComment());
    obj.setValue(this.getValue());
}
项目:unitime    文件:FilterBox.java   
public void setDefaultValueProvider(TakesValue<String> defaultValue) {
    iDefaultValueProvider = defaultValue;
}
项目:unitime    文件:FilterBox.java   
public TakesValue<String> getDefaultValueProvider() {
    return iDefaultValueProvider;
}
项目:unitime    文件:UniTimeFilterBox.java   
public void setDefaultValueProvider(TakesValue<String> defaultValue) {
    iFilter.getWidget().setDefaultValueProvider(defaultValue);
}
项目:unitime    文件:UniTimeFilterBox.java   
public TakesValue<String> getDefaultValueProvider() {
    return iFilter.getWidget().getDefaultValueProvider();
}
项目:grails-console-charts    文件:EditorDesktopView.java   
@Override
public TakesValue<String> getQueryEditor() {
    return queryEditor;
}
项目:grails-console-charts    文件:EditorDesktopView.java   
@Override
public TakesValue<String> getAppearanceEditor() {
    return appearanceEditor;
}
项目:turbogwt-databind    文件:AbstractDatabindView.java   
@Override
public <F> Registration bind(String id, TakesValue<F> widget) {
    return engine.bind(id, widget);
}
项目:turbogwt-databind    文件:ViewEngine.java   
WidgetBinding(TakesValue widget, HandlerRegistration widgetHandlerRegistration) {
    this.widget = widget;
    this.widgetHandlerRegistration = widgetHandlerRegistration;
}
项目:turbogwt-databind    文件:ViewEngine.java   
WidgetBinding(TakesValue widget) {
    this.widget = widget;
}
项目:turbogwt-databind    文件:BindingViewImpl.java   
@Override
public <F> Registration bind(String id, TakesValue<F> widget) {
    return engine.bind(id, widget);
}
项目:turbogwt-databind    文件:DatabindViewMock.java   
@Override
public <F> Registration bind(String id, TakesValue<F> widget) {
    return engine.bind(id, widget);
}
项目:turbogwt-gwtp    文件:PopupDatabindViewImpl.java   
@Override
public <F> Registration bind(String id, TakesValue<F> widget) {
    return engine.bind(id, widget);
}
项目:turbogwt-gwtp    文件:DatabindViewImpl.java   
@Override
public <F> Registration bind(String id, TakesValue<F> widget) {
    return engine.bind(id, widget);
}
项目:gwt-bean-validators    文件:ExtendedValueBoxEditor.java   
/**
 * getter for the widget which takes the values.
 *
 * @return the takesValues
 */
public final TakesValue<T> getTakesValues() {
  return this.takesValues;
}
项目:turbogwt-databind    文件:WidgetBinder.java   
/**
 * Bind a widget with default strategy (NONE). This binding will behavior like a read-only widget.
 *
 * @param id     identification of property
 * @param widget widget to bind
 * @param <F>    value type
 *
 * @return HandlerRegistration of this binding
 */
<F> Registration bind(String id, TakesValue<F> widget);
项目:grails-console-charts    文件:AbstractEditorPresenter.java   
TakesValue<String> getQueryEditor();
项目:grails-console-charts    文件:AbstractEditorPresenter.java   
TakesValue<String> getAppearanceEditor();