X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java index 1bf4dbe..86b9977 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java @@ -41,7 +41,8 @@ import org.eclipse.ui.views.contentoutline.ContentOutlinePage; * connected PHPEditor. */ public class PHPContentOutlinePage extends ContentOutlinePage { - + private static final String ERROR = "error"; //$NON-NLS-1$ + private static final String WARNING = "warning"; //$NON-NLS-1$ /** * A segment element. */ @@ -58,10 +59,10 @@ public class PHPContentOutlinePage extends ContentOutlinePage { return name; } }; - + protected static class SegmentComparator implements Comparator { public int compare(Object o1, Object o2) { - return ((Segment)o1).name.compareToIgnoreCase(((Segment)o2).name); + return ((Segment) o1).name.compareToIgnoreCase(((Segment) o2).name); } } @@ -82,9 +83,9 @@ public class PHPContentOutlinePage extends ContentOutlinePage { StringBuffer identifier = new StringBuffer(); while (i < textLength) { c = text.charAt(i++); - if (Character.isJavaIdentifierPart(c) || (c=='$')) { + if (Character.isJavaIdentifierPart(c) || (c == '$')) { identifier.append(c); - } else if ( (i==firstIndex+1) && (c=='$')) { + } else if ((i == firstIndex + 1) && (c == '$')) { identifier.append(c); } else { return identifier.toString(); @@ -178,10 +179,10 @@ public class PHPContentOutlinePage extends ContentOutlinePage { if (functionMode && Character.isJavaIdentifierPart((char) c)) { functionMode = false; - lastIndex = i-1; + lastIndex = i - 1; identifier = getIdentifier(text, lastIndex); try { - i += identifier.length()-1; + i += identifier.length() - 1; Position p = new Position(lastIndex, i - lastIndex); document.addPosition(SEGMENTS, p); fContent.add(new Segment(text.substring(lastIndex, i), p)); @@ -195,12 +196,12 @@ public class PHPContentOutlinePage extends ContentOutlinePage { identifier = getIdentifier(text, i - 1); if (identifier.equals("function")) { functionMode = true; - i+=8; + i += 8; } } else if (c == '$') { // get the variable name identifier = getIdentifier(text, i - 1); - fVariables.add( identifier ); + fVariables.add(identifier); } } @@ -265,7 +266,7 @@ public class PHPContentOutlinePage extends ContentOutlinePage { fContent.clear(); fContent = null; } - if (fVariables != null) { + if (fVariables != null) { fVariables.clear(); fVariables = null; }