01: package org.drools.eclipse.debug.actions;
02:
03: import org.drools.eclipse.DroolsEclipsePlugin;
04: import org.drools.eclipse.DroolsPluginImages;
05: import org.drools.eclipse.debug.AuditView;
06: import org.eclipse.jface.action.Action;
07: import org.eclipse.jface.action.IAction;
08: import org.eclipse.swt.custom.BusyIndicator;
09:
10: /**
11: * Action to refresh the log.
12: *
13: * @author <a href="mailto:kris_verlaenen@hotmail.com">kris verlaenen </a>
14: */
15: public class RefreshLogAction extends Action {
16:
17: private AuditView view;
18:
19: public RefreshLogAction(AuditView view) {
20: super (null, IAction.AS_PUSH_BUTTON);
21: this .view = view;
22: setToolTipText("Refresh Log");
23: setImageDescriptor(DroolsPluginImages
24: .getImageDescriptor(DroolsPluginImages.REFRESH_LOG));
25: setDisabledImageDescriptor(DroolsPluginImages
26: .getImageDescriptor(DroolsPluginImages.REFRESH_LOG_DISABLED));
27: setId(DroolsEclipsePlugin.getUniqueIdentifier()
28: + ".RefreshLogAction");
29: }
30:
31: public void run() {
32: if (!view.isAvailable()) {
33: return;
34: }
35: view.refresh();
36: BusyIndicator.showWhile(view.getViewer().getControl()
37: .getDisplay(), new Runnable() {
38: public void run() {
39: view.getViewer().refresh();
40: }
41: });
42: }
43: }
|