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.

CommandAdd.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 commands;
  7. import java.io.File;
  8. import java.util.prefs.Preferences;
  9. import model.model;
  10. import view.gui;
  11. /**
  12. * Add Command
  13. * @author matthias
  14. */
  15. public class CommandAdd implements CommandInterface {
  16. private File data;
  17. private gui g;
  18. private model mdl;
  19. private Preferences prfs;
  20. private String pid;
  21. public CommandAdd(gui G, Preferences p, model mdl, String pid)
  22. {
  23. this.g = G;
  24. this.mdl = mdl;
  25. this.prfs = p;
  26. this.pid = pid;
  27. this.data = null;
  28. }
  29. /**
  30. * overrides execute vom CommandInterface
  31. * hier wird eintragHinzufügen vom Model aufgerufen
  32. */
  33. @Override
  34. public void execute() {
  35. try
  36. {
  37. this.mdl.eintragHinzufuegen();
  38. }
  39. catch(Exception ex)
  40. {
  41. System.err.println(ex);
  42. }
  43. //System.out.println(this.pref.get(PATH_ID, "xyz"));
  44. }
  45. @Override
  46. public void undo() {
  47. }
  48. }