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


Java TakesValue类代码示例

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

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

示例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();
		}
	});
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:17,代码来源:FormItemEditor.java

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

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

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

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

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

示例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;
}
 
开发者ID:growbit,项目名称:turbogwt-databind,代码行数:12,代码来源:ViewEngine.java

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

示例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);
        }
    });
}
 
开发者ID:growbit,项目名称:turbogwt-databind,代码行数:10,代码来源:DatabindViewEngineTest.java

示例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);
        }
    });
}
 
开发者ID:growbit,项目名称:turbogwt-databind,代码行数:10,代码来源:DatabindViewEngineTest.java

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

示例14: setDefaultValueProvider

import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public void setDefaultValueProvider(TakesValue<String> defaultValue) {
	iDefaultValueProvider = defaultValue;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:4,代码来源:FilterBox.java

示例15: getDefaultValueProvider

import com.google.gwt.user.client.TakesValue; //导入依赖的package包/类
public TakesValue<String> getDefaultValueProvider() {
	return iDefaultValueProvider;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:4,代码来源:FilterBox.java


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