- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试理解 GWT 中的 UIBinder 概念。我在网上浏览了几个教程。这是我的问题:
1) 为什么要使用 UIBinder?难道只是因为我们会编写更少的代码并像直接编写 javascript 一样进行开发吗?
2) 有什么事情可以通过使用 UiBinder 完成而 GWT 无法完成,反之亦然?
我经历了 this 链接提供了对此的直接讨论。还有其他要点或建议吗?
提前致谢。
最佳答案
GWT在创建DOM的过程中最大的优势是UiBinders ,也称为“声明式布局”。
UiBinders provide a way for you to declare the layout of your application and widgets using traditional HTML and CSS rather than programatically in java. This provides you with a much richer way to create your application.
Browsers are better at building DOM structures by cramming big strings of HTML into innerHTML attributes than by a bunch of API calls. UiBinder naturally takes advantage of this, and the result is that the most pleasant way to build your app is also the best way to build it.
UiBinder是一个旨在分离功能和功能的框架用户界面 View 。
UiBinder 框架允许开发人员构建 gwt 应用程序HTML 页面中配置了 GWT 小部件。
UIBinder 提供了一种定义用户界面的声明方式。
UIBinder 将编程逻辑与 UI 分开。
UIBinder 类似于 JSP 与 Servlet。
这是一个example UIBInder 如何比传统的 java 代码更具优势。
回答您的问题(这些是我在开发过程中观察到的)
如果您熟悉 HTMl 和 CSS,您可以简单地在其中布局
结构(意味着在 ui.xml
模板中),并且可以简单地使用总重量。这会减少编译时间。
同样,您可以简单地在 xml 中编写标记并应用样式和其他 DOM 属性,就像在 java 代码中一样,您必须编写几行代码(至少 2 到 3 行)来准备一个小部件具有样式和特定 DOM 属性。
根据我最近的经验,我在这里总结了几点。 http://codeinventions.blogspot.in/2014/07/why-to-use-uibinder-in-gwt.html
关于gwt - GWT 中的 UIBinder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16051682/
简单的例子。我在 UiBinder 中声明了 2 种样式: .success { font-size: 13px; margin: 15px;
我在 GWT 项目中使用 UiBinder xml 文件。问题是 Eclipse 没有给我任何关于我可以与小部件一起使用的属性的信息 例如,我知道我可以这样设置宽度或样式: 但是在点击 ctrl +
我想知道是否有一种方法可以将 gwt uibinder 逻辑构建到抽象父类中,这样我就不必在每个要绑定(bind)的类中重复代码。 例如,我希望能够做这样的事情: public abstract cl
如何在 GWT 中的 UiBinder 中定义 TabPanel。 TabPanel 和 TabLayoutPanel 有什么区别。在哪里可以找到有关 TabPanel uibinder 参数的其他信
我想在带有两个选项卡的选项卡面板的主体内放置一些 anchor 。但是我的 anchor 不可见。代码如下 Analysis Person
我正在尝试使用 uiBinder。我按照提供的教程 谷歌,但我不知道为什么 clickevent 不起作用?我想计算点击次数并在跨度中显示它,它不起作用,我也放了 window.alert 但似乎根本
这张图片正在显示,但无论我使用的宽度或高度值如何,我都无法调整它的大小。有什么想法吗?谢谢。 .fortaImage { width:'50px'; height:'50p
我正在使用 Eclipse Ganymede 3.4 版开发 GWT2.3。使用 UIBinder 时,自动完成功能(建议)非常慢。 在这种情况下我不知道该怎么办。我需要添加一些插件或文件。工作太慢了
我们在我们的项目中使用 GXT 和 GWT(2.4)。我们正在使用 UIBinder 进行页面设计。目前我们面临太多问题,无法在 xml 页面中编写代码。自动建议花费太多时间(当我们按 ctl+Spa
类(class) Foo有一个变量 List bar ,如何使用 UiBinder 渲染每个按钮?甚至可能吗? 最佳答案 UiBinder 是一个 XML 模板 用于声明式布局小部件和不是渲染器 .因
我刚刚创建了小部件: public class myWidget extends FlowPanel { private T value; public T getValue() { retu
我想通过 GWT 2.0 中的 UiBinder 使用声明性方法来实现菜单(MenuBar、MenuItem)。 我遇到了两个问题: 有没有办法在 .ui.xml 文件中添加 MenuItemSepa
我在输入时遇到此错误 在我的 UiBinder 文件中,错误是: [DEBUG] [MyGWT] - Rebinding com.mycomp.mygwt.client.Resources [
在提出问题之前,我将简要描述一下背景。我有一个 Widget 类,它将 ui 实现“外包”到一个单独的类(如下所示): public class SimpleFilmWidget extends Co
我正在为我的应用程序使用 GWT 和 UiBinder,我正在尝试这样做 但是自定义placeholder属性将不起作用,因为没有 setPlaceholder TextBox 上的方法- 我需要这
在 GWT + UiBinder 中,您可以像这样捕获点击: @UiHandler("cancelButton") void onCancelButtonClicked(ClickEvent e) {
我想在带有 uiBinder 的 GWT 中使用链接或按钮,例如 (a href="..."/>)。 我找到了“超链接”小部件,但我不知道如何使用它。 最佳答案 您应该使用 Anchor小部件。 您可
我正在创建一个带有标签和文本框的复合 uibinder 小部件。 预期用途是: The text to be put in the box. 我找到了如何使用自定义 @UiConstruc
我无法让 CSS 图像 Sprite 出现在 GWT UiBinder 中。我做了评论 how do i use image sprites in GWT? ,但发现我已经在做建议的事情了。 我有一个
我正在尝试在 GWT UIBinder 中实现一个简单的基于 CSS 的菜单,但我在某个特定部分遇到了一些困难。 菜单有两个主要级别的项目:“新 session ”和“当前 session ”。当用户
我是一名优秀的程序员,十分优秀!