Refactory: removed unnecessary local variables and imports.
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.sql / src / net / sourceforge / phpdt / sql / actions / ViewTableDetailsAction.java
index 2c8d5b5..4a34156 100644 (file)
@@ -6,9 +6,11 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.IViewActionDelegate;
 import org.eclipse.ui.IViewPart;
 
+import net.sourceforge.phpdt.sql.Messages;
 import net.sourceforge.phpdt.sql.sql.MultiSQLServer;
 import net.sourceforge.phpdt.sql.view.BookmarkView;
 import net.sourceforge.phpdt.sql.view.TableView;
+import net.sourceforge.phpdt.sql.view.bookmark.BookmarkNode;
 import net.sourceforge.phpdt.sql.view.bookmark.TableNode;
 import net.sourceforge.phpdt.sql.view.bookmark.TreeNode;
 import net.sourceforge.phpdt.sql.view.bookmark.ViewNode;
@@ -26,14 +28,16 @@ public class ViewTableDetailsAction extends Action implements IViewActionDelegat
        public void run() {
                TreeNode node = (TreeNode) view.getCurrent();
                StringBuffer query = new StringBuffer();
-               query.append("METADATA:");
+               query.append(Messages.getString("MetaDataKey")+Messages.getString("MetaDataKeySeparator")); //$NON-NLS-1$ //$NON-NLS-2$
                if (node instanceof TableNode) {
                        query.append(((TableNode) node).getName());
                } else if (node instanceof ViewNode) {
                        query.append(((ViewNode) node).getName());
                }
                MultiSQLServer server = MultiSQLServer.getInstance();
-               TableView.getInstance().loadQuery(server.execute(query.toString()));
+               BookmarkNode current = view.getCurrentBookmark();
+
+               TableView.getInstance().loadQuery(current, server.execute(current.getConnection(), query.toString()));
        }
        public void selectionChanged(IAction action, ISelection selection) {
        }