- * Note that this does not set the value property of the checkbox - * input element wrapped by this widget. For access to that property, see - * {@link #setFormValue(String)} - * - * @param value true to set on, false to set off; null value implies false - */ - @Override - public void setValue(Boolean value) { - if (value == null) { - value = Boolean.FALSE; - } - - Boolean oldValue = getValue(); - if (value.equals(oldValue)) { - return; - } - this.value = value; - if (!value) { - $(switcherButton).animate("left: -1", 250); - labelOff.setStyleName("switch-button-label on"); - labelOn.setStyleName("switch-button-label off"); - } else { - $(switcherButton).animate("left: 12", 250); - labelOff.setStyleName("switch-button-label off"); - labelOn.setStyleName("switch-button-label on"); - } - } - /** - * Checks or unchecks the switch button box, firing {@link ValueChangeEvent} if - * appropriate. - *
- *
- * @param value true to set on, false to set off; null value implies false
- * @param fireEvents If true, and value has changed, fire a
- * {@link ValueChangeEvent}
- */
- @Override
- public void setValue(Boolean value, boolean fireEvents) {
- setValue(value);
- if (fireEvents) {
- ValueChangeEvent.fire(this, value);
- }
- }
-
- protected void ensureDomEventHandlers() {
- switchContainer.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent event) {
- setValue(!value);
- ValueChangeEvent.fire(SwitchButton.this, getValue());
- }
- });
- }
-
- @Override
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public String getName() {
- return name;
- }
-}
diff --git a/src/main/java/org/gcube/portlets/user/speciesdiscovery/client/switchbutton/SwitchButton.ui.xml b/src/main/java/org/gcube/portlets/user/speciesdiscovery/client/switchbutton/SwitchButton.ui.xml
deleted file mode 100644
index 0f7241f..0000000
--- a/src/main/java/org/gcube/portlets/user/speciesdiscovery/client/switchbutton/SwitchButton.ui.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-