01: /**
02: *
03: */package newprocess.diagram.cust.annotations.actions;
04:
05: import newprocess.diagram.cust.annotations.utils.OpenAnnotationUtil;
06:
07: import org.eclipse.jface.action.Action;
08: import org.eclipse.jface.resource.ImageDescriptor;
09: import org.eclipse.swt.widgets.Event;
10:
11: /**
12: * The class representing a favourite Annotation
13: * Action entry
14: * @author sh
15: *
16: */
17: public class FavouriteAnnotationAction extends Action {
18: private String projectName = null;
19: private String path = null;
20:
21: /**
22: * Constructor
23: */
24: public FavouriteAnnotationAction(String projectName, String path,
25: ImageDescriptor imageDescriptor) {
26: super (path, imageDescriptor);
27: this .projectName = projectName;
28: this .path = path;
29: }
30:
31: /**
32: * runs the action and opens the Annotation
33: * in its specified editor
34: */
35: @Override
36: public void runWithEvent(Event event) {
37: super .runWithEvent(event);
38:
39: // open the Annotation by the OpenAnnotation Utility
40: OpenAnnotationUtil openUtil = new OpenAnnotationUtil();
41: openUtil.openAnnotation(path, projectName);
42: }
43: }
|