gwtbootstrap3/gwtbootstrap3-extras — pull request #101 by klimeryk (2014-12-17 02:19:55+00:00)
Title: Improvements to ToggleSwitch

I've started with updating Bootstrap Switch to the newest version: 3.2.2 (the one used now is 3.0.0).
This adds some nice improvements, like automatic resizing of labels and handles, among others.

I've implemented most options from http://www.bootstrap-switch.org/options-3.html (skipped baseClass and wrapperClass), including proper implementation of HasEnabled which fixes gwtbootstrap3/gwtbootstrap3-extras#50.

I've refactored the code so that the state of the widget is not stored in the class if it's not necessary (I've left the enum fields since that was easiest option to implement the getters - do we even need them?). If the widget is not attached, the value is stored in the element's attribute (as defined on http://www.bootstrap-switch.org/options-3.html). When we call `switchInit` in `onLoad`, the attributes are automagically taken into account when initializing the Switch. No need to explicitly set them in `onLoad`. The available options are grouped in a handly `Option` package-visible enum.
Those changes should make it easier to extend this widget in the future, for example to add new options.