Example usage for javafx.scene.input KeyCombination CONTROL_DOWN

List of usage examples for javafx.scene.input KeyCombination CONTROL_DOWN

Introduction

In this page you can find the example usage for javafx.scene.input KeyCombination CONTROL_DOWN.

Prototype

Modifier CONTROL_DOWN

To view the source code for javafx.scene.input KeyCombination CONTROL_DOWN.

Click Source Link

Document

Modifier which specifies that the control key must be down.

Usage

From source file:Main.java

@Override
public void start(final Stage primaryStage) {
    primaryStage.setTitle("title");
    Group root = new Group();
    Scene scene = new Scene(root, 400, 300, Color.WHITE);

    MenuBar menuBar = new MenuBar();
    menuBar.prefWidthProperty().bind(primaryStage.widthProperty());

    Menu menu = new Menu("File");

    MenuItem exitItem = new MenuItem("Exit", null);
    exitItem.setMnemonicParsing(true);/*from   ww w .  j a  v  a  2  s. c o m*/
    exitItem.setAccelerator(new KeyCodeCombination(KeyCode.X, KeyCombination.CONTROL_DOWN));
    exitItem.setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent event) {
            Platform.exit();
        }
    });
    menu.getItems().add(exitItem);

    menuBar.getMenus().add(menu);
    root.getChildren().add(menuBar);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Keyboard");
    Group root = new Group();
    Scene scene = new Scene(root, 530, 300, Color.WHITE);

    MenuBar menuBar = new MenuBar();
    menuBar.prefWidthProperty().bind(primaryStage.widthProperty());
    root.getChildren().add(menuBar);/*from  w  ww . ja  va2  s  .  c om*/

    Menu menu = new Menu("File");
    menuBar.getMenus().add(menu);

    MenuItem newItem = MenuItemBuilder.create().text("New")
            .accelerator(new KeyCodeCombination(KeyCode.N, KeyCombination.CONTROL_DOWN))
            .onAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                    System.out.println("Ctrl-N");
                }
            }).build();
    menu.getItems().add(newItem);

    MenuItem saveItem = MenuItemBuilder.create().text("Save")
            .accelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN))
            .onAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                    System.out.println("Ctrl-S");
                }
            }).build();
    menu.getItems().add(saveItem);

    menu.getItems().add(new SeparatorMenuItem());

    MenuItem exitItem = MenuItemBuilder.create().text("Exit")
            .accelerator(new KeyCodeCombination(KeyCode.X, KeyCombination.CONTROL_DOWN))
            .onAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                    System.out.println("Ctrl-X");
                }
            }).build();
    menu.getItems().add(exitItem);

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Menus");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250, Color.WHITE);

    MenuBar menuBar = new MenuBar();

    Menu menu = new Menu("File");
    final MenuItem aboutMenuItem = MenuItemBuilder.create().text("About")
            .onAction(new EventHandler<ActionEvent>() {
                @Override/*from w  ww  .j  a  va2  s.c o m*/
                public void handle(ActionEvent e) {
                    System.out.println("You clicked on About!");
                }
            }).accelerator(new KeyCodeCombination(KeyCode.A, KeyCombination.CONTROL_DOWN)).build();
    menu.getItems().add(aboutMenuItem);

    menuBar.getMenus().add(menu);

    menuBar.prefWidthProperty().bind(primaryStage.widthProperty());

    root.getChildren().add(menuBar);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:jviewmda.JViewMda.java

@Override
public void start(Stage primaryStage) {
    m_stage = primaryStage;//from   w  ww  .j ava  2  s .  com

    String array_path = "";
    Parameters params = getParameters();
    List<String> unnamed_params = params.getUnnamed();
    if (unnamed_params.size() > 0) {
        array_path = unnamed_params.get(0);
    }
    // FOR DEBUGING PURPOSES
    if (array_path.length() == 0) {
        //String debug_path = "/home/magland/wisdm/www/wisdmfileserver/files/fetalmri/sessions/SESSION1/crops/FNP001A-coronal.crop.mda";
        String debug_path = "/home/magland/data/LesionProbe/Images/ID001_FLAIR.nii";
        if ((new File(debug_path)).exists()) {
            array_path = debug_path;
        }
    }

    Menu menu;
    MenuItem item;

    MenuBar menubar = new MenuBar();

    //file menu
    menu = new Menu("File");
    menubar.getMenus().add(menu);
    item = new MenuItem("Open...");
    item.setAccelerator(new KeyCodeCombination(KeyCode.O, KeyCombination.CONTROL_DOWN));
    item.setOnAction(e -> on_file_open());
    menu.getItems().add(item);
    item = new MenuItem("Save As...");
    item.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN));
    item.setOnAction(e -> on_file_saveas());
    menu.getItems().add(item);
    menu.getItems().add(new SeparatorMenuItem()); /////////////////////////////////////////////
    item = new MenuItem("Exit");
    item.setAccelerator(new KeyCodeCombination(KeyCode.X, KeyCombination.CONTROL_DOWN));
    item.setOnAction(e -> on_file_exit());
    menu.getItems().add(item);

    //view menu
    menu = new Menu("View");
    menubar.getMenus().add(menu);
    item = new MenuItem("Zoom In");
    item.setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCombination.CONTROL_DOWN));
    item.setOnAction(e -> on_zoom_in());
    menu.getItems().add(item);
    item = new MenuItem("Zoom Out");
    item.setAccelerator(
            new KeyCodeCombination(KeyCode.Z, KeyCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN));
    item.setOnAction(e -> on_zoom_out());
    menu.getItems().add(item);
    menu.getItems().add(new SeparatorMenuItem()); /////////////////////////////////////////////
    {
        CheckMenuItem item0 = new CheckMenuItem("Top Controls");
        item0.setSelected(true);
        item0.setOnAction(e -> {
            m_widget.setTopControlsVisible(item0.isSelected());
        });
        menu.getItems().add(item0);
    }
    {
        CheckMenuItem item0 = new CheckMenuItem("Bottom Controls");
        item0.setSelected(true);
        item0.setOnAction(e -> {
            m_widget.setBottomControlsVisible(item0.isSelected());
        });
        menu.getItems().add(item0);
    }
    {
        CheckMenuItem item0 = new CheckMenuItem("Brightness/Contrast");
        item0.setSelected(true);
        item0.setOnAction(e -> {
            m_widget.setBrightnessContrastVisible(item0.isSelected());
        });
        menu.getItems().add(item0);
    }
    {
        CheckMenuItem item0 = new CheckMenuItem("Slice Slider");
        item0.setSelected(true);
        item0.setOnAction(e -> {
            m_widget.setSliceSliderVisible(item0.isSelected());
        });
        menu.getItems().add(item0);
    }

    //selection menu
    menu = new Menu("Selection");
    menubar.getMenus().add(menu);
    Map<String, CheckMenuItem> mode_items = new HashMap<>();
    m_selection_mode_items = mode_items;
    mode_items.put("rectangle", new CheckMenuItem("Rectangle"));
    mode_items.put("ellipse", new CheckMenuItem("Ellipse"));
    Set<String> keys = mode_items.keySet();
    for (String key : keys) {
        CheckMenuItem item0 = mode_items.get(key);
        menu.getItems().add(item0);
        item0.setOnAction(evt -> {
            on_selection_mode_changed(key);
        });

    }
    mode_items.get("rectangle").setSelected(true);

    VBox root = new VBox();
    root.getChildren().addAll(menubar, m_widget);

    Scene scene = new Scene(root, 500, 450);

    primaryStage.setTitle("JViewMda");
    primaryStage.setScene(scene);
    primaryStage.show();

    if (array_path.length() > 0) {
        open_file(array_path);
    }

    m_prefs = Preferences.userNodeForPackage(this.getClass());

}

From source file:bzh.terrevirtuelle.navisu.instruments.gps.plotter.impl.controller.GpsPlotterController.java

protected void addPanelController() {
    Platform.runLater(() -> {//from ww w  . ja  va2s .c o m
        targetPanel = new TargetPanel(guiAgentServices, KeyCode.B, KeyCombination.CONTROL_DOWN);
        guiAgentServices.getScene().addEventFilter(KeyEvent.KEY_RELEASED, targetPanel);
        guiAgentServices.getRoot().getChildren().add(targetPanel);
        targetPanel.setScale(1.0);
        targetPanel.setVisible(false);
    });
}

From source file:io.bitsquare.app.BitsquareApp.java

@Override
public void start(Stage stage) throws IOException {
    BitsquareApp.primaryStage = stage;//ww w.j  a  va  2  s . c o  m

    String logPath = Paths.get(env.getProperty(AppOptionKeys.APP_DATA_DIR_KEY), "bitsquare").toString();
    Log.setup(logPath);
    log.info("Log files under: " + logPath);
    Version.printVersion();
    Utilities.printSysInfo();
    Log.setLevel(Level.toLevel(env.getRequiredProperty(CommonOptionKeys.LOG_LEVEL_KEY)));

    UserThread.setExecutor(Platform::runLater);
    UserThread.setTimerClass(UITimer.class);

    shutDownHandler = this::stop;

    // setup UncaughtExceptionHandler
    Thread.UncaughtExceptionHandler handler = (thread, throwable) -> {
        // Might come from another thread 
        if (throwable.getCause() != null && throwable.getCause().getCause() != null
                && throwable.getCause().getCause() instanceof BlockStoreException) {
            log.error(throwable.getMessage());
        } else if (throwable instanceof ClassCastException
                && "sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData"
                        .equals(throwable.getMessage())) {
            log.warn(throwable.getMessage());
        } else {
            log.error("Uncaught Exception from thread " + Thread.currentThread().getName());
            log.error("throwableMessage= " + throwable.getMessage());
            log.error("throwableClass= " + throwable.getClass());
            log.error("Stack trace:\n" + ExceptionUtils.getStackTrace(throwable));
            throwable.printStackTrace();
            UserThread.execute(() -> showErrorPopup(throwable, false));
        }
    };
    Thread.setDefaultUncaughtExceptionHandler(handler);
    Thread.currentThread().setUncaughtExceptionHandler(handler);

    try {
        Utilities.checkCryptoPolicySetup();
    } catch (NoSuchAlgorithmException | LimitedKeyStrengthException e) {
        e.printStackTrace();
        UserThread.execute(() -> showErrorPopup(e, true));
    }

    Security.addProvider(new BouncyCastleProvider());

    try {
        // Guice
        bitsquareAppModule = new BitsquareAppModule(env, primaryStage);
        injector = Guice.createInjector(bitsquareAppModule);
        injector.getInstance(InjectorViewFactory.class).setInjector(injector);

        Version.setBtcNetworkId(injector.getInstance(BitsquareEnvironment.class).getBitcoinNetwork().ordinal());

        if (Utilities.isLinux())
            System.setProperty("prism.lcdtext", "false");

        Storage.setDatabaseCorruptionHandler((String fileName) -> {
            corruptedDatabaseFiles.add(fileName);
            if (mainView != null)
                mainView.setPersistedFilesCorrupted(corruptedDatabaseFiles);
        });

        // load the main view and create the main scene
        CachingViewLoader viewLoader = injector.getInstance(CachingViewLoader.class);
        mainView = (MainView) viewLoader.load(MainView.class);
        mainView.setPersistedFilesCorrupted(corruptedDatabaseFiles);

        /* Storage.setDatabaseCorruptionHandler((String fileName) -> {
        corruptedDatabaseFiles.add(fileName);
        if (mainView != null)
            mainView.setPersistedFilesCorrupted(corruptedDatabaseFiles);
         });*/

        scene = new Scene(mainView.getRoot(), 1200, 700); //740

        Font.loadFont(getClass().getResource("/fonts/Verdana.ttf").toExternalForm(), 13);
        Font.loadFont(getClass().getResource("/fonts/VerdanaBold.ttf").toExternalForm(), 13);
        Font.loadFont(getClass().getResource("/fonts/VerdanaItalic.ttf").toExternalForm(), 13);
        Font.loadFont(getClass().getResource("/fonts/VerdanaBoldItalic.ttf").toExternalForm(), 13);
        scene.getStylesheets().setAll("/io/bitsquare/gui/bitsquare.css", "/io/bitsquare/gui/images.css",
                "/io/bitsquare/gui/CandleStickChart.css");

        // configure the system tray
        SystemTray.create(primaryStage, shutDownHandler);

        primaryStage.setOnCloseRequest(event -> {
            event.consume();
            stop();
        });
        scene.addEventHandler(KeyEvent.KEY_RELEASED, keyEvent -> {
            if (new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN).match(keyEvent)
                    || new KeyCodeCombination(KeyCode.W, KeyCombination.CONTROL_DOWN).match(keyEvent)) {
                stop();
            } else if (new KeyCodeCombination(KeyCode.Q, KeyCombination.SHORTCUT_DOWN).match(keyEvent)
                    || new KeyCodeCombination(KeyCode.Q, KeyCombination.CONTROL_DOWN).match(keyEvent)) {
                stop();
            } else if (new KeyCodeCombination(KeyCode.E, KeyCombination.SHORTCUT_DOWN).match(keyEvent)
                    || new KeyCodeCombination(KeyCode.E, KeyCombination.CONTROL_DOWN).match(keyEvent)) {
                showEmptyWalletPopup();
            } else if (new KeyCodeCombination(KeyCode.M, KeyCombination.ALT_DOWN).match(keyEvent)) {
                showSendAlertMessagePopup();
            } else if (new KeyCodeCombination(KeyCode.F, KeyCombination.ALT_DOWN).match(keyEvent)) {
                showFilterPopup();
            } else if (new KeyCodeCombination(KeyCode.F, KeyCombination.ALT_DOWN).match(keyEvent)) {
                showFPSWindow();
            } else if (new KeyCodeCombination(KeyCode.J, KeyCombination.ALT_DOWN).match(keyEvent)) {
                WalletService walletService = injector.getInstance(WalletService.class);
                if (walletService.getWallet() != null)
                    new ShowWalletDataWindow(walletService).information("Wallet raw data").show();
                else
                    new Popup<>().warning("The wallet is not initialized yet").show();
            } else if (new KeyCodeCombination(KeyCode.G, KeyCombination.ALT_DOWN).match(keyEvent)) {
                TradeWalletService tradeWalletService = injector.getInstance(TradeWalletService.class);
                WalletService walletService = injector.getInstance(WalletService.class);
                if (walletService.getWallet() != null)
                    new SpendFromDepositTxWindow(tradeWalletService).information("Emergency wallet tool")
                            .show();
                else
                    new Popup<>().warning("The wallet is not initialized yet").show();
            } else if (DevFlags.DEV_MODE
                    && new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) {
                showDebugWindow();
            }
        });

        // configure the primary stage
        primaryStage.setTitle(env.getRequiredProperty(APP_NAME_KEY));
        primaryStage.setScene(scene);
        primaryStage.setMinWidth(1000); // 1190
        primaryStage.setMinHeight(620);

        // on windows the title icon is also used as task bar icon in a larger size
        // on Linux no title icon is supported but also a large task bar icon is derived from that title icon
        String iconPath;
        if (Utilities.isOSX())
            iconPath = ImageUtil.isRetina() ? "/images/window_icon@2x.png" : "/images/window_icon.png";
        else if (Utilities.isWindows())
            iconPath = "/images/task_bar_icon_windows.png";
        else
            iconPath = "/images/task_bar_icon_linux.png";

        primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(iconPath)));

        // make the UI visible
        primaryStage.show();

        if (!Utilities.isCorrectOSArchitecture()) {
            String osArchitecture = Utilities.getOSArchitecture();
            // We don't force a shutdown as the osArchitecture might in strange cases return a wrong value.
            // Needs at least more testing on different machines...
            new Popup<>()
                    .warning("You probably have the wrong Bitsquare version for this computer.\n"
                            + "Your computer's architecture is: " + osArchitecture + ".\n"
                            + "The Bitsquare binary you installed is: " + Utilities.getJVMArchitecture() + ".\n"
                            + "Please shut down and re-install the correct version (" + osArchitecture + ").")
                    .show();
        }

        UserThread.runPeriodically(() -> Profiler.printSystemLoad(log), LOG_MEMORY_PERIOD_MIN,
                TimeUnit.MINUTES);

    } catch (Throwable throwable)

    {
        showErrorPopup(throwable, false);
    }

}

From source file:de.pixida.logtest.designer.MainWindow.java

private void createAndAppendFileMenuItems(final Menu menu) {
    final Menu newDocument = new Menu("New");
    final Menu open = new Menu("Open");
    for (final Type type : Editor.Type.values()) {
        final MenuItem newFile = new MenuItem(type.getName());
        newFile.setOnAction(event -> this.handleCreateNewDocument(type));
        newDocument.getItems().add(newFile);

        if (type.supportsFilesProperty().get()) {
            final MenuItem openFile = new MenuItem(type.getName());
            openFile.setOnAction(event -> {
                final FileChooser fileChooser = this.createFileDialog(type, "Open");
                final File selectedFile = fileChooser.showOpenDialog(this.primaryStage);
                if (selectedFile != null) {
                    this.applyFolderOfSelectedFileInOpenOrSaveAsFileDialog(selectedFile);
                    this.handleLoadDocument(type, selectedFile);
                }/*from   w  w w. j av  a 2 s  .co  m*/
            });
            open.getItems().add(openFile);
        }
    }

    this.menuItemSave = new MenuItem("Save");
    this.menuItemSave.setGraphic(Icons.getIconGraphics("disk"));
    this.menuItemSave.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN));
    this.menuItemSave.setOnAction(event -> this.handleSaveDocument());

    this.menuItemSaveAs = new MenuItem("Save as");
    this.menuItemSaveAs.setOnAction(event -> this.handleSaveDocumentAs());

    final MenuItem exit = new MenuItem("Exit");
    exit.setOnAction(event -> this.handleExitApplication());

    menu.getItems().addAll(newDocument, open, this.menuItemSave, this.menuItemSaveAs, new SeparatorMenuItem(),
            exit);
}

From source file:be.makercafe.apps.makerbench.Main.java

/**
 * Creates the menubar/*  w ww .  j  a va2  s  . c  o m*/
 *
 * @return
 */
private MenuBar createMenuBar() {
    MenuBar bar = new MenuBar();
    Menu projectMenu = new Menu("Project");
    MenuItem openProject = new MenuItem("Open...");
    openProject.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            directoryChooser.setTitle("Please choose a project folder");
            File file = directoryChooser.showDialog(stage);

            viewer.setRoot(setRootFolder(file));

        }
    });
    Menu newProject = new Menu("New");

    MenuItem newFolder = new MenuItem("Folder...");
    newFolder.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            TextInputDialog dialog = new TextInputDialog("my_project_folder");
            dialog.setTitle("New folder");
            dialog.setHeaderText("Create a new folder");
            dialog.setContentText("Folder name:");
            Optional<String> result = dialog.showAndWait();
            if (result.isPresent()) {
                String homeDir = System.getProperty("user.home");

                System.out.println("Folder name: " + result.get());
                System.out.println("User home: " + homeDir);
            }
        }
    });
    newProject.getItems().add(newFolder);

    MenuItem importProject = new MenuItem("Import");
    importProject.setAccelerator(new KeyCodeCombination(KeyCode.I, KeyCombination.CONTROL_DOWN));
    importProject.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            System.out.println("Import");

        }
    });
    MenuItem deleteProject = new MenuItem("Delete");
    deleteProject.setAccelerator(new KeyCodeCombination(KeyCode.D, KeyCombination.CONTROL_DOWN));
    deleteProject.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            System.out.println("Delete");

        }
    });
    projectMenu.getItems().addAll(openProject, newProject, importProject, deleteProject);

    Menu helpMenu = new Menu("Help");

    MenuItem aboutItem = new MenuItem("About");
    aboutItem.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            Alert alert = new Alert(AlertType.INFORMATION);
            alert.setTitle("Information Dialog");
            alert.setHeaderText("About makerbench");
            alert.setContentText(
                    "Makerbench is an open source IDE for designing and manufacturing objects and code.\nWritten by Luc De pauw\n\nUses opensource libraries from the next projects:\n-RichtextFX by Tomas Mikula\n-JCSG by Michael Hoffer\n-ControlsFX by FXexperience.com");
            alert.showAndWait();
        }
    });

    helpMenu.getItems().add(aboutItem);
    bar.getMenus().addAll(projectMenu, helpMenu);
    return bar;
}

From source file:org.beryx.viewreka.fxapp.codearea.ViewrekaCodeArea.java

public ViewrekaCodeArea() {
    applyConfiguration(CONFIG);/*from ww w .  j a  va 2s .c o  m*/

    ContextMenu cm = new ContextMenu();
    setPopupWindow(cm);
    setPopupAlignment(PopupAlignment.CARET_BOTTOM);
    setPopupAnchorOffset(new Point2D(-20, 1));
    cm.setOnShown(ev -> codeTemplatesCoordinates = new double[] { cm.getX(), cm.getY() });

    EventHandler<? super KeyEvent> tabHandler = EventHandlerHelper
            .on(EventPattern.keyPressed(KeyCode.SPACE, KeyCombination.CONTROL_DOWN))
            .act(ev -> showContextMenu(cm)).create();
    EventHandlerHelper.install(onKeyPressedProperty(), tabHandler);
}

From source file:org.craftercms.social.migration.controllers.MainController.java

@Override
public void initialize(final URL location, final ResourceBundle resources) {
    configTable();/*from   w ww . ja va 2 s .c o m*/
    mnuQuit.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent actionEvent) {
            stopTasks();
            Platform.exit();
        }
    });
    ctxClearLog.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent actionEvent) {
            logTable.getItems().clear();
        }
    });
    ctxClearProfileSelection.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent actionEvent) {
            lstProfileScripts.getSelectionModel().clearSelection();
        }
    });
    ctxClearSocialSelection.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent actionEvent) {
            lstSocialScripts.getSelectionModel().clearSelection();
        }
    });

    lstProfileScripts.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    lstSocialScripts.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    lstProfileScripts.setCellFactory(new Callback<ListView, ListCell>() {
        @Override
        public ListCell call(final ListView listView) {
            return new FileListCell();
        }
    });
    lstSocialScripts.setCellFactory(new Callback<ListView, ListCell>() {
        @Override
        public ListCell call(final ListView listView) {
            return new FileListCell();
        }
    });
    ctxReloadProfileScrp.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent actionEvent) {
            lstProfileScripts.getItems().clear();
            try {
                extractBuildInScripts("profile", lstProfileScripts);
            } catch (MigrationException e) {
                log.error("Unable to extract BuildIn scripts");
            }
            loadScripts(MigrationTool.systemProperties.getString("crafter.migration.profile.scripts"),
                    lstProfileScripts);
        }
    });
    ctxReloadSocialScrp.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent actionEvent) {
            lstSocialScripts.getItems().clear();
            try {
                extractBuildInScripts("profile", lstSocialScripts);
            } catch (MigrationException e) {
                log.error("Unable to extract BuildIn scripts");
            }
            loadScripts(MigrationTool.systemProperties.getString("crafter.migration.social.scripts"),
                    lstSocialScripts);
        }
    });
    final MigrationSelectionAction selectionEventHandler = new MigrationSelectionAction();
    rbtMigrateProfile.setOnAction(selectionEventHandler);
    rbtMigrateSocial.setOnAction(selectionEventHandler);
    loadScripts();
    loadDefaultValues();
    saveLog.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN));
    saveLog.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent event) {
            FileChooser fileChooser = new FileChooser();
            fileChooser.setTitle("Save Migration Log");
            fileChooser.setInitialFileName("Crafter-Migration-"
                    + new SimpleDateFormat("yyyy-MM-dd@HH_mm").format(new Date()) + ".html");
            final File savedFile = fileChooser.showSaveDialog(scene.getWindow());
            if (savedFile == null) {
                return;
            }
            try {
                getHtml(new FileWriter(savedFile));
                log.info("Saved Html log file");
            } catch (IOException | TransformerException ex) {
                log.error("Unable to save file", ex);
            }
        }
    });
    mnuStart.setAccelerator(new KeyCodeCombination(KeyCode.F5));
    mnuStart.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(final ActionEvent event) {

            if (currentTask == null || !currentTask.isRunning()) {
                ObservableList scriptsToRun;
                if (rbtMigrateProfile.isSelected()) {
                    scriptsToRun = lstProfileScripts.getSelectionModel().getSelectedItems();
                } else {
                    scriptsToRun = lstSocialScripts.getSelectionModel().getSelectedItems();
                }
                currentTask = new MigrationPipeService(logTable, pgbTaskProgress, srcHost.getText(),
                        srcPort.getText(), srcDb.getText(), dstHost.getText(), dstPort.getText(),
                        dstDb.getText(), scriptsToRun);
            }
            if (!currentTask.isRunning()) {
                final Thread t = new Thread(currentTask, "Migration Task");
                t.start();
            }
        }
    });
}