introduced IConstant.DEBUG flag
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.sql / src / net / sourceforge / phpdt / sql / view / SQLQueryView.java
index 4756d02..24ae30d 100644 (file)
@@ -4,7 +4,14 @@ import java.util.LinkedList;
 import java.util.NoSuchElementException;
 import java.util.Vector;
 
+import net.sourceforge.phpdt.sql.IConstants;
 import net.sourceforge.phpdt.sql.PHPEclipseSQLPlugin;
+import net.sourceforge.phpdt.sql.actions.ExecuteAction;
+import net.sourceforge.phpdt.sql.actions.ExportQueryAction;
+import net.sourceforge.phpdt.sql.actions.ImportQueryAction;
+import net.sourceforge.phpdt.sql.parser.SQLLexx;
+import net.sourceforge.phpdt.sql.parser.Token;
+import net.sourceforge.phpdt.sql.sql.MultiSQLServer;
 
 import org.eclipse.jface.action.Action;
 import org.eclipse.swt.SWT;
@@ -28,14 +35,7 @@ import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.part.ViewPart;
 
-import net.sourceforge.phpdt.sql.actions.ExecuteAction;
-import net.sourceforge.phpdt.sql.actions.ExportQueryAction;
-import net.sourceforge.phpdt.sql.actions.ImportQueryAction;
-import net.sourceforge.phpdt.sql.sql.MultiSQLServer;
-import net.sourceforge.phpdt.sql.parser.SQLLexx;
-import net.sourceforge.phpdt.sql.parser.Token;
-
-public class SQLQueryView extends ViewPart {
+public class SQLQueryView extends ViewPart implements IConstants {
        private ExecuteAction executeAction;
        private ImportQueryAction importQueryAction;
        private ExportQueryAction exportQueryAction;
@@ -369,8 +369,10 @@ public class SQLQueryView extends ViewPart {
                                                widget.setStyleRange(styles[i]);
                                        }
                                } catch (Throwable t) {
+          if (DEBUG) {
                                        System.out.println("Error with styles: " + t.getClass().toString());
                                        // ignore any errors
+          }
                                }
                        }
                });