Search in sources :

Example 1 with ChangeExtractProperty

use of controller.command.ChangeExtractProperty in project uPMT by coco35700.

the class SelectDescriptemePartController method validateSelection.

@FXML
public void validateSelection() {
    String newExtract = "";
    if (this.descriptemeArea.getSelectedText().trim().length() != 0)
        newExtract = this.descriptemeArea.getSelectedText().trim();
    else
        newExtract = null;
    if (propertyExtractController != null) {
        // System.out.println("Description: "+main.getCurrentMoment().getCurrentProperty().getDescripteme().getTexte());
        // System.out.println("Valeur: "+main.getCurrentMoment().getCurrentProperty().getValeur());
        ChangeExtractProperty cmd = new ChangeExtractProperty(propertyExtractController, propertyExtractController.getProperty().getExtract().getTexte(), newExtract, main);
        main.getCurrentMoment().getCurrentProperty().setExtract(newExtract);
        cmd.execute();
        UndoCollector.INSTANCE.add(cmd);
    } else {
        // System.out.println("Moment: "+main.getCurrentMoment().getMoment().getNom());
        RenameMomentCommand cmd = new RenameMomentCommand(main.getCurrentMoment().getMomentExtractController(), main.getCurrentMoment().getMoment().getDescripteme(), newExtract, main);
        cmd.execute();
        UndoCollector.INSTANCE.add(cmd);
    }
    main.needToSave();
    stage.close();
}
Also used : RenameMomentCommand(controller.command.RenameMomentCommand) ChangeExtractProperty(controller.command.ChangeExtractProperty) FXML(javafx.fxml.FXML)

Aggregations

ChangeExtractProperty (controller.command.ChangeExtractProperty)1 RenameMomentCommand (controller.command.RenameMomentCommand)1 FXML (javafx.fxml.FXML)1