I'm investigating the best practices to use Bootstrap library with GWT. I prefer not use the GWT-Bootstrap project and prefer to use plain css and js Bootstrap library in my GWT app.
I'm searching how i can apply Bootstrap style to GWT UI components? do i need to do this in the UI view code by working on the DOM Elements of GWT components ? or is there any other clean way to achieve this integration of GWT and Bootstrap?
You certainly can use Bootstrap and GWT without a third-party wrapper library, adding Bootstrap's CSS classes with the
addStyleNames
attribute in UiBinder XML or the same method in Java code. But Bootstrap also works heavily with custom data attributes likedata-toggle
for instance to let the "magic" happen. Since GWT's default widgets (FlowPanel
etc.) don't offer setters for these custom attributes you can't set them in UiBinder XML and find yourself writing lots ofin your Java code.
That's what wrapper libraries like GWT-Bootstrap or GwtBootstrap3 are for. They offer custom widgets that wrap these functionalities so that you can use Bootstrap widgets as you are used to with default GWT widgets.