// Path: JacpFX-showcase/src/main/java/showcase/ui/PerspectiveOptionButton.java
// public class PerspectiveOptionButton extends JACPOptionButton {
// 
// 
//     public PerspectiveOptionButton(final FXComponentLayout layout, final Context context, final String label, final Perspectives excludedPerspective) {
//         super(label, layout);
//         this.initButtons(context, excludedPerspective);
//     }
// 
//     private void initButtons(final Context context, final Perspectives excludedPerspective) {
//         for (Perspectives perspectives : Perspectives.values()) {
//             if (excludedPerspective != perspectives) {
//                 Button button = new Button(perspectives.getPerspectiveName());
//                 button.setOnAction((event) -> {
//                     context.send(perspectives.getPerspectiveId(), MessageConstants.SWITCH_MESSAGE);
//                 });
//                 this.addOption(button);
//             }
//         }
//     }
// 
// 
// }
// 
// Path: JacpFX-showcase/src/main/java/showcase/ui/Perspectives.java
// public enum Perspectives {
// 
//     PERSPECTIVE_1(PerspectiveIds.PERSPECTIVE_ONE, "Perspective 1"),
//     PERSPECTIVE_2(PerspectiveIds.PERSPECTIVE_TWO, "Perspective 2"),
//     PERSPECTIVE_3(PerspectiveIds.PERSPECTIVE_THREE, "Perspective 3"),
//     PERSPECTIVE_4(PerspectiveIds.PERSPECTIVE_FOUR, "Perspective 4");
// 
//     private String perspectiveId;
//     private String perspectiveName;
// 
//     private Perspectives(final String perspectiveId, final String perspectiveName) {
//         this.perspectiveId = perspectiveId;
//         this.perspectiveName = perspectiveName;
//     }
// 
//     public String getPerspectiveId() {
//         return perspectiveId;
//     }
// 
//     public String getPerspectiveName() {
//         return perspectiveName;
//     }
// }
// 
// Path: JacpFX-showcase/src/main/java/showcase/util/PerspectiveIds.java
// public class PerspectiveIds {
// 
//     public static final String PERSPECTIVE_ONE = "idPone";
//     public static final String PERSPECTIVE_TWO = "idPtwo";
//     public static final String PERSPECTIVE_THREE = "idPthree";
//     public static final String PERSPECTIVE_FOUR = "idPfour";
// 
// 
//     public static final String TARGET_CONTAINER_LEFT = "PLeft";
//     public static final String TARGET_CONTAINER_MAIN = "PMain";
// 
// }
// 
// Path: JacpFX-showcase/src/main/java/showcase/util/PerspectiveIds.java
// public static final String TARGET_CONTAINER_LEFT = "PLeft";
// 
// Path: JacpFX-showcase/src/main/java/showcase/util/PerspectiveIds.java
// public static final String TARGET_CONTAINER_MAIN = "PMain";


import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.geometry.Orientation;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.SplitPane;
import javafx.scene.effect.DropShadow;
import javafx.scene.input.SwipeEvent;
import javafx.scene.layout.GridPane;
import org.jacpfx.api.annotations.Resource;
import org.jacpfx.api.annotations.lifecycle.OnShow;
import org.jacpfx.api.annotations.lifecycle.PostConstruct;
import org.jacpfx.api.annotations.lifecycle.PreDestroy;
import org.jacpfx.api.annotations.perspective.Perspective;
import org.jacpfx.api.message.Message;
import org.jacpfx.api.util.ToolbarPosition;
import org.jacpfx.controls.optionPane.JACPDialogButton;
import org.jacpfx.controls.optionPane.JACPDialogUtil;
import org.jacpfx.controls.optionPane.JACPOptionPane;
import org.jacpfx.rcp.componentLayout.FXComponentLayout;
import org.jacpfx.rcp.componentLayout.PerspectiveLayout;
import org.jacpfx.rcp.components.toolBar.JACPOptionButton;
import org.jacpfx.rcp.components.toolBar.JACPToolBar;
import org.jacpfx.rcp.context.Context;
import org.jacpfx.rcp.perspective.FXPerspective;
import org.jacpfx.rcp.util.FXUtil;
import showcase.ui.PerspectiveOptionButton;
import showcase.ui.Perspectives;
import showcase.util.PerspectiveIds;
import java.util.ResourceBundle;
import static javafx.scene.layout.Priority.ALWAYS;
import static org.jacpfx.rcp.util.LayoutUtil.GridPaneUtil;
import static showcase.util.PerspectiveIds.TARGET_CONTAINER_LEFT;
import static showcase.util.PerspectiveIds.TARGET_CONTAINER_MAIN;
            };

            mainLayout.setOnSwipeLeft(swipeHandler);
            mainLayout.setOnSwipeRight(swipeHandler);
            mainLayout.setOnSwipeDown(swipeHandler);
            mainLayout.setOnSwipeUp(swipeHandler);

        }

    }


    @OnShow
    public void onShow(final FXComponentLayout layout) {

    }

    @PostConstruct
    /**
     * @OnStart annotated method will be executed when component is activated.
     * @param layout
     * @param resourceBundle
     */
    public void onStartPerspective(final FXComponentLayout layout,
                                   final ResourceBundle resourceBundle) {
        // TODO get message from resource
        // define toolbars and menu entries
        JACPToolBar toolbar = layout.getRegisteredToolBar(ToolbarPosition.NORTH);
        Button pressMe = new Button("press me");

// Path: JacpFX-showcase/src/main/java/showcase/ui/PerspectiveOptionButton.java
// public class PerspectiveOptionButton extends JACPOptionButton {
// 
// 
//     public PerspectiveOptionButton(final FXComponentLayout layout, final Context context, final String label, final Perspectives excludedPerspective) {
//         super(label, layout);
//         this.initButtons(context, excludedPerspective);
//     }
// 
//     private void initButtons(final Context context, final Perspectives excludedPerspective) {
//         for (Perspectives perspectives : Perspectives.values()) {
//             if (excludedPerspective != perspectives) {
//                 Button button = new Button(perspectives.getPerspectiveName());
//                 button.setOnAction((event) -> {
//                     context.send(perspectives.getPerspectiveId(), MessageConstants.SWITCH_MESSAGE);
//                 });
//                 this.addOption(button);
//             }
//         }
//     }
// 
// 
// }
// 
// Path: JacpFX-showcase/src/main/java/showcase/ui/Perspectives.java
// public enum Perspectives {
// 
//     PERSPECTIVE_1(PerspectiveIds.PERSPECTIVE_ONE, "Perspective 1"),
//     PERSPECTIVE_2(PerspectiveIds.PERSPECTIVE_TWO, "Perspective 2"),
//     PERSPECTIVE_3(PerspectiveIds.PERSPECTIVE_THREE, "Perspective 3"),
//     PERSPECTIVE_4(PerspectiveIds.PERSPECTIVE_FOUR, "Perspective 4");
// 
//     private String perspectiveId;
//     private String perspectiveName;
// 
//     private Perspectives(final String perspectiveId, final String perspectiveName) {
//         this.perspectiveId = perspectiveId;
//         this.perspectiveName = perspectiveName;
//     }
// 
//     public String getPerspectiveId() {
//         return perspectiveId;
//     }
// 
//     public String getPerspectiveName() {
//         return perspectiveName;
//     }
// }
// 
// Path: JacpFX-showcase/src/main/java/showcase/util/PerspectiveIds.java
// public class PerspectiveIds {
// 
//     public static final String PERSPECTIVE_ONE = "idPone";
//     public static final String PERSPECTIVE_TWO = "idPtwo";
//     public static final String PERSPECTIVE_THREE = "idPthree";
//     public static final String PERSPECTIVE_FOUR = "idPfour";
// 
// 
//     public static final String TARGET_CONTAINER_LEFT = "PLeft";
//     public static final String TARGET_CONTAINER_MAIN = "PMain";
// 
// }
// 
// Path: JacpFX-showcase/src/main/java/showcase/util/PerspectiveIds.java
// public static final String TARGET_CONTAINER_LEFT = "PLeft";
// 
// Path: JacpFX-showcase/src/main/java/showcase/util/PerspectiveIds.java
// public static final String TARGET_CONTAINER_MAIN = "PMain";


// Path: JacpFX-showcase/src/main/java/showcase/perspectives/PerspectiveOne.java
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.geometry.Orientation;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.SplitPane;
import javafx.scene.effect.DropShadow;
import javafx.scene.input.SwipeEvent;
import javafx.scene.layout.GridPane;
import org.jacpfx.api.annotations.Resource;
import org.jacpfx.api.annotations.lifecycle.OnShow;
import org.jacpfx.api.annotations.lifecycle.PostConstruct;
import org.jacpfx.api.annotations.lifecycle.PreDestroy;
import org.jacpfx.api.annotations.perspective.Perspective;
import org.jacpfx.api.message.Message;
import org.jacpfx.api.util.ToolbarPosition;
import org.jacpfx.controls.optionPane.JACPDialogButton;
import org.jacpfx.controls.optionPane.JACPDialogUtil;
import org.jacpfx.controls.optionPane.JACPOptionPane;
import org.jacpfx.rcp.componentLayout.FXComponentLayout;
import org.jacpfx.rcp.componentLayout.PerspectiveLayout;
import org.jacpfx.rcp.components.toolBar.JACPOptionButton;
import org.jacpfx.rcp.components.toolBar.JACPToolBar;
import org.jacpfx.rcp.context.Context;
import org.jacpfx.rcp.perspective.FXPerspective;
import org.jacpfx.rcp.util.FXUtil;
import showcase.ui.PerspectiveOptionButton;
import showcase.ui.Perspectives;
import showcase.util.PerspectiveIds;
import java.util.ResourceBundle;
import static javafx.scene.layout.Priority.ALWAYS;
import static org.jacpfx.rcp.util.LayoutUtil.GridPaneUtil;
import static showcase.util.PerspectiveIds.TARGET_CONTAINER_LEFT;
import static showcase.util.PerspectiveIds.TARGET_CONTAINER_MAIN;

            };

            mainLayout.setOnSwipeLeft(swipeHandler);
            mainLayout.setOnSwipeRight(swipeHandler);
            mainLayout.setOnSwipeDown(swipeHandler);
            mainLayout.setOnSwipeUp(swipeHandler);

        }

    }


    @OnShow
    public void onShow(final FXComponentLayout layout) {

    }

    @PostConstruct
    /**
     * @OnStart annotated method will be executed when component is activated.
     * @param layout
     * @param resourceBundle
     */
    public void onStartPerspective(final FXComponentLayout layout,
                                   final ResourceBundle resourceBundle) {
        // TODO get message from resource
        // define toolbars and menu entries
        JACPToolBar toolbar = layout.getRegisteredToolBar(ToolbarPosition.NORTH);
        Button pressMe = new Button("press me");

        JACPOptionButton options = new PerspectiveOptionButton(layout, context, "Perspectives", Perspectives.PERSPECTIVE_1);