long live symmetry

This commit is contained in:
sirjonasxx 2018-09-25 19:05:12 +02:00
parent b864228553
commit fdd75c142f
2 changed files with 8 additions and 3 deletions

View File

@ -71,6 +71,8 @@ public abstract class ExtensionForm extends Application {
public abstract void setStageData(Stage primaryStage) throws Exception; public abstract void setStageData(Stage primaryStage) throws Exception;
//wrap extension methods
protected boolean requestFlags(Extension.FlagsCheckListener flagRequestCallback){ protected boolean requestFlags(Extension.FlagsCheckListener flagRequestCallback){
return extension.requestFlags(flagRequestCallback); return extension.requestFlags(flagRequestCallback);
} }

View File

@ -72,12 +72,15 @@ public class ExtensionItemContainer extends GridPane {
deleteButton.show(); deleteButton.show();
deleteButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isRemoveClickTrigger()); deleteButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isRemoveClickTrigger());
SimpleClickButton clickButton = new SimpleClickButton(); SimpleClickButton clickButton = new SimpleClickButton();
if (item.isFireButtonUsed()) {
clickButton.show();
}
clickButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isClickTrigger()); clickButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isClickTrigger());
HBox buttonsBox = new HBox(clickButton, deleteButton); HBox buttonsBox = new HBox(clickButton, deleteButton);
if (item.isFireButtonUsed()) {
clickButton.show();
}
else {
HBox.setMargin(deleteButton, new Insets(0,0,0,26));
}
buttonsBox.setSpacing(item.isFireButtonUsed() ? 10 : 0); buttonsBox.setSpacing(item.isFireButtonUsed() ? 10 : 0);
buttonsBox.setAlignment(Pos.CENTER); buttonsBox.setAlignment(Pos.CENTER);
GridPane.setMargin(buttonsBox, new Insets(0, 5, 0, 5)); GridPane.setMargin(buttonsBox, new Insets(0, 5, 0, 5));