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());
}
}
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());
}
Aggregations