use of com.ray3k.skincomposer.UndoableManager.DeleteStyleUndoable in project skin-composer by raeleus.
the class DialogFactory method showDeleteStyleDialog.
public void showDeleteStyleDialog(Skin skin, Stage stage) {
StyleData styleData = main.getRootTable().getSelectedStyle();
Dialog dialog = new Dialog("Delete Style", skin, "bg") {
@Override
protected void result(Object object) {
if ((Boolean) object) {
main.getUndoableManager().addUndoable(new DeleteStyleUndoable(styleData, main), true);
}
}
};
dialog.getTitleLabel().setAlignment(Align.center);
dialog.getContentTable().defaults().padLeft(10.0f).padRight(10.0f);
dialog.text("Are you sure you want to delete style " + styleData.name + "?");
dialog.getContentTable().getCells().first().pad(10.0f);
dialog.getButtonTable().defaults().padBottom(10.0f).minWidth(50.0f);
dialog.button("Yes, delete the style", true).button("No", false);
dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
dialog.getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());
dialog.key(Input.Keys.ENTER, true).key(Input.Keys.ESCAPE, false);
dialog.show(stage);
}
Aggregations