You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommandEintragHinzufuegen.java 967B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package command.commands;
  7. import command.CommandInterface;
  8. import model.AdressVerwaltungModel;
  9. import view.MainWindow;
  10. /**
  11. *
  12. * @author PC
  13. */
  14. public class CommandEintragHinzufuegen implements CommandInterface{
  15. private MainWindow view;
  16. private AdressVerwaltungModel model;
  17. public CommandEintragHinzufuegen(MainWindow view, AdressVerwaltungModel model)
  18. {
  19. this.view = view;
  20. this.model = model;
  21. }
  22. @Override
  23. public void execute() {
  24. this.model.eintragHinzufuegen();
  25. }
  26. @Override
  27. public void undo() {
  28. this.model.eintragLoeschen(this.model.getRowCount()-1);
  29. }
  30. @Override
  31. public boolean isUndoable() {
  32. return true;
  33. }
  34. }