public static ButtonBase makeFormButton(String text, ClickHandler handler) { PushButton b = new PushButton(); b.addClickHandler(handler); b.setHTML(text.replace(" ", " ")); return b; }
public void onClick(ClickEvent event) { Object sender = event.getSource(); if (sender instanceof ButtonBase) { ButtonBase b = (ButtonBase) sender; Command command = buttonMap.get(b); if (command != null) { command.execute(); } } }
public ButtonBase getSubmitButton() { return submitButton; }
public void addButton(ButtonBase button) { buttonBar.addLeft(button); }
public void addSubmitButton(ButtonBase button) { addButton(button); submitButton = button; }
protected ButtonBase makeButton(String desc) { PushButton button= new PushButton(desc); button.addStyleName("fuse-push-font-size"); return button; }
public void addAction(ButtonBase button) { addButton(button); buttonMap.put(button, null); }
private void addButton(ButtonBase button) { if (buttonMap.size() != 0) { button.getElement().getStyle().setMarginLeft(6, Unit.PX); } add(button); }
public void setEnabled(boolean enabled) { for (ButtonBase button : buttonMap.keySet()){ button.setEnabled(enabled); } }
public void setEnabled(boolean enabled, String text){ for (ButtonBase button : buttonMap.keySet()){ if (button.getText().equals(text)) button.setEnabled(enabled); } }
public void setVisible(boolean visible, String text){ for (ButtonBase button : buttonMap.keySet()){ if (button.getText().equals(text)) button.setVisible(visible); } }