示例#1
0
  /**
   * Deletes a decision from SEURAT and the database. This only works if there aren't any associated
   * alternatives, questions, or subdecisions.
   */
  public boolean delete() {
    // need to have a way to inform if delete did not happen
    // can't delete if there are dependencies...
    if ((this.alternatives.size() > 0)
        || (this.questions.size() > 0)
        || (this.subDecisions.size() > 0)) {
      MessageDialog.openError(
          new Shell(), "Delete Error", "Can't delete when there are sub-elements.");
      return true;
    }
    m_eventGenerator.Destroyed();

    RationaleDB db = RationaleDB.getHandle();

    db.deleteRationaleElement(this);
    return false;
  }