Why is gwt-bootstrap necessary?

…衆ロ難τιáo~ 提交于 2019-12-06 01:41:42

问题


I'm new to GWT and was looking at using Twitter Bootstrap for a CSS framework. But then I ran across gwt-bootstrap, which bills itself as a way of using Bootstrap in a GWT app.

Since I'm so new to GWT, it has me a little concerned/confused: why can't a GWT app just use the regular Bootstrap framework? Why does it even need gwt-bootstrap?


回答1:


I started GWT-Bootstrap with the intention to bind the bootstrap JS and CSS to reusable GWT components, otherwise, you will probably need to replicate code, which will probably ends with you creating your own code, which will probably be very similar to GWT-Bootstrap.

It also have some facilities to bind events and etc.

But, answering your main question: It depends. If you don't trust community and/or have a lot of time, you could do your own gwt-bootstrap like project, but probably integrated with your project, at least, this was what happened in my case... so, I started GWT-Bootstrap and some fellas like it, and big story short: Now it is what it is. Need a lot of improvements, updates, better docs, and a lot of things, but the true is: I don't have so much time for it.

So, if I was you, I probably will help GWT-Bootstrap community instead of "reinvent the wheel", but that's just my opinion.

Happy study.


EDIT to add thing @IAmYourFaja ask in comments.

The injection as you mean (or as I believe you are meaning) is not centralized.

We have the ResourceInjector that injects some resources, setup viewport and etc, and the Resources.gwt.xml module which injects CSS files. We also have the component classes, which setup the JS plugins (when needed) and CSS classes. You can take a look at TabPanel for an example if you want.




回答2:


It looks like a large part of gwt-bootstrap is wrapping the javascript pieces of Bootstrap, which would mean you could keep using Java. There are other chunks that let you use Enums instead of plain Css class names.

GWT does generate javascript and css, and you can still mix other Css and JS with it. I think this project just makes it so you can keep your codebase in Java.

It looks like it also supports UiBinder-y references, as in

<b:Row>
    <b:Column size="4">...</b:Column>
    <b:Column size="8">...</b:Column>
</b:Row>


来源:https://stackoverflow.com/questions/16528973/why-is-gwt-bootstrap-necessary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!