简体   繁体   English

混合GWT和Ext GWT

[英]Mixing GWT and Ext GWT

I use Ext GWT in my project. 我在项目中使用Ext GWT Why is it recommended to use a minimal amount of native GWT widgets and classes when using Ext GWT? 为什么在使用Ext GWT时建议使用最少的本机GWT小部件和类? Is it because of increases in the size of the client-side code package or some other reason? 是因为客户端代码包的大小增加还是其他原因?

I wouldn't jump at the chance to use Ext GWT, because the real "danger" is future portability and maintainability concerns. 我不会抓住机会使用Ext GWT,因为真正的“危险”是将来的可移植性和可维护性问题。 The reason you'd be recommended not to mix too many native GWT widgets with Ext GWT widgets is because Ext's widgets have a different "look and feel" than their native GWT cousins. 建议您不要将过多的本地GWT小部件与Ext GWT小部件混合使用,原因是因为Ext的小部件具有与其本地GWT表亲不同的“外观”。 GWT uses (mostly) native HTML elements, whereas Ext GWT uses almost completely custom elements. GWT使用(大部分)本地HTML元素,而Ext GWT使用几乎完全自定义的元素。

One example is Ext's ComboBox (left), which looks nothing like GWT's ListBox (right). 一个例子是Ext的ComboBox(左),看起来与GWT的ListBox(右)完全不同。

Ext GWT组合框 vs VS GWT列表框

That's on Windows. 在Windows上。 On Mac, there's even more disparity. 在Mac上,差异更大。

The CSS, though, doesn't collide. 但是,CSS不会冲突。 Ext GWT uses custom style names, which are prefixed by x- or ext- , whereas GWT style names begin with gwt- . Ext GWT使用自定义样式名称,它们以x-ext- ,而GWT样式名称以gwt-开头。

So my take is this: if you're looking to add some cool widgets at the expense of future portability and maintainability, go with Ext GWT. 因此,我的看法是:如果您希望添加一些很酷的小部件而以将来的可移植性和可维护性为代价,请使用Ext GWT。 If you have any intention of potentially removing the proprietary Ext GWT stuff later, you're probably shooting yourself in the foot over a few pretty UI elements. 如果您打算以后删除专有的Ext GWT东西,那么您可能会迷上一些漂亮的UI元素。 There's hardly any concept of "just UI" with Ext stuff. Ext东西几乎没有“只是UI”的概念。 You're all but forced to deeply integrate it. 几乎所有人都被迫深度整合它。

For the record, I used Ext GWT for a bunch of stuff, only to later bear the pain of removing the proprietary elements later. 作为记录,我使用Ext GWT编写了很多东西,后来才忍受了以后删除专有元素的痛苦。 In retrospect, I never should have done it. 回想起来,我绝对不应该这样做。

EXT GWT is based on GWT and extends it by providing a beautiful set of UI elements. EXT GWT基于GWT,并通过提供一组精美的UI元素对其进行了扩展。 These elements are generated by creating custom CSS which you don't have direct access to. 这些元素是通过创建您无法直接访问的自定义CSS生成的。 Whereas in the case of GWT, all Widgets are modifiable with the CSS file of the project. 而对于GWT,所有Widget都可以使用项目的CSS文件进行修改。

So, it is not a good way to mix 2 programming languages where in the first you cannot control its CSS and in the 2nd you can do that. 因此,这不是混合两种编程语言的好方法,在第一种语言中,您无法控制其CSS,而在第二种语言中,您可以做到这一点。 There might also be conflicts in case you have same style names. 如果您使用相同的样式名称,也可能会发生冲突。

Also, as this link says, there are some inconsistency while mixing components from different GWT extensions such as smartgwt and gwt (the same applies to extgwt and gwt) 而且,正如此链接所述 ,在混合来自不同GWT扩展程序的组件(例如smartgwt和gwt)时也存在一些不一致之处(extgwt和gwt同样适用)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM