import java.util.Map;
import java.util.Set;
+import net.sourceforge.phpdt.ui.text.JavaTextTools;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
* @see ITextListener#textChanged
*/
public void textChanged(TextEvent e) {
- if (fTextViewer != null
- && e.getDocumentEvent() == null
- && e.getViewerRedrawState()) {
+ if (fTextViewer != null && e.getDocumentEvent() == null && e.getViewerRedrawState()) {
// handle only changes of visible document
redraw();
}
Annotation a = (Annotation) e.next();
Position p = fModel.getPosition(a);
- if (p == null
- || !p.overlapsWith(visible.getOffset(), visible.getLength()))
+ if (p == null || !p.overlapsWith(visible.getOffset(), visible.getLength()))
continue;
int problemOffset = Math.max(p.getOffset(), visible.getOffset());
- int problemEnd =
- Math.min(
- p.getOffset() + p.getLength(),
- visible.getOffset() + visible.getLength());
+ int problemEnd = Math.min(p.getOffset() + p.getLength(), visible.getOffset() + visible.getLength());
int problemLength = problemEnd - problemOffset;
try {
if (PROBLEM_HEIGHT_SCALABLE) {
- int numbersOfLines =
- document.getNumberOfLines(problemOffset, problemLength);
+ int numbersOfLines = document.getNumberOfLines(problemOffset, problemLength);
hh = (numbersOfLines * size.y) / maxLines;
if (hh < PROBLEM_HEIGHT_MIN)
hh = PROBLEM_HEIGHT_MIN;
}
fProblemHeight = hh;
- int startLine =
- textWidget.getLineAtOffset(problemOffset - visible.getOffset());
+ int startLine = textWidget.getLineAtOffset(problemOffset - visible.getOffset());
yy = Math.min((startLine * size.y) / maxLines, size.y - hh);
if (fill != null) {
if (p == null)
continue;
- IRegion widgetRegion =
- extension.modelRange2WidgetRange(
- new Region(p.getOffset(), p.getLength()));
+ IRegion widgetRegion = extension.modelRange2WidgetRange(new Region(p.getOffset(), p.getLength()));
if (widgetRegion == null)
continue;
try {
if (PROBLEM_HEIGHT_SCALABLE) {
- int numbersOfLines =
- document.getNumberOfLines(p.getOffset(), p.getLength());
+ int numbersOfLines = document.getNumberOfLines(p.getOffset(), p.getLength());
hh = (numbersOfLines * size.y) / maxLines;
if (hh < PROBLEM_HEIGHT_MIN)
hh = PROBLEM_HEIGHT_MIN;
}
fProblemHeight = hh;
- int startLine =
- textWidget.getLineAtOffset(widgetRegion.getOffset());
+ int startLine = textWidget.getLineAtOffset(widgetRegion.getOffset());
yy = Math.min((startLine * size.y) / maxLines, size.y - hh);
if (fill != null) {
} else {
try {
IRegion visible = fTextViewer.getVisibleRegion();
- int lineNumber =
- fTextViewer.getDocument().getLineOfOffset(visible.getOffset());
+ int lineNumber = fTextViewer.getDocument().getLineOfOffset(visible.getOffset());
lines[0] += lineNumber;
lines[1] += lineNumber;
} catch (BadLocationException x) {
}
private static Color getColor(RGB rgb) {
- // PHPTextTools textTools= PHPeclipsePlugin.getDefault().getPHPTextTools();
- // return textTools.getColorManager().getColor(rgb);
- return PHPEditorEnvironment.getPHPColorProvider().getColor(rgb);
+ JavaTextTools textTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
+ return textTools.getColorManager().getColor(rgb);
}
private Color getColor(AnnotationType annotationType, double scale) {
return getColor(interpolate(baseRGB, background, scale));
}
- private Color getStrokeColor(
- AnnotationType annotationType,
- boolean temporary) {
+ private Color getStrokeColor(AnnotationType annotationType, boolean temporary) {
return getColor(annotationType, temporary ? 0.5 : 0.2);
}
- private Color getFillColor(
- AnnotationType annotationType,
- boolean temporary) {
+ private Color getFillColor(AnnotationType annotationType, boolean temporary) {
return getColor(annotationType, temporary ? 0.9 : 0.6);
}