Started with PHP/HTML Formatter menu => doesn't work right now
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.sql / src / net / sourceforge / phpdt / sql / actions / ViewTableDetailsAction.java
index 2c8d5b5..778b332 100644 (file)
@@ -1,11 +1,5 @@
 package net.sourceforge.phpdt.sql.actions;
 
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
 import net.sourceforge.phpdt.sql.sql.MultiSQLServer;
 import net.sourceforge.phpdt.sql.view.BookmarkView;
 import net.sourceforge.phpdt.sql.view.TableView;
@@ -13,6 +7,15 @@ import net.sourceforge.phpdt.sql.view.bookmark.TableNode;
 import net.sourceforge.phpdt.sql.view.bookmark.TreeNode;
 import net.sourceforge.phpdt.sql.view.bookmark.ViewNode;
 
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
 public class ViewTableDetailsAction extends Action implements IViewActionDelegate {
        BookmarkView view;
        
@@ -32,6 +35,12 @@ public class ViewTableDetailsAction extends Action implements IViewActionDelegat
                } else if (node instanceof ViewNode) {
                        query.append(((ViewNode) node).getName());
                }
+    try {
+      IWorkbenchPage page =
+        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+      page.showView(TableView.TABLEVIEW_ID);
+    } catch (PartInitException e) {
+    }
                MultiSQLServer server = MultiSQLServer.getInstance();
                TableView.getInstance().loadQuery(server.execute(query.toString()));
        }