Example #1
0
  /**
   * Saves all data by creating and performing a command. If not, that means we are done and we
   * should give the compound command to the design window.
   *
   * <p>Subclasses that implement {@link #doSave} should probably create a command, call its <code>
   * perform</code> method, and add it to the <var>commands</var> compound command.
   *
   * @param closing passed through to <code>doSave</code>
   */
  protected void save(boolean closing) {
    doSave();
    revertButton.setEnabled(true);

    if (closing && commands.numCommands() > 0) designer.addCommand(commands);
  }
Example #2
0
 /**
  * Reverts all state information by undoing any commands previously performed and emptying the
  * compound command.
  *
  * @see #doRevert
  */
 protected void revert() {
   commands.undo();
   commands = new CompoundCommand(commands.getName());
   doRevert();
 }