inital plugin from webtools project
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPUnitEditor.java
index 6cb6318..182b550 100644 (file)
@@ -1159,16 +1159,16 @@ public class PHPUnitEditor extends PHPEditor { //implements
   /** The editor's paint manager */
   //  private PaintManager fPaintManager;
   /** The editor's bracket painter */
-  private BracketPainter fBracketPainter;
+//  private BracketPainter fBracketPainter;
 
   /** The editor's bracket matcher */
   private PHPPairMatcher fBracketMatcher;
 
   /** The editor's line painter */
-  private LinePainter fLinePainter;
+//  private LinePainter fLinePainter;
 
   /** The editor's print margin ruler painter */
-  private PrintMarginPainter fPrintMarginPainter;
+//  private PrintMarginPainter fPrintMarginPainter;
 
   /** The editor's problem painter */
   //  private ProblemPainter fProblemPainter;
@@ -1215,25 +1215,25 @@ public class PHPUnitEditor extends PHPEditor { //implements
   private final static String CODE_FORMATTER_TAB_SIZE = JavaCore.FORMATTER_TAB_SIZE;
 
   /** Preference key for matching brackets */
-  private final static String MATCHING_BRACKETS = PreferenceConstants.EDITOR_MATCHING_BRACKETS;
+//  private final static String MATCHING_BRACKETS = PreferenceConstants.EDITOR_MATCHING_BRACKETS;
 
   /** Preference key for matching brackets color */
-  private final static String MATCHING_BRACKETS_COLOR = PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR;
+//  private final static String MATCHING_BRACKETS_COLOR = PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR;
 
   /** Preference key for highlighting current line */
-  private final static String CURRENT_LINE = PreferenceConstants.EDITOR_CURRENT_LINE;
+//  private final static String CURRENT_LINE = PreferenceConstants.EDITOR_CURRENT_LINE;
 
   /** Preference key for highlight color of current line */
-  private final static String CURRENT_LINE_COLOR = PreferenceConstants.EDITOR_CURRENT_LINE_COLOR;
+//  private final static String CURRENT_LINE_COLOR = PreferenceConstants.EDITOR_CURRENT_LINE_COLOR;
 
   /** Preference key for showing print marging ruler */
-  private final static String PRINT_MARGIN = PreferenceConstants.EDITOR_PRINT_MARGIN;
+//  private final static String PRINT_MARGIN = PreferenceConstants.EDITOR_PRINT_MARGIN;
 
   /** Preference key for print margin ruler color */
-  private final static String PRINT_MARGIN_COLOR = PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR;
+//  private final static String PRINT_MARGIN_COLOR = PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR;
 
   /** Preference key for print margin ruler column */
-  private final static String PRINT_MARGIN_COLUMN = PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN;
+//  private final static String PRINT_MARGIN_COLUMN = PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN;
 
   /** Preference key for inserting spaces rather than tabs */
   private final static String SPACES_FOR_TABS = PreferenceConstants.EDITOR_SPACES_FOR_TABS;
@@ -1305,7 +1305,7 @@ public class PHPUnitEditor extends PHPEditor { //implements
   private final static String CLOSE_STRINGS_SQ_PHP = PreferenceConstants.EDITOR_CLOSE_STRINGS_SQ_PHP;
 
   /** Preference key for automatically wrapping Java strings */
-  private final static String WRAP_STRINGS = PreferenceConstants.EDITOR_WRAP_STRINGS;
+//  private final static String WRAP_STRINGS = PreferenceConstants.EDITOR_WRAP_STRINGS_DQ;
 
   /** Preference key for automatically closing brackets and parenthesis */
   private final static String CLOSE_BRACKETS_PHP = PreferenceConstants.EDITOR_CLOSE_BRACKETS_PHP;
@@ -1590,12 +1590,12 @@ public class PHPUnitEditor extends PHPEditor { //implements
     linePainter = new LinePainter(getSourceViewer());
     linePainter.setHighlightColor(new Color(Display.getCurrent(), 225, 235, 224));
     //    fPaintManager.addPainter(linePainter);
-    if (isBracketHighlightingEnabled())
-      startBracketHighlighting();
-    if (isLineHighlightingEnabled())
-      startLineHighlighting();
-    if (isPrintMarginVisible())
-      showPrintMargin();
+//    if (isBracketHighlightingEnabled())
+//      startBracketHighlighting();
+//    if (isLineHighlightingEnabled())
+//      startLineHighlighting();
+//    if (isPrintMarginVisible())
+//      showPrintMargin();
     //    Iterator e = ANNOTATION_MAP.keySet().iterator();
     //    while (e.hasNext()) {
     //      AnnotationType type = (AnnotationType) e.next();
@@ -1645,74 +1645,74 @@ public class PHPUnitEditor extends PHPEditor { //implements
     }
   }
 
-  private void startBracketHighlighting() {
-    if (fBracketPainter == null) {
-      ISourceViewer sourceViewer = getSourceViewer();
-      fBracketPainter = new BracketPainter(sourceViewer);
-      fBracketPainter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR));
-      //      fPaintManager.addPainter(fBracketPainter);
-    }
-  }
-
-  private void stopBracketHighlighting() {
-    if (fBracketPainter != null) {
-      //      fPaintManager.removePainter(fBracketPainter);
-      fBracketPainter.deactivate(true);
-      fBracketPainter.dispose();
-      fBracketPainter = null;
-    }
-  }
-
-  private boolean isBracketHighlightingEnabled() {
-    IPreferenceStore store = getPreferenceStore();
-    return store.getBoolean(MATCHING_BRACKETS);
-  }
-
-  private void startLineHighlighting() {
-    if (fLinePainter == null) {
-      ISourceViewer sourceViewer = getSourceViewer();
-      fLinePainter = new LinePainter(sourceViewer);
-      fLinePainter.setHighlightColor(getColor(CURRENT_LINE_COLOR));
-      //      fPaintManager.addPainter(fLinePainter);
-    }
-  }
-
-  private void stopLineHighlighting() {
-    if (fLinePainter != null) {
-      //      fPaintManager.removePainter(fLinePainter);
-      fLinePainter.deactivate(true);
-      fLinePainter.dispose();
-      fLinePainter = null;
-    }
-  }
-
-  private boolean isLineHighlightingEnabled() {
-    IPreferenceStore store = getPreferenceStore();
-    return store.getBoolean(CURRENT_LINE);
-  }
-
-  private void showPrintMargin() {
-    if (fPrintMarginPainter == null) {
-      fPrintMarginPainter = new PrintMarginPainter(getSourceViewer());
-      fPrintMarginPainter.setMarginRulerColor(getColor(PRINT_MARGIN_COLOR));
-      fPrintMarginPainter.setMarginRulerColumn(getPreferenceStore().getInt(PRINT_MARGIN_COLUMN));
-      //      fPaintManager.addPainter(fPrintMarginPainter);
-    }
-  }
-
-  private void hidePrintMargin() {
-    if (fPrintMarginPainter != null) {
-      //      fPaintManager.removePainter(fPrintMarginPainter);
-      fPrintMarginPainter.deactivate(true);
-      fPrintMarginPainter.dispose();
-      fPrintMarginPainter = null;
-    }
-  }
-
-  private boolean isPrintMarginVisible() {
-    IPreferenceStore store = getPreferenceStore();
-    return store.getBoolean(PRINT_MARGIN);
-  }
+//  private void startBracketHighlighting() {
+//    if (fBracketPainter == null) {
+//      ISourceViewer sourceViewer = getSourceViewer();
+//      fBracketPainter = new BracketPainter(sourceViewer);
+//      fBracketPainter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR));
+//      //      fPaintManager.addPainter(fBracketPainter);
+//    }
+//  }
+//
+//  private void stopBracketHighlighting() {
+//    if (fBracketPainter != null) {
+//      //      fPaintManager.removePainter(fBracketPainter);
+//      fBracketPainter.deactivate(true);
+//      fBracketPainter.dispose();
+//      fBracketPainter = null;
+//    }
+//  }
+
+//  private boolean isBracketHighlightingEnabled() {
+//    IPreferenceStore store = getPreferenceStore();
+//    return store.getBoolean(MATCHING_BRACKETS);
+//  }
+
+//  private void startLineHighlighting() {
+//    if (fLinePainter == null) {
+//      ISourceViewer sourceViewer = getSourceViewer();
+//      fLinePainter = new LinePainter(sourceViewer);
+//      fLinePainter.setHighlightColor(getColor(CURRENT_LINE_COLOR));
+//      //      fPaintManager.addPainter(fLinePainter);
+//    }
+//  }
+
+//  private void stopLineHighlighting() {
+//    if (fLinePainter != null) {
+//      //      fPaintManager.removePainter(fLinePainter);
+//      fLinePainter.deactivate(true);
+//      fLinePainter.dispose();
+//      fLinePainter = null;
+//    }
+//  }
+
+//  private boolean isLineHighlightingEnabled() {
+//    IPreferenceStore store = getPreferenceStore();
+//    return store.getBoolean(CURRENT_LINE);
+//  }
+
+//  private void showPrintMargin() {
+//    if (fPrintMarginPainter == null) {
+//      fPrintMarginPainter = new PrintMarginPainter(getSourceViewer());
+//      fPrintMarginPainter.setMarginRulerColor(getColor(PRINT_MARGIN_COLOR));
+//      fPrintMarginPainter.setMarginRulerColumn(getPreferenceStore().getInt(PRINT_MARGIN_COLUMN));
+//      //      fPaintManager.addPainter(fPrintMarginPainter);
+//    }
+//  }
+
+//  private void hidePrintMargin() {
+//    if (fPrintMarginPainter != null) {
+//      //      fPaintManager.removePainter(fPrintMarginPainter);
+//      fPrintMarginPainter.deactivate(true);
+//      fPrintMarginPainter.dispose();
+//      fPrintMarginPainter = null;
+//    }
+//  }
+
+//  private boolean isPrintMarginVisible() {
+//    IPreferenceStore store = getPreferenceStore();
+//    return store.getBoolean(PRINT_MARGIN);
+//  }
 
   //  private void startAnnotationIndication(AnnotationType annotationType) {
   //    if (fProblemPainter == null) {
@@ -1914,49 +1914,49 @@ public class PHPUnitEditor extends PHPEditor { //implements
             stopTabConversion();
           return;
         }
-        if (MATCHING_BRACKETS.equals(p)) {
-          if (isBracketHighlightingEnabled())
-            startBracketHighlighting();
-          else
-            stopBracketHighlighting();
-          return;
-        }
-        if (MATCHING_BRACKETS_COLOR.equals(p)) {
-          if (fBracketPainter != null)
-            fBracketPainter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR));
-          return;
-        }
-        if (CURRENT_LINE.equals(p)) {
-          if (isLineHighlightingEnabled())
-            startLineHighlighting();
-          else
-            stopLineHighlighting();
-          return;
-        }
-        if (CURRENT_LINE_COLOR.equals(p)) {
-          if (fLinePainter != null) {
-            stopLineHighlighting();
-            startLineHighlighting();
-          }
-          return;
-        }
-        if (PRINT_MARGIN.equals(p)) {
-          if (isPrintMarginVisible())
-            showPrintMargin();
-          else
-            hidePrintMargin();
-          return;
-        }
-        if (PRINT_MARGIN_COLOR.equals(p)) {
-          if (fPrintMarginPainter != null)
-            fPrintMarginPainter.setMarginRulerColor(getColor(PRINT_MARGIN_COLOR));
-          return;
-        }
-        if (PRINT_MARGIN_COLUMN.equals(p)) {
-          if (fPrintMarginPainter != null)
-            fPrintMarginPainter.setMarginRulerColumn(getPreferenceStore().getInt(PRINT_MARGIN_COLUMN));
-          return;
-        }
+//        if (MATCHING_BRACKETS.equals(p)) {
+//          if (isBracketHighlightingEnabled())
+//            startBracketHighlighting();
+//          else
+//            stopBracketHighlighting();
+//          return;
+//        }
+//        if (MATCHING_BRACKETS_COLOR.equals(p)) {
+//          if (fBracketPainter != null)
+//            fBracketPainter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR));
+//          return;
+//        }
+//        if (CURRENT_LINE.equals(p)) {
+//          if (isLineHighlightingEnabled())
+//            startLineHighlighting();
+//          else
+//            stopLineHighlighting();
+//          return;
+//        }
+//        if (CURRENT_LINE_COLOR.equals(p)) {
+//          if (fLinePainter != null) {
+//            stopLineHighlighting();
+//            startLineHighlighting();
+//          }
+//          return;
+//        }
+//        if (PRINT_MARGIN.equals(p)) {
+//          if (isPrintMarginVisible())
+//            showPrintMargin();
+//          else
+//            hidePrintMargin();
+//          return;
+//        }
+//        if (PRINT_MARGIN_COLOR.equals(p)) {
+//          if (fPrintMarginPainter != null)
+//            fPrintMarginPainter.setMarginRulerColor(getColor(PRINT_MARGIN_COLOR));
+//          return;
+//        }
+//        if (PRINT_MARGIN_COLUMN.equals(p)) {
+//          if (fPrintMarginPainter != null)
+//            fPrintMarginPainter.setMarginRulerColumn(getPreferenceStore().getInt(PRINT_MARGIN_COLUMN));
+//          return;
+//        }
         //        if (OVERVIEW_RULER.equals(p)) {
         //          if (isOverviewRulerVisible())
         //            showOverviewRuler();
@@ -2430,10 +2430,6 @@ public class PHPUnitEditor extends PHPEditor { //implements
     }
   }
 
-  private boolean synchronizeOutlineOnCursorMove() {
-    return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE);
-  }
-
   /**
    * Returns the updated java element for the old java element.
    */