1 package net.sourceforge.phpdt.sql.actions;
3 import org.eclipse.jface.action.Action;
4 import org.eclipse.jface.action.IAction;
5 import org.eclipse.jface.dialogs.InputDialog;
6 import org.eclipse.jface.viewers.ISelection;
7 import org.eclipse.ui.IViewActionDelegate;
8 import org.eclipse.ui.IViewPart;
10 import net.sourceforge.phpdt.sql.Messages;
11 import net.sourceforge.phpdt.sql.view.SubsetView;
12 import net.sourceforge.phpdt.sql.view.bookmark.SubsetNode;
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) {