public void setButtonState(int index, boolean down) { Widget btn = buttons.get(index); if (btn instanceof ToggleButton) { ToggleButton tbtn = (ToggleButton) btn; tbtn.setDown(down); } }
@Override public void setValue(Boolean value, boolean fireEvents) { selected = value; if (selected) { left.setEnabled(false); left.setDown(true); right.setEnabled(true); right.setDown(false); } else { right.setEnabled(false); right.setDown(true); left.setEnabled(true); left.setDown(false); } if (fireEvents) { ValueChangeEvent.fire(this, selected); } }
private void initEditorToggle() { final RootPanel togglePanel = RootPanel.get("paramsToggleButton"); editorToggle = new ToggleButton(new Image("images/triright.png"), new Image("images/tridown.png")); editorToggle.setDown(false); editorToggle.addStyleName("toggle-button"); togglePanel.add(editorToggle); editorToggle.addClickHandler( new ClickHandler() { @Override public void onClick(final ClickEvent event) { paramsEditor.setEditorExpanded(editorToggle.isDown()); } }); }
public HideShowAnnotationsButton(final AnnotationController annotationController) { final TranslationConstants translationConstants = GWT.create(TranslationConstants.class); final ToggleButton button = new ToggleButton( translationConstants.showAnnotations(), translationConstants.hideAnnotations()); button.setStyleName("annotation-hide-show-button"); button.setDown(annotationController.isAnnotationsVisible()); button.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { if (button.isDown()) { showAnnotations(); } else { hideAnnotations(); } } }); initWidget(button); }
@Override public void setContentSelection(final String view) { mapToggleButton.setDown(TestbedSelectionParams.MAP_VIEW.getValue().equals(view)); detailToggleButton.setDown(TestbedSelectionParams.DETAIL_VIEW.getValue().equals(view)); rawToggleButton.setDown(TestbedSelectionParams.RAW_WISEML_VIEW.getValue().equals(view)); }