App
AppCommand.java
Go to the documentation of this file.
1 package mhr.appcore.commands;
2 
3 import mhr.appcore.AppCore;
4 import mhr.appcore.interfaces.PDFeedback;
8 public abstract class AppCommand {
9  protected PDFeedback feedback = null;
10  protected PDFeedback exceptionFeedback = null;
11 
12  public RuntimeException e = null;
13 
18  public void setPDFeedback(PDFeedback f) {
19  this.feedback = f;
20  }
21 
27  this.exceptionFeedback = ef;
28  }
29 
34  public void execute(AppCore target) {
35  try {
36  action(target);
37  } catch (RuntimeException e) {
38  if (exceptionFeedback != null) {
39  this.e = e;
41  return;
42  } else {
43  throw e;
44  }
45  }
46  if (feedback != null) {
48  }
49  }
50 
55  protected abstract void action(AppCore target);
56 
62  public void dispose() {
63 
64  }
65 }