1 package com.quantum.actions;
3 import com.quantum.Messages;
4 import com.quantum.view.subset.SubsetNode;
5 import com.quantum.view.subset.SubsetView;
7 import org.eclipse.jface.action.Action;
8 import org.eclipse.jface.action.IAction;
9 import org.eclipse.jface.dialogs.InputDialog;
10 import org.eclipse.jface.viewers.ISelection;
11 import org.eclipse.ui.IViewActionDelegate;
12 import org.eclipse.ui.IViewPart;
18 public class NewSubsetAction extends Action implements IViewActionDelegate {
21 * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart)
23 public void init(IViewPart view) {
29 * @see org.eclipse.ui.IActionDelegate#run(IAction)
31 public void run(IAction action) {
35 System.out.println(Messages.getString("NewSubsetAction.CreatingNewSubset")); //$NON-NLS-1$
36 InputDialog dialog = new InputDialog(view.getSite().getShell(),
37 Messages.getString("NewSubsetAction.NameOfNewSubset"), Messages.getString("NewSubsetAction.PleaseEnterName"), null, null); //$NON-NLS-1$ //$NON-NLS-2$
39 String value = dialog.getValue();
41 SubsetNode subset = new SubsetNode(value);
42 ((SubsetView) view).addNewSubset(subset);
48 * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
50 public void selectionChanged(IAction action, ISelection selection) {