public static void main(final String[] args) {
new ButtonExample();
}
protected void views(final Workspace workspace) {
ButtonAction action = new ButtonAction() {
public Consent disabled(final View view) {
return Allow.DEFAULT;
}
public void execute(final Workspace workspace, final View view, final Location at) {
view.getFeedbackManager().setAction("Button 1 pressed");
}
public String getDescription(final View view) {
return "Button that can be pressed";
}
public ObjectActionType getType() {
return USER;
}
public String getName(final View view) {
return "Action";
}
public boolean isDefault() {
return true;
}
public String getHelp(final View view) {
return null;
}
};
View view = new Button(action, workspace);
view.setLocation(new Location(100, 100));
view.setSize(view.getRequiredSize(new Size()));
workspace.addView(view);
ButtonAction action2 = new ButtonAction() {
public Consent disabled(final View view) {
return Veto.DEFAULT;
}