Author: ms1279
Date: Thu Apr 23 08:44:59 2009
New Revision: 2994

Modified:
   trunk/src/ca/sqlpower/architect/swingui/action/InsertColumnAction.java

Log:
As per the request of one of our forum users, columns now are added after the selected column. Previously it would add new columns in the reverse order.

Modified: trunk/src/ca/sqlpower/architect/swingui/action/InsertColumnAction.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/action/InsertColumnAction.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/action/InsertColumnAction.java Thu Apr 23 08:44:59 2009
@@ -62,6 +62,9 @@
                        // not found
logger.debug("did not find column, inserting at start of table."); //$NON-NLS-1$
                        idx = 0;
+               } else {
+ //This is so that the column is added after the selected the column
+                   idx++;
                }
         }
         if (st == null) {
@@ -82,7 +85,9 @@
         EditColumnAction editColumnAction = new EditColumnAction(session);

         //The actual column is added to the table when the user presses OK
-        editColumnAction.showDialog(tp.getModel(), idx,true, tp);
+ //Its added to the end of the table, if a table is selected or added right after
+        //the selected column
+ editColumnAction.showDialog(tp.getModel(), (tp.getSelectedItemIndex() < 0? idx: idx+1), true, tp);
     }

     @Override

Reply via email to