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


Java UiBinder类代码示例

本文整理汇总了Java中com.google.gwt.uibinder.client.UiBinder的典型用法代码示例。如果您正苦于以下问题:Java UiBinder类的具体用法?Java UiBinder怎么用?Java UiBinder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UiBinder类属于com.google.gwt.uibinder.client包,在下文中一共展示了UiBinder类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSourceWriter

import com.google.gwt.uibinder.client.UiBinder; //导入依赖的package包/类
private SourceWriter getSourceWriter(PrintWriter printWriter, GeneratorContext ctx) {

		String packageName = this.binderType.getPackage().getName();
		String className = this.binderProxySimpleName;

		ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, className);

		composerFactory.addImport(GWT.class.getName());
		composerFactory.addImport(UiBinder.class.getName());
		composerFactory.addImport(UiBinderLocalized.class.getName());
		composerFactory.addImport(UiTemplate.class.getName());

		composerFactory.addImport(this.binderType.getQualifiedSourceName());
		composerFactory.addImport(this.widgetType.getQualifiedSourceName());
		composerFactory.addImport(this.targetType.getQualifiedSourceName());

		composerFactory.addImplementedInterface(UiBinderLocalized.class.getSimpleName() + "<"
			+ this.widgetType.getSimpleSourceName() + "," + this.targetType.getSimpleSourceName() + ">");
		composerFactory.addImplementedInterface(UiBinder.class.getSimpleName() + "<"
			+ this.widgetType.getSimpleSourceName() + "," + this.targetType.getSimpleSourceName() + ">");
		composerFactory.addImplementedInterface(this.binderType.getSimpleSourceName());

		return composerFactory.createSourceWriter(ctx, printWriter);
	}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:25,代码来源:UiBinderLocalizedCreator.java

示例2: getFake

import com.google.gwt.uibinder.client.UiBinder; //导入依赖的package包/类
/**
 * Returns a new instance of FakeUiBinder that implements the given interface.
 * This is accomplished by returning a dynamic proxy object that delegates
 * calls to a backing FakeUiBinder.
 *
 * @param type interface to be implemented by the returned type. This must
 *        represent an interface that directly extends {@link UiBinder}.
 */
@Override
public UiBinder<?, ?> getFake(final Class<?> type) {
  return (UiBinder<?, ?>) Proxy.newProxyInstance(
      FakeUiBinderProvider.class.getClassLoader(),
      new Class<?>[] {type},
      new InvocationHandler() {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
          // createAndBindUi is the only method defined by UiBinder
          for (Field field : getAllFields(args[0].getClass())) {
            if (field.isAnnotationPresent(UiField.class)
                && !field.getAnnotation(UiField.class).provided()) {
              field.setAccessible(true);
              field.set(args[0], GWT.create(field.getType()));
            }
          }
          return GWT.create(getUiRootType(type));
        }
      });
}
 
开发者ID:google,项目名称:gwtmockito,代码行数:29,代码来源:FakeUiBinderProvider.java

示例3: SchemaForm

import com.google.gwt.uibinder.client.UiBinder; //导入依赖的package包/类
public SchemaForm(UiBinder<Widget, SchemaForm> uiBinder) {
  initWidget(uiBinder.createAndBindUi(this));
}
 
开发者ID:showlowtech,项目名称:google-apis-explorer,代码行数:4,代码来源:SchemaForm.java

示例4: uiBinder

import com.google.gwt.uibinder.client.UiBinder; //导入依赖的package包/类
@Override
public UiBinder<? extends Element, Slider> uiBinder() {
  return UI_BINDER;
}
 
开发者ID:siderakis,项目名称:mgwt-paper,代码行数:5,代码来源:PaperSliderAppearance.java

示例5: uiBinder

import com.google.gwt.uibinder.client.UiBinder; //导入依赖的package包/类
@Override
public UiBinder<Element, PaperButton> uiBinder() {
  return UI_BINDER;
}
 
开发者ID:siderakis,项目名称:mgwt-paper,代码行数:5,代码来源:ButtonPaperAppearance.java


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