// Path: JacpFXDemo/src/main/java/org/jacp/demo/workbench/ContactWorkbench.java
// @Workbench(id = "id1", name="workbench",perspectives = "id01")
// public class ContactWorkbench implements FXWorkbench {
// 
//     private final String projectURL = "http://code.google.com/p/jacp/wiki/Documentation";
//     private final String message = "JacpFX is a Framework to create Rich Clients in MVC style with JavaFX 2, Spring and an Actor like component approach. It provides a simple API to create a workspace, perspective, component and to compose your Client application easily. More Info see: ";
// 
//     @Resource
//     private Context context;
// 
//     @Override
//     public void handleInitialLayout(final Message<Event, Object> message, final WorkbenchLayout<Node> layout, final Stage stage) {
//         layout.setWorkbenchXYSize(1024, 768);
//         layout.registerToolBars(NORTH, SOUTH, EAST, WEST);
//         layout.setStyle(StageStyle.UNDECORATED);
//         layout.setMenuEnabled(true);
//     }
// 
//     @Override
//     public void postHandle(final FXComponentLayout layout) {
//         final JACPMenuBar menu = layout.getMenu();
//         final Menu menuFile = new Menu("File");
//         menuFile.getItems().addAll(this.createExitEntry(), this.createInfoEntry());
//         menu.getMenus().addAll(menuFile);
//         menu.registerWindowButtons();
//     }
// 
//     private MenuItem createInfoEntry() {
//         final MenuItem info = new MenuItem("Info");
//         info.setOnAction(new EventHandler<ActionEvent>() {
//             @Override
//             public void handle(final ActionEvent arg0) {
//                 final VBox box = new VBox();
//                 box.setId("HelpDialog");
//                 box.setMaxSize(500, Region.USE_PREF_SIZE);
// 
//                 final Button ok = new Button("OK");
//                 HBox.setMargin(ok, new Insets(6, 5, 4, 2));
//                 final HBox hboxButtons = new HBox();
//                 hboxButtons.setAlignment(Pos.CENTER_RIGHT);
//                 ok.setOnAction(new EventHandler<ActionEvent>() {
// 
//                     @Override
//                     public void handle(final ActionEvent actionEvent) {
//                         JACPModalDialog.getInstance().hideModalDialog();
//                     }
//                 });
// 
//                 hboxButtons.getChildren().addAll(ok);
//                 box.getChildren().addAll(ContactWorkbench.this.createTitle(), ContactWorkbench.this.createInfoText(), ContactWorkbench.this.createProjectLink(), hboxButtons);
//                 JACPModalDialog.getInstance().showModalDialog(box);
// 
//             }
//         });
//         return info;
//     }
// 
//     private MenuItem createExitEntry() {
//         final MenuItem itemExit = new MenuItem("Exit");
//         itemExit.setOnAction(new EventHandler<ActionEvent>() {
//             @Override
//             public void handle(final ActionEvent arg0) {
//                 System.exit(0);
// 
//             }
//         });
//         return itemExit;
//     }
// 
//     private Label createTitle() {
//         final Label title = new Label("JacpFX project quickstart");
//         title.setId("jacp-custom-title");
//         VBox.setMargin(title, new Insets(2, 2, 10, 2));
//         return title;
//     }
// 
//     private Text createInfoText() {
//         return TextBuilder.create().layoutY(100).textOrigin(VPos.TOP).textAlignment(TextAlignment.JUSTIFY).wrappingWidth(400).text(this.message).fill(Color.WHITE).build();
//     }
// 
//     private Hyperlink createProjectLink() {
//         final Hyperlink link = new Hyperlink();
//         link.setText(this.projectURL);
//         link.setStyle("-fx-text-fill: white;");
//         link.setOnAction(new EventHandler<ActionEvent>() {
//             @Override
//             public void handle(final ActionEvent event) {
//                 final WebView wv = new WebView();
//                 wv.getEngine().load(ContactWorkbench.this.projectURL);
//                 final Scene scene = new Scene(wv, 1024, 768);
//                 final Stage stage = new Stage();
//                 stage.setTitle("JacpFX documentation");
//                 stage.setScene(scene);
//                 stage.show();
// 
//             }
//         });
//         return link;
//     }
// 
// 
// }


import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import org.jacp.demo.workbench.ContactWorkbench;
import org.jacpfx.rcp.workbench.FXWorkbench;
import org.jacpfx.spring.launcher.AFXSpringXmlLauncher;
/*
 * Copyright (C) 2010,2011.
 * AHCP Project (http://code.google.com/p/jacp)
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at 
 *
 *     http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
 * express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package org.jacp.demo.main;



/**
 * JacpFX application launcher and main method for contact jacpfx. This is the
 * entry class to start initial context of an JacpFX application. Here you
 * define the location of the spring-xml and can handle settings like css
 * configuration.
 * 
 * @author Andy Moncsek
 * 
 */
public class ContactMain extends AFXSpringXmlLauncher {

    private Scene scene;

    public ContactMain() {
    }

    @Override
    public String getXmlConfig() {
        return "main.xml";
    }

    /**
     * @param args  aa  ddd
     */
    public static void main(final String[] args) {
        Application.launch(args);
    }


    @Override
// Path: JacpFXDemo/src/main/java/org/jacp/demo/workbench/ContactWorkbench.java
// @Workbench(id = "id1", name="workbench",perspectives = "id01")
// public class ContactWorkbench implements FXWorkbench {
// 
//     private final String projectURL = "http://code.google.com/p/jacp/wiki/Documentation";
//     private final String message = "JacpFX is a Framework to create Rich Clients in MVC style with JavaFX 2, Spring and an Actor like component approach. It provides a simple API to create a workspace, perspective, component and to compose your Client application easily. More Info see: ";
// 
//     @Resource
//     private Context context;
// 
//     @Override
//     public void handleInitialLayout(final Message<Event, Object> message, final WorkbenchLayout<Node> layout, final Stage stage) {
//         layout.setWorkbenchXYSize(1024, 768);
//         layout.registerToolBars(NORTH, SOUTH, EAST, WEST);
//         layout.setStyle(StageStyle.UNDECORATED);
//         layout.setMenuEnabled(true);
//     }
// 
//     @Override
//     public void postHandle(final FXComponentLayout layout) {
//         final JACPMenuBar menu = layout.getMenu();
//         final Menu menuFile = new Menu("File");
//         menuFile.getItems().addAll(this.createExitEntry(), this.createInfoEntry());
//         menu.getMenus().addAll(menuFile);
//         menu.registerWindowButtons();
//     }
// 
//     private MenuItem createInfoEntry() {
//         final MenuItem info = new MenuItem("Info");
//         info.setOnAction(new EventHandler<ActionEvent>() {
//             @Override
//             public void handle(final ActionEvent arg0) {
//                 final VBox box = new VBox();
//                 box.setId("HelpDialog");
//                 box.setMaxSize(500, Region.USE_PREF_SIZE);
// 
//                 final Button ok = new Button("OK");
//                 HBox.setMargin(ok, new Insets(6, 5, 4, 2));
//                 final HBox hboxButtons = new HBox();
//                 hboxButtons.setAlignment(Pos.CENTER_RIGHT);
//                 ok.setOnAction(new EventHandler<ActionEvent>() {
// 
//                     @Override
//                     public void handle(final ActionEvent actionEvent) {
//                         JACPModalDialog.getInstance().hideModalDialog();
//                     }
//                 });
// 
//                 hboxButtons.getChildren().addAll(ok);
//                 box.getChildren().addAll(ContactWorkbench.this.createTitle(), ContactWorkbench.this.createInfoText(), ContactWorkbench.this.createProjectLink(), hboxButtons);
//                 JACPModalDialog.getInstance().showModalDialog(box);
// 
//             }
//         });
//         return info;
//     }
// 
//     private MenuItem createExitEntry() {
//         final MenuItem itemExit = new MenuItem("Exit");
//         itemExit.setOnAction(new EventHandler<ActionEvent>() {
//             @Override
//             public void handle(final ActionEvent arg0) {
//                 System.exit(0);
// 
//             }
//         });
//         return itemExit;
//     }
// 
//     private Label createTitle() {
//         final Label title = new Label("JacpFX project quickstart");
//         title.setId("jacp-custom-title");
//         VBox.setMargin(title, new Insets(2, 2, 10, 2));
//         return title;
//     }
// 
//     private Text createInfoText() {
//         return TextBuilder.create().layoutY(100).textOrigin(VPos.TOP).textAlignment(TextAlignment.JUSTIFY).wrappingWidth(400).text(this.message).fill(Color.WHITE).build();
//     }
// 
//     private Hyperlink createProjectLink() {
//         final Hyperlink link = new Hyperlink();
//         link.setText(this.projectURL);
//         link.setStyle("-fx-text-fill: white;");
//         link.setOnAction(new EventHandler<ActionEvent>() {
//             @Override
//             public void handle(final ActionEvent event) {
//                 final WebView wv = new WebView();
//                 wv.getEngine().load(ContactWorkbench.this.projectURL);
//                 final Scene scene = new Scene(wv, 1024, 768);
//                 final Stage stage = new Stage();
//                 stage.setTitle("JacpFX documentation");
//                 stage.setScene(scene);
//                 stage.show();
// 
//             }
//         });
//         return link;
//     }
// 
// 
// }


// Path: JacpFXDemo/src/main/java/org/jacp/demo/main/ContactMain.java
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import org.jacp.demo.workbench.ContactWorkbench;
import org.jacpfx.rcp.workbench.FXWorkbench;
import org.jacpfx.spring.launcher.AFXSpringXmlLauncher;

/*
 * Copyright (C) 2010,2011.
 * AHCP Project (http://code.google.com/p/jacp)
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at 
 *
 *     http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
 * express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package org.jacp.demo.main;



/**
 * JacpFX application launcher and main method for contact jacpfx. This is the
 * entry class to start initial context of an JacpFX application. Here you
 * define the location of the spring-xml and can handle settings like css
 * configuration.
 * 
 * @author Andy Moncsek
 * 
 */
public class ContactMain extends AFXSpringXmlLauncher {

    private Scene scene;

    public ContactMain() {
    }

    @Override
    public String getXmlConfig() {
        return "main.xml";
    }

    /**
     * @param args  aa  ddd
     */
    public static void main(final String[] args) {
        Application.launch(args);
    }


    @Override
    protected Class<? extends FXWorkbench> getWorkbenchClass() {