當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。