Ejemplo n.º 1
0
  /*
   * (non-Javadoc)
   *
   * @see henshineditor.actions.condition.CreateConditionTreeAction#run()
   */
  @Override
  public void run() {
    Not not = HenshinFactory.eINSTANCE.createNot();
    Command command = null;
    if (parentFormula == null) {
      command = new CreateConditionCommand(premise, not);
    } else {
      command = new CreateFormulaCommand(premise, parentFormula, not);

      if (parentFormula instanceof BinaryFormula) {
        BinaryFormula binaryFormula = (BinaryFormula) parentFormula;
        if (binaryFormula.getLeft() != null && binaryFormula.getRight() == null) {
          command = new CreateFormulaCommand(premise, parentFormula, not, false);
        }
      }
    }

    execute(command);
  }