// Path: JacpFXDemo/src/main/java/org/jacp/demo/components/util/JACPOptionButtonCreator.java
// public class JACPOptionButtonCreator {
// 
//     public static final int DEFAULT_OPTION_SIZE = 6;
// 
//     public static JACPOptionButton createDefaultOptionButton(final String label, final FXComponentLayout layout, final JACPOptionButtonOrientation orientation, final int optionSize){
// 
//         JACPOptionButton optionButton = new JACPOptionButton(label, layout, orientation);
//         for(int i = 0; i < optionSize; i++){
//             optionButton.addOption(new Button("Test Optionnnnnnnnnnnnn " + i));
//         }
// 
//         return optionButton;
// 
//     }
// 
//     public static JACPOptionButton createDefaultOptionButton(final String label, final FXComponentLayout layout, final JACPOptionButtonOrientation orientation){
//         return createDefaultOptionButton(label, layout, orientation, DEFAULT_OPTION_SIZE);
//     }
// 
// }
// 
// Path: JacpFXDemo/src/main/java/org/jacp/demo/constants/GlobalConstants.java
// public class GlobalConstants {
// 
//     public class PerspectiveConstants {
//         public static final String DEMO_PERSPECTIVE = "id01";
//     }
// 
//     public class ComponentConstants {
//         public static final String COMPONENT_TREE_VIEW = "id001";
//         public static final String COMPONENT_TABLE_VIEW = "id002";
//         public static final String COMPONENT_CHART_VIEW = "id003";
//         public static final String COMPONENT_DETAIL_VIEW = "id007";
//     }
// 
//     public class CallbackConstants {
//         public static final String CALLBACK_COORDINATOR = "id004";
//         public static final String CALLBACK_CREATOR = "id005";
//         public static final String CALLBACK_ANALYTICS = "id006";
//     }
// 
//     public class CSSConstants {
//         // CLASSES
//         public static final String CLASS_DARK_BORDER = "dark-border";
// 
//         // IDs
//         public static final String ID_JACP_CUSTOM_TITLE = "jacp-custom-title";
//     }
// 
//     public static String cascade(String... ids) {
//         StringBuilder builder = new StringBuilder();
//         for (final String id : ids) {
//             if (builder.length() != 0) {
//                 builder.append(".");
//             }
//             builder.append(id);
//         }
//         return builder.toString();
//     }
// 
// }


import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jacp.demo.components.util.JACPOptionButtonCreator;
import org.jacp.demo.constants.GlobalConstants;
import org.jacpfx.api.annotations.Resource;
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.rcp.componentLayout.FXComponentLayout;
import org.jacpfx.rcp.componentLayout.PerspectiveLayout;
import org.jacpfx.rcp.components.toolBar.JACPHoverMenu;
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.MessageUtil;
import java.util.ResourceBundle;
import static org.jacpfx.api.util.ToolbarPosition.*;
import static org.jacpfx.rcp.components.toolBar.JACPOptionButtonOrientation.*;
    public void PostConstructPerspective(final FXComponentLayout layout, final ResourceBundle resourceBundle) {
        LOGGER.debug("PostConstructPerspective ressource:" + resourceBundle);
        // create button in toolbar; button should switch top and bottom id's
        final JACPToolBar north = layout.getRegisteredToolBar(NORTH);
        final JACPToolBar south = layout.getRegisteredToolBar(SOUTH);
        final JACPToolBar west = layout.getRegisteredToolBar(WEST);
        final JACPToolBar east = layout.getRegisteredToolBar(EAST);

        final Button custom = new Button("switch");
        custom.setTooltip(new Tooltip("Switch Components"));
        custom.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(final ActionEvent e) {
                context.send(SWITCH_MESSAGE);

            }
        });
        north.addOnEnd(context.getId(), custom);

        // TEST OPTIONBUTTON ON NORTH
        north.addOnEnd(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
        north.addToCenter(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
        north.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
        west.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
        west.addToCenter(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
        west.addOnEnd(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
        east.addOnEnd(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
        east.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
        east.addToCenter(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
// Path: JacpFXDemo/src/main/java/org/jacp/demo/components/util/JACPOptionButtonCreator.java
// public class JACPOptionButtonCreator {
// 
//     public static final int DEFAULT_OPTION_SIZE = 6;
// 
//     public static JACPOptionButton createDefaultOptionButton(final String label, final FXComponentLayout layout, final JACPOptionButtonOrientation orientation, final int optionSize){
// 
//         JACPOptionButton optionButton = new JACPOptionButton(label, layout, orientation);
//         for(int i = 0; i < optionSize; i++){
//             optionButton.addOption(new Button("Test Optionnnnnnnnnnnnn " + i));
//         }
// 
//         return optionButton;
// 
//     }
// 
//     public static JACPOptionButton createDefaultOptionButton(final String label, final FXComponentLayout layout, final JACPOptionButtonOrientation orientation){
//         return createDefaultOptionButton(label, layout, orientation, DEFAULT_OPTION_SIZE);
//     }
// 
// }
// 
// Path: JacpFXDemo/src/main/java/org/jacp/demo/constants/GlobalConstants.java
// public class GlobalConstants {
// 
//     public class PerspectiveConstants {
//         public static final String DEMO_PERSPECTIVE = "id01";
//     }
// 
//     public class ComponentConstants {
//         public static final String COMPONENT_TREE_VIEW = "id001";
//         public static final String COMPONENT_TABLE_VIEW = "id002";
//         public static final String COMPONENT_CHART_VIEW = "id003";
//         public static final String COMPONENT_DETAIL_VIEW = "id007";
//     }
// 
//     public class CallbackConstants {
//         public static final String CALLBACK_COORDINATOR = "id004";
//         public static final String CALLBACK_CREATOR = "id005";
//         public static final String CALLBACK_ANALYTICS = "id006";
//     }
// 
//     public class CSSConstants {
//         // CLASSES
//         public static final String CLASS_DARK_BORDER = "dark-border";
// 
//         // IDs
//         public static final String ID_JACP_CUSTOM_TITLE = "jacp-custom-title";
//     }
// 
//     public static String cascade(String... ids) {
//         StringBuilder builder = new StringBuilder();
//         for (final String id : ids) {
//             if (builder.length() != 0) {
//                 builder.append(".");
//             }
//             builder.append(id);
//         }
//         return builder.toString();
//     }
// 
// }


// Path: JacpFXDemo/src/main/java/org/jacp/demo/perspectives/ContactPerspective.java
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jacp.demo.components.util.JACPOptionButtonCreator;
import org.jacp.demo.constants.GlobalConstants;
import org.jacpfx.api.annotations.Resource;
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.rcp.componentLayout.FXComponentLayout;
import org.jacpfx.rcp.componentLayout.PerspectiveLayout;
import org.jacpfx.rcp.components.toolBar.JACPHoverMenu;
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.MessageUtil;
import java.util.ResourceBundle;
import static org.jacpfx.api.util.ToolbarPosition.*;
import static org.jacpfx.rcp.components.toolBar.JACPOptionButtonOrientation.*;

    public void PostConstructPerspective(final FXComponentLayout layout, final ResourceBundle resourceBundle) {
        LOGGER.debug("PostConstructPerspective ressource:" + resourceBundle);
        // create button in toolbar; button should switch top and bottom id's
        final JACPToolBar north = layout.getRegisteredToolBar(NORTH);
        final JACPToolBar south = layout.getRegisteredToolBar(SOUTH);
        final JACPToolBar west = layout.getRegisteredToolBar(WEST);
        final JACPToolBar east = layout.getRegisteredToolBar(EAST);

        final Button custom = new Button("switch");
        custom.setTooltip(new Tooltip("Switch Components"));
        custom.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(final ActionEvent e) {
                context.send(SWITCH_MESSAGE);

            }
        });
        north.addOnEnd(context.getId(), custom);

        // TEST OPTIONBUTTON ON NORTH
        north.addOnEnd(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
        north.addToCenter(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
        north.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
        west.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
        west.addToCenter(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
        west.addOnEnd(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
        east.addOnEnd(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
        east.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
        east.addToCenter(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
        south.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("bottom Button", layout, TOP));