Started with PHP/HTML Formatter menu => doesn't work right now
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.sql / src / net / sourceforge / phpdt / sql / view / TableView.java
index 97c351f..6f0123c 100644 (file)
@@ -1,6 +1,20 @@
 package net.sourceforge.phpdt.sql.view;
 
 import net.sourceforge.phpdt.sql.PHPEclipseSQLPlugin;
+import net.sourceforge.phpdt.sql.actions.CloseTableAction;
+import net.sourceforge.phpdt.sql.actions.RefreshTableAction;
+import net.sourceforge.phpdt.sql.sql.SQLResults;
+import net.sourceforge.phpdt.sql.sql.TableRow;
+import net.sourceforge.phpdt.sql.view.tableview.TableAdapter;
+import net.sourceforge.phpdt.sql.wizards.DeleteRowPage;
+import net.sourceforge.phpdt.sql.wizards.InsertRowPage;
+import net.sourceforge.phpdt.sql.wizards.PHPDeleteRowPage;
+import net.sourceforge.phpdt.sql.wizards.PHPInsertRowPage;
+import net.sourceforge.phpdt.sql.wizards.PHPSelectRowPage;
+import net.sourceforge.phpdt.sql.wizards.PHPUpdateRowPage;
+import net.sourceforge.phpdt.sql.wizards.SQLRowWizard;
+import net.sourceforge.phpdt.sql.wizards.SortFilterPage;
+import net.sourceforge.phpdt.sql.wizards.UpdateRowPage;
 
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IMenuListener;
@@ -30,21 +44,9 @@ import org.eclipse.ui.ISelectionListener;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.part.ViewPart;
 
-import net.sourceforge.phpdt.sql.actions.CloseTableAction;
-import net.sourceforge.phpdt.sql.actions.RefreshTableAction;
-import net.sourceforge.phpdt.sql.sql.SQLResults;
-import net.sourceforge.phpdt.sql.sql.TableRow;
-import net.sourceforge.phpdt.sql.view.tableview.TableAdapter;
-import net.sourceforge.phpdt.sql.wizards.DeleteRowPage;
-import net.sourceforge.phpdt.sql.wizards.InsertRowPage;
-import net.sourceforge.phpdt.sql.wizards.PHPSelectRowPage;
-import net.sourceforge.phpdt.sql.wizards.SQLRowWizard;
-import net.sourceforge.phpdt.sql.wizards.SortFilterPage;
-import net.sourceforge.phpdt.sql.wizards.UpdateRowPage;
-import net.sourceforge.phpdt.sql.wizards.PHPSelectRowPage;
-
 public class TableView extends ViewPart implements ISelectionListener {
-  public static String TABLEVIEW_ID = "net.sourceforge.phpdt.sql.view.tableview";
+  public static String TABLEVIEW_ID =
+    "net.sourceforge.phpdt.sql.view.tableview";
   private Clipboard clip;
   private RefreshTableAction refreshTableAction;
   private CloseTableAction closeTableAction;
@@ -380,7 +382,7 @@ public class TableView extends ViewPart implements ISelectionListener {
             public void run() {
               PHPSelectRowPage page = new PHPSelectRowPage("");
               SQLRowWizard wizard = new SQLRowWizard();
-              wizard.init("PHP Select Generation", page, row, ta);
+              wizard.init("PHP Select Generator", page, row, ta);
               WizardDialog dialog =
                 new WizardDialog(getSite().getShell(), wizard);
               dialog.open();
@@ -388,13 +390,51 @@ public class TableView extends ViewPart implements ISelectionListener {
           };
           phpSelectAction.setText(Messages.getString("tableview.phpselect")); //$NON-NLS-1$
 
+          Action phpUpdateAction = new Action() {
+            public void run() {
+              PHPUpdateRowPage page = new PHPUpdateRowPage("");
+              SQLRowWizard wizard = new SQLRowWizard();
+              wizard.init("PHP Update Generator", page, row, ta);
+              WizardDialog dialog =
+                new WizardDialog(getSite().getShell(), wizard);
+              dialog.open();
+            }
+          };
+          phpUpdateAction.setText(Messages.getString("tableview.phpupdate")); //$NON-NLS-1$
+
+          Action phpInsertAction = new Action() {
+            public void run() {
+              PHPInsertRowPage page = new PHPInsertRowPage("");
+              SQLRowWizard wizard = new SQLRowWizard();
+              wizard.init("PHP Insert Generator", page, row, ta);
+              WizardDialog dialog =
+                new WizardDialog(getSite().getShell(), wizard);
+              dialog.open();
+            }
+          };
+          phpInsertAction.setText(Messages.getString("tableview.phpinsert")); //$NON-NLS-1$
+
+          Action phpDeleteAction = new Action() {
+            public void run() {
+              PHPDeleteRowPage page = new PHPDeleteRowPage("");
+              SQLRowWizard wizard = new SQLRowWizard();
+              wizard.init("PHP Delete Generator", page, row, ta);
+              WizardDialog dialog =
+                new WizardDialog(getSite().getShell(), wizard);
+              dialog.open();
+            }
+          };
+          phpDeleteAction.setText(Messages.getString("tableview.phpdelete")); //$NON-NLS-1$
+
           mgr.add(phpSelectAction);
-          
+          mgr.add(phpUpdateAction);
+          mgr.add(phpInsertAction);
+          mgr.add(phpDeleteAction);
+
           mgr.add(insertAction);
           mgr.add(updateAction);
           mgr.add(deleteAction);
-          
-          
+
         }
         mgr.add(defaultEncodingAction);
         mgr.add(UTF8EncodingAction);