final Stage stage = Stage.createStage();
GridBox grid = new GridBox()
.createColumn(20, GridBox.Align.Right)
.createColumn(100, GridBox.Align.Left)
;
final Checkbox backgroundCheckbox = new Checkbox("include background");
grid.addControl(backgroundCheckbox);
backgroundCheckbox.setSelected(includeBackground);
grid.nextRow();
final Checkbox documentBounds = new Checkbox("full document bounds");
documentBounds.setSelected(includeDocumentBounds);
grid.addControl(documentBounds);
grid.nextRow();
Button cancelButton = new Button("cancel");
cancelButton.onClicked(new Callback<ActionEvent>() {
public void call(ActionEvent actionEvent) throws Exception {
stage.hide();
}
});
grid.addControl(cancelButton);
Button continueButton = new Button("continue");
continueButton.onClicked(new Callback<ActionEvent>() {
public void call(ActionEvent actionEvent) throws Exception {
stage.hide();
includeBackground = backgroundCheckbox.isSelected();
includeDocumentBounds = documentBounds.isSelected();
SavePNGAction.super.execute();
}
});
grid.addControl(continueButton);
stage.setContent(grid);