小编Jan*_*Jan的帖子

如何使用消息将GWT UIBinder页面国际化?

我试图用属性文件国际化UIBinder应用程序.由于我们已经通过com.google.gwt.i18n.client.Messages接口(GWT 1.7.1)公开了很多翻译,因此我们希望重用这些消息.

我尝试过以下方法:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
 xmlns:g="urn:import:com.google.gwt.user.client.ui" 
 xmlns:res="ui:with:be.credoc.iov.webapp.client.MessageConstants">

 <g:HTMLPanel>
  <div>
   <res:msg key="email">Emaileke</res:msg>:
   <g:TextBox ui:field="email" />
  </div>
 </g:HTMLPanel>
</ui:UiBinder>
Run Code Online (Sandbox Code Playgroud)

MessageConstants类如下所示:

@DefaultLocale("nl")
public interface MessageConstants extends Messages {
 String email();
}
Run Code Online (Sandbox Code Playgroud)

但是,这不起作用.我怎样才能做到这一点?

gwt internationalization uibinder

22
推荐指数
3
解决办法
1万
查看次数

如何使用GWT编辑器框架进行验证?

我正在尝试与GWT 2.1.0的新GWT Editor框架集成.我还想将验证检查添加到框架中.但是,我正在努力寻找一个体面的例子来做这件事.

目前我有以下代码:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:e="urn:import:com.google.gwt.editor.ui.client">
    <ui:with type="be.credoc.iov.webapp.client.MessageConstants"
        field="msg" />
    <g:HTMLPanel>
        <e:ValueBoxEditorDecorator ui:field="personalReference">
            <e:valuebox>
                <g:TextBox />
            </e:valuebox>
        </e:ValueBoxEditorDecorator>
    </g:HTMLPanel>
</ui:UiBinder> 
Run Code Online (Sandbox Code Playgroud)

对于我的编辑:

public class GarageEditor extends Composite implements Editor<Garage> {

    @UiField
    ValueBoxEditorDecorator<String> personalReference;

    interface GarageEditorUiBinder extends UiBinder<Widget, GarageEditor> {
    }

    private static GarageEditorUiBinder uiBinder = GWT.create(GarageEditorUiBinder.class);

    public GarageEditor() {
        initWidget(uiBinder.createAndBindUi(this));
    }

}
Run Code Online (Sandbox Code Playgroud)

在什么时候我必须调用我的验证器,我该如何与它集成?

更新:

我实际上正在寻找一种方法来检索具有关键属性路径的地图,以及编辑器的值.委托上有一个路径字段,但这不是编辑对象中的路径,而是编辑器类中的路径.

有人知道是否有可能做这样的事情?

java gwt editor uibinder gwt2

19
推荐指数
1
解决办法
1万
查看次数

GWT 2.1编辑器框架如何支持原始类型?

我试图将原始类型"int"的字段绑定到编辑器.我的编辑器扩展了ValueBox<Integer>,因为Java中的泛型只能使用对象类型.

当我编译我的应用程序时,我收到以下错误:

00:00:18,915 [ERROR]在使用getter表达式""唤醒路径"cadastralDivisionCode"时发现意外类型int

更改getter和setter以使用Integer对象,可以解决问题.有没有办法在GWT 2.1编辑器框架中使用原始类型?

java gwt editor gwt2

7
推荐指数
1
解决办法
1026
查看次数

Apache Beam 是否支持迭代算法,就像 Apache Flink 一样?

Apache Flink 支持迭代转换:https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/batch/iterations.html

使用 Apache Beam 是否也支持这一点,或者我们可以使用 Beam 概念实现相同的目标吗?

apache-flink apache-beam

5
推荐指数
1
解决办法
351
查看次数

如何在AngularJS单页面应用程序中返回http状态代码?

我有一个AngularJS单页面应用程序用于显示短生命资源,其中包含/ auction/103等网址.但是,当资源不再可用时,我希望从搜索引擎索引中删除该页面.因此,我需要在搜索引擎爬虫经过时返回状态代码410或404.

但是,如何在单页应用程序中执行此操作,其中页面未在服务器上呈现?

seo http-status-codes angularjs single-page-application

1
推荐指数
1
解决办法
1617
查看次数