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.MessageDialog;
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;
16 * Deletes a complete subset from the subset view
18 public class DeleteSubsetAction extends Action implements IViewActionDelegate {
21 * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart)
23 public void init(IViewPart view) {
24 this.view = (SubsetView) view;
28 * @see org.eclipse.ui.IActionDelegate#run(IAction)
30 public void run(IAction action) {
35 Object selection = view.getCurrent();
36 if (selection instanceof SubsetNode) {
37 SubsetNode node = (SubsetNode) selection;
39 boolean flag = MessageDialog.openConfirm(view.getSite().getShell(),
40 Messages.getString("DeleteSubsetAction.DeleteSubset"), //$NON-NLS-1$
41 Messages.getString("DeleteSubsetAction.ConfirmDeleteSubset") + node.getName()); //$NON-NLS-1$
50 * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
52 public void selectionChanged(IAction action, ISelection selection) {