Commit 55375f3a authored by Sarah Grebing's avatar Sarah Grebing

Empty tab pane has buttons now, need to add the appropriate Action

parent 2ce23e4b
Pipeline #11045 failed with stage
in 3 minutes and 3 seconds
package edu.kit.formal.gui.controls; package edu.kit.formal.gui.controls;
import com.sun.javafx.scene.control.skin.TabPaneSkin; import com.sun.javafx.scene.control.skin.TabPaneSkin;
import javafx.geometry.Pos;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.TabPane; import javafx.scene.control.TabPane;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
...@@ -19,16 +20,9 @@ public class CustomTabPaneSkin extends TabPaneSkin { ...@@ -19,16 +20,9 @@ public class CustomTabPaneSkin extends TabPaneSkin {
public CustomTabPaneSkin(TabPane tabPane) { public CustomTabPaneSkin(TabPane tabPane) {
super(tabPane); super(tabPane);
placeHolder = new PlaceHolderTab(); placeHolder = new PlaceHolderTab();
//placeHolderText = new Label( "Empty" ); placeHolder.getVbox().minWidthProperty().bind(getSkinnable().widthProperty());
//placeHolderText.setFont( Font.font( null, FontWeight.BOLD, 20 ) ); placeHolder.getVbox().minHeightProperty().bind(getSkinnable().heightProperty());
//placeHolderText.setAlignment( Pos.CENTER ); placeHolder.getVbox().setAlignment(Pos.CENTER);
//placeHolderText.minWidthProperty().bind( getSkinnable().widthProperty() );
//placeHolderText.minHeightProperty().bind( getSkinnable().heightProperty() );
//placeHolder = new VBox( placeHolderText );
placeHolder.minWidthProperty().bind(getSkinnable().widthProperty());
placeHolder.minHeightProperty().bind(getSkinnable().heightProperty());
for (Node node : getChildren()) { for (Node node : getChildren()) {
if (node.getStyleClass().contains("tab-header-area")) { if (node.getStyleClass().contains("tab-header-area")) {
......
package edu.kit.formal.gui.controls; package edu.kit.formal.gui.controls;
import javafx.geometry.Insets; import javafx.geometry.Pos;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
/** /**
* Replacement for empty Tab with two buttons * Replacement for empty Tab with two buttons
*/ */
public class PlaceHolderTab extends VBox { public class PlaceHolderTab extends FlowPane {
/**
* Button to open a new script
*/
private final Button newScript = new Button("New Script"); private final Button newScript = new Button("New Script");
/**
* Button to open a script
*/
private final Button openScript = new Button("Open Script"); private final Button openScript = new Button("Open Script");
private VBox vbox;
/**
* Pane holding the buttons for an empty tab
*/
public PlaceHolderTab() { public PlaceHolderTab() {
this.setPadding(new Insets(10, 50, 50, 50)); vbox = new VBox();
this.setSpacing(10);
newScript.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
openScript.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
newScript.setAlignment(Pos.CENTER);
openScript.setAlignment(Pos.CENTER);
vbox.getChildren().add(newScript);
vbox.getChildren().add(openScript);
vbox.setAlignment(Pos.CENTER);
this.getChildren().add(vbox);
}
this.getChildren().add(newScript); public VBox getVbox() {
this.getChildren().add(openScript); return vbox;
} }
public Button getNewScript() { public Button getNewScript() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment