Search in sources :

Example 1 with ShellCommand

use of fvarrui.sysadmin.challenger.command.ShellCommand in project Challenger4SysAdmins by fvarrui.

the class RootController method onSeleccionadoChanged.

/**
 * Listener para ser notificado de cambios y bindear el modelo.
 * @param o valor observable
 * @param ov viejo goal
 * @param nv goal nuevo
 * @throws IOException si no puede cargar la vista
 */
private void onSeleccionadoChanged(ObservableValue<? extends Object> o, Object ov, Object nv) {
    centerPane.setCenter(emptyView);
    // desbindea del panel el elemento anterior
    if (ov instanceof Challenge) {
        challengeController.challengeProperty().unbind();
    } else if (ov instanceof Goal) {
        goalController.goalProperty().unbind();
    } else if (ov instanceof Test) {
        testController.testProperty().unbind();
    } else if (ov instanceof ShellCommand) {
        comandController.shellCommandProperty().unbind();
    }
    // bindea el elemento al panel adecuado y lo muestra
    if (nv instanceof Challenge) {
        Challenge challenge = (Challenge) nv;
        challengeController.challengeProperty().bind(new SimpleObjectProperty<>(challenge));
        centerPane.setCenter(challengeController.getView());
    } else if (nv instanceof Goal) {
        Goal goal = (Goal) nv;
        goalController.goalProperty().bind(new SimpleObjectProperty<Goal>(goal));
        centerPane.setCenter(goalController.getView());
    } else if (nv instanceof Test) {
        Test test = (Test) nv;
        testController.testProperty().bind(new SimpleObjectProperty<>(test));
        centerPane.setCenter(testController.getView());
    } else if (nv instanceof ShellCommand) {
        ShellCommand comand = (ShellCommand) nv;
        comandController.shellCommandProperty().bind(new SimpleObjectProperty<>(comand));
        centerPane.setCenter(comandController.getView());
    }
}
Also used : SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) Goal(fvarrui.sysadmin.challenger.Goal) Test(fvarrui.sysadmin.challenger.test.Test) ShellCommand(fvarrui.sysadmin.challenger.command.ShellCommand) Challenge(fvarrui.sysadmin.challenger.Challenge)

Example 2 with ShellCommand

use of fvarrui.sysadmin.challenger.command.ShellCommand in project Challenger4SysAdmins by fvarrui.

the class TreeEditorController method addCommand.

private void addCommand(CommandTest parent) {
    Command command = new ShellCommand();
    parent.setCommand(command);
    System.out.println("comando " + command.getCommand() + " a�adido al test de comando " + parent.getName());
}
Also used : ShellCommand(fvarrui.sysadmin.challenger.command.ShellCommand) Command(fvarrui.sysadmin.challenger.command.Command) ShellCommand(fvarrui.sysadmin.challenger.command.ShellCommand)

Aggregations

ShellCommand (fvarrui.sysadmin.challenger.command.ShellCommand)2 Challenge (fvarrui.sysadmin.challenger.Challenge)1 Goal (fvarrui.sysadmin.challenger.Goal)1 Command (fvarrui.sysadmin.challenger.command.Command)1 Test (fvarrui.sysadmin.challenger.test.Test)1 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)1