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.view.BookmarkView;
11 import net.sourceforge.phpdt.sql.view.bookmark.BookmarkNode;
16 * To change this generated comment edit the template variable "typecomment":
17 * Window>Preferences>Java>Templates.
18 * To enable and disable the creation of type comments go to
19 * Window>Preferences>Java>Code Generation.
21 public class DeleteBookmarkAction extends Action implements IViewActionDelegate {
24 * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart)
26 public void init(IViewPart view) {
27 this.view = (BookmarkView) view;
31 * @see org.eclipse.ui.IActionDelegate#run(IAction)
33 public void run(IAction action) {
38 Object selection = view.getCurrent();
39 if (selection instanceof BookmarkNode) {
40 BookmarkNode node = (BookmarkNode) selection;
42 String name = node.getName();
43 boolean flag = MessageDialog.openConfirm(view.getSite().getShell(), Messages.getString("bookmarkview.deleteBookmark"), Messages.getString("bookmarkview.confirm") + name); //$NON-NLS-1$ //$NON-NLS-2$
52 * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
54 public void selectionChanged(IAction action, ISelection selection) {