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.viewers.ISelection;
6 import org.eclipse.ui.IViewActionDelegate;
7 import org.eclipse.ui.IViewPart;
9 import net.sourceforge.phpdt.sql.sql.MultiSQLServer;
10 import net.sourceforge.phpdt.sql.view.BookmarkView;
11 import net.sourceforge.phpdt.sql.view.TableView;
12 import net.sourceforge.phpdt.sql.view.bookmark.TableNode;
13 import net.sourceforge.phpdt.sql.view.bookmark.TreeNode;
14 import net.sourceforge.phpdt.sql.view.bookmark.ViewNode;
16 public class ViewTableDetailsAction extends Action implements IViewActionDelegate {
19 public void init(IViewPart view) {
20 this.view = (BookmarkView) view;
23 public void run(IAction action) {
27 TreeNode node = (TreeNode) view.getCurrent();
28 StringBuffer query = new StringBuffer();
29 query.append("METADATA:");
30 if (node instanceof TableNode) {
31 query.append(((TableNode) node).getName());
32 } else if (node instanceof ViewNode) {
33 query.append(((ViewNode) node).getName());
35 MultiSQLServer server = MultiSQLServer.getInstance();
36 TableView.getInstance().loadQuery(server.execute(query.toString()));
38 public void selectionChanged(IAction action, ISelection selection) {