* 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.
*/
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);
}
}
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();
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));
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);
}
}
fContent.clear();
fContent = null;
}
- if (fVariables != null) {
+ if (fVariables != null) {
fVariables.clear();
fVariables = null;
}