import java.util.List;
import java.util.TreeSet;
-import net.sourceforge.phpdt.internal.compiler.parser.*;
+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;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import test.PHPParserSuperclass;
+
import test.PHPParserManager;
+import test.PHPParserSuperclass;
/**
* A content outline page which always represents the functions of the
* connected PHPEditor.
*/
-public class PHPContentOutlinePage extends ContentOutlinePage {
+public class PHPContentOutlinePage extends AbstractContentOutlinePage {
private static final String ERROR = "error"; //$NON-NLS-1$
private static final String WARNING = "warning"; //$NON-NLS-1$
}
}
- protected Object fInput;
protected IDocumentProvider fDocumentProvider;
protected ITextEditor fTextEditor;
protected PHPEditor fEditor;
- protected ContentProvider contentProvider;
+ protected ContentProvider fContentProvider;
/**
* Creates a content outline page using the given provider and the given editor.
*/
public PHPContentOutlinePage(IDocumentProvider provider, ITextEditor editor) {
super();
- contentProvider = null;
+ fContentProvider = null;
fDocumentProvider = provider;
fTextEditor = editor;
if (editor instanceof PHPEditor)
TreeViewer viewer = getTreeViewer();
- contentProvider = new ContentProvider();
- viewer.setContentProvider(contentProvider);
+ fContentProvider = new ContentProvider();
+ viewer.setContentProvider(fContentProvider);
viewer.setLabelProvider(new OutlineLabelProvider());
viewer.addSelectionChangedListener(this);
}
}
}
-
- /**
- * Sets the input of the outline page
- */
- public void setInput(Object input) {
- fInput = input;
- update();
- }
-
- /**
- * Updates the outline page.
- */
- public void update() {
- TreeViewer viewer = getTreeViewer();
-
- if (viewer != null) {
- Control control = viewer.getControl();
- if (control != null && !control.isDisposed()) {
- control.setRedraw(false);
- viewer.setInput(fInput);
- viewer.expandAll();
- control.setRedraw(true);
- }
- }
- }
public Object[] getVariables() {
- if (contentProvider != null) {
- return contentProvider.getVariables();
+ if (fContentProvider != null) {
+ return fContentProvider.getVariables();
}
return null;
}