Added word wrap option (problem: conflicts with folding)
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / actions / CustomCopyAction.java
index 24ea456..3c0491b 100644 (file)
@@ -4,11 +4,13 @@
  */
 package com.quantum.actions;
 
+import java.sql.SQLException;
 import java.util.Iterator;
 
 import com.quantum.QuantumPlugin;
 import com.quantum.model.Column;
 import com.quantum.model.EntityHolder;
+import com.quantum.model.NotConnectedException;
 import com.quantum.util.NthLevelConverter;
 import com.quantum.util.QuantumUtil;
 import com.quantum.util.StringUtil;
@@ -22,14 +24,12 @@ import org.eclipse.ui.actions.SelectionListenerAction;
 
 
 public class CustomCopyAction extends SelectionListenerAction {
-       private final IViewPart view;
        private final int ind;
        /**
         * @param BookmarkView
         */
        public CustomCopyAction(IViewPart view, int ind) {
         super(null);
-               this.view = view;
                this.ind = ind;
        }
        public void run() {
@@ -43,18 +43,22 @@ public class CustomCopyAction extends SelectionListenerAction {
                                ColumnNode column = (ColumnNode) current;
                                if (column != null) {
                                        converter.add(column.getColumn().getName(), 
-                        column.getColumn().getParentEntity().getCondQualifiedName(), 0);
+                        column.getColumn().getParentEntity().getQualifiedName(), 0);
                                }
                        } else if (current instanceof EntityHolder) {
                 EntityHolder currentSelec = (EntityHolder) current;
-                               converter.add(currentSelec.getEntity().getCondQualifiedName(), null, 1);
-                               Column[] columns = currentSelec.getEntity().getColumns();
-                               for (int i = 0, length = (columns == null) ? 0 : columns.length;
-                    i < length;
-                    i++) {
-                                       converter.add(columns[i].getName(), 
-                        currentSelec.getEntity().getCondQualifiedName(), 0);
-                               }                                       
+                               converter.add(currentSelec.getEntity().getQualifiedName(), null, 1);
+                               try {
+                                       Column[] columns = currentSelec.getEntity().getColumns();
+                                       for (int i = 0, length = (columns == null) ? 0 : columns.length;
+                           i < length;
+                           i++) {
+                                               converter.add(columns[i].getName(), 
+                               currentSelec.getEntity().getQualifiedName(), 0);
+                                       }                                       
+                               } catch (NotConnectedException e) {
+                               } catch (SQLException e) {
+                               }
                        }
                }
                IPreferenceStore store = QuantumPlugin.getDefault().getPreferenceStore();