Merged xdebug from 1.3.x
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.sql / src / net / sourceforge / phpdt / sql / actions / SetSchemaAction.java
1 package net.sourceforge.phpdt.sql.actions;
2
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;
9
10 import net.sourceforge.phpdt.sql.Messages;
11 import net.sourceforge.phpdt.sql.bookmarks.Bookmark;
12 import net.sourceforge.phpdt.sql.view.BookmarkView;
13
14 public class SetSchemaAction extends Action implements IViewActionDelegate {
15         BookmarkView view;
16         public void init(IViewPart view) {
17                 this.view = (BookmarkView) view;
18         }
19
20         public void run(IAction action) {
21                 run();
22         }
23         
24         public void run() {
25                 Bookmark bookmark = view.getCurrentBookmark();
26                 InputDialog dialog = new InputDialog(view.getSite().getShell(), 
27                     Messages.getString("SetSchemaAction.SetSchema"), Messages.getString("SetSchemaAction.PleaseEnterName"), //$NON-NLS-1$ //$NON-NLS-2$
28                     bookmark.getSchema(), null);
29                 dialog.open();
30                 String value = dialog.getValue();
31                 if (value != null) {
32                         bookmark.setSchema(value);
33                 }
34         }
35
36         public void selectionChanged(IAction action, ISelection selection) {
37         }
38
39 }