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;
import com.sun.javafx.scene.control.skin.TabPaneSkin;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.TabPane;
import javafx.scene.layout.Pane;
......@@ -19,16 +20,9 @@ public class CustomTabPaneSkin extends TabPaneSkin {
public CustomTabPaneSkin(TabPane tabPane) {
super(tabPane);
placeHolder = new PlaceHolderTab();
//placeHolderText = new Label( "Empty" );
//placeHolderText.setFont( Font.font( null, FontWeight.BOLD, 20 ) );
//placeHolderText.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());
placeHolder.getVbox().minWidthProperty().bind(getSkinnable().widthProperty());
placeHolder.getVbox().minHeightProperty().bind(getSkinnable().heightProperty());
placeHolder.getVbox().setAlignment(Pos.CENTER);
for (Node node : getChildren()) {
if (node.getStyleClass().contains("tab-header-area")) {
......
package edu.kit.formal.gui.controls;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.VBox;
/**
* 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");
/**
* Button to open a script
*/
private final Button openScript = new Button("Open Script");
private VBox vbox;
/**
* Pane holding the buttons for an empty tab
*/
public PlaceHolderTab() {
this.setPadding(new Insets(10, 50, 50, 50));
this.setSpacing(10);
vbox = new VBox();
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);
this.getChildren().add(openScript);
public VBox getVbox() {
return vbox;
}
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