01: package org.drools.eclipse.debug.actions;
02:
03: import org.drools.eclipse.DroolsEclipsePlugin;
04: import org.drools.eclipse.debug.AuditView;
05: import org.drools.eclipse.debug.AuditView.Event;
06: import org.eclipse.jface.action.Action;
07: import org.eclipse.jface.action.IAction;
08:
09: /**
10: * Action to show the cause event of an audit event.
11: *
12: * @author <a href="mailto:kris_verlaenen@hotmail.com">kris verlaenen </a>
13: */
14: public class ShowEventCauseAction extends Action {
15:
16: private AuditView view;
17:
18: public ShowEventCauseAction(AuditView view) {
19: super (null, IAction.AS_PUSH_BUTTON);
20: this .view = view;
21: setToolTipText("Show Cause");
22: setText("Show Cause");
23: setId(DroolsEclipsePlugin.getUniqueIdentifier()
24: + ".ShowEventCause");
25: }
26:
27: public void run() {
28: Event event = view.getSelectedEvent();
29: if (event != null) {
30: Event cause = event.getCauseEvent();
31: if (cause != null) {
32: view.showEvent(cause);
33: }
34: }
35: }
36: }
|