Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created June 29, 2010 12:10
Show Gist options
  • Save borkdude/457132 to your computer and use it in GitHub Desktop.
Save borkdude/457132 to your computer and use it in GitHub Desktop.
public class ButtonOperator extends Button {
/*public ButtonOperator(final CalculatorController controller,
final AbstractOperator op) {
super(op.label);
this.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
controller.processOperator(op);
}
});
this.setStyleName(CalculatorConstants.STYLE_BUTTON);
}*/
public ButtonOperator(final CalculatorController controller,
final BinaryOperator op) {
super(op.label);
this.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
controller.processOperator(op);
}
});
this.setStyleName(CalculatorConstants.STYLE_BUTTON);
}
public ButtonOperator(final CalculatorController controller,
final UnaryOperator op) {
super(op.label);
this.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
controller.processOperator(op);
}
});
this.setStyleName(CalculatorConstants.STYLE_BUTTON);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment