01: /**
02: *
03: */package newprocess.diagram.cust.annotations.actions;
04:
05: import newprocess.diagram.cust.annotations.dialogs.AnnotationDialog;
06:
07: import org.eclipse.gef.EditPart;
08: import org.eclipse.jface.action.Action;
09: import org.eclipse.jface.resource.ImageDescriptor;
10: import org.eclipse.swt.widgets.Shell;
11: import org.eclipse.ui.PlatformUI;
12:
13: /**
14: * @author sh
15: *
16: */
17: public class ManageAnnotationAction extends Action {
18: private EditPart selectedEditPart = null;
19: private String projectName = null;
20:
21: /**
22: * Constructor
23: */
24: public ManageAnnotationAction(String text,
25: ImageDescriptor imageDescriptor, EditPart selectedEditPart,
26: String projectName) {
27: super (text, imageDescriptor);
28: this .selectedEditPart = selectedEditPart;
29: this .projectName = projectName;
30: }
31:
32: /**
33: * runs the action an opens the management dialog
34: */
35: @Override
36: public void run() {
37: super .run();
38:
39: // open the management dialog
40: Shell shell = PlatformUI.getWorkbench()
41: .getActiveWorkbenchWindow().getShell();
42: AnnotationDialog annoDia = new AnnotationDialog(shell,
43: selectedEditPart, projectName);
44: annoDia.open();
45: }
46: }
|