Defined a limit for code completion list entries PHPeclipsePlugin.MAX_PROPOSALS
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPContentOutlinePage.java
index 1544023..6d9d031 100644 (file)
@@ -21,8 +21,6 @@ import java.util.TreeSet;
 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
 import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
 import net.sourceforge.phpdt.internal.compiler.parser.PHPOutlineInfo;
-import net.sourceforge.phpdt.internal.compiler.parser.PHPSegment;
-import net.sourceforge.phpdt.internal.compiler.parser.PHPSegmentWithChildren;
 import net.sourceforge.phpdt.internal.ui.viewsupport.ImageDescriptorRegistry;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
 
@@ -56,10 +54,10 @@ public class PHPContentOutlinePage extends AbstractContentOutlinePage {
 
   protected static class SegmentComparator implements Comparator {
     public int compare(Object o1, Object o2) {
-      if (o1 instanceof PHPSegmentWithChildren && !(o2 instanceof PHPSegmentWithChildren)) {
+      if (o1 instanceof OutlineableWithChildren && !(o2 instanceof OutlineableWithChildren)) {
         return 1;
       }
-      if (o2 instanceof PHPSegmentWithChildren && !(o1 instanceof PHPSegmentWithChildren)) {
+      if (o2 instanceof OutlineableWithChildren && !(o1 instanceof OutlineableWithChildren)) {
         return -1;
       }
       return ((Outlineable) o1).toString().compareToIgnoreCase(((Outlineable) o2).toString());
@@ -184,8 +182,8 @@ public class PHPContentOutlinePage extends AbstractContentOutlinePage {
      * @see ITreeContentProvider#hasChildren(Object)
      */
     public boolean hasChildren(Object element) {
-      if (element instanceof PHPSegmentWithChildren) {
-        return !((PHPSegmentWithChildren) element).getList().isEmpty();
+      if (element instanceof OutlineableWithChildren) {
+        return !((OutlineableWithChildren) element).getList().isEmpty();
       }
       return element == fInput;
     }
@@ -206,8 +204,8 @@ public class PHPContentOutlinePage extends AbstractContentOutlinePage {
     public Object[] getChildren(Object element) {
       if (element == fInput)
         return fContent.toArray();
-      if (element instanceof PHPSegmentWithChildren)
-        return ((PHPSegmentWithChildren) element).getList().toArray();
+      if (element instanceof OutlineableWithChildren)
+        return ((OutlineableWithChildren) element).getList().toArray();
       return new Object[0];
     }
   };
@@ -217,7 +215,6 @@ public class PHPContentOutlinePage extends AbstractContentOutlinePage {
 
     public OutlineLabelProvider() {
       fRegistry = PHPeclipsePlugin.getImageDescriptorRegistry();
-      ;
     }
     /**
     * The <code>LabelProvider</code> implementation of this 
@@ -280,7 +277,7 @@ public class PHPContentOutlinePage extends AbstractContentOutlinePage {
     if (selection.isEmpty())
       fTextEditor.resetHighlightRange();
     else {
-      PHPSegment segment = (PHPSegment) ((IStructuredSelection) selection).getFirstElement();
+      Outlineable segment = (Outlineable) ((IStructuredSelection) selection).getFirstElement();
       int start = segment.getPosition().getOffset();
       int length = segment.getPosition().getLength();
       try {