* Contributors:
* Christopher Lenz - initial API and implementation
*
- * $Id: XMLOutlinePage.java,v 1.1 2004-09-02 18:28:05 jsurfer Exp $
+ * $Id: XMLOutlinePage.java,v 1.3 2006-10-21 23:14:14 pombredanne Exp $
*/
package net.sourceforge.phpeclipse.xml.ui.internal.outline;
import java.util.List;
+import net.sourceforge.phpeclipse.core.model.ISourceReference;
+import net.sourceforge.phpeclipse.ui.views.outline.ProblemsLabelDecorator;
+import net.sourceforge.phpeclipse.xml.core.model.IXMLDocument;
+import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentProvider;
+import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLEditor;
+
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import net.sourceforge.phpeclipse.core.model.ISourceReference;
-import net.sourceforge.phpeclipse.ui.views.outline.ProblemsLabelDecorator;
-import net.sourceforge.phpeclipse.xml.core.model.IXMLDocument;
-import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentProvider;
-import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLEditor;
-
/**
* Implements the outline page associated with the XML editor.
*/
/**
* Constructor.
*
- * @param editor The associated text editor
+ * @param editor
+ * The associated text editor
*/
public XMLOutlinePage(XMLEditor editor) {
this.editor = editor;
TreeViewer viewer = getTreeViewer();
viewer.setContentProvider(new XMLOutlineContentProvider());
viewer.setLabelProvider(new DecoratingLabelProvider(
- new XMLOutlineLabelProvider(),
- new ProblemsLabelDecorator(editor)));
+ new XMLOutlineLabelProvider(), new ProblemsLabelDecorator(
+ editor)));
viewer.setInput(getDocument());
}
/**
* Selects a specific element in the outline page.
*
- * @param element the element to select
+ * @param element
+ * the element to select
*/
public void select(ISourceReference element) {
TreeViewer viewer = getTreeViewer();
if (viewer != null) {
ISelection selection = viewer.getSelection();
if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection =
- (IStructuredSelection) selection;
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
List elements = structuredSelection.toList();
if (!elements.contains(element)) {
if (element == null) {
// Private Methods ---------------------------------------------------------
/**
- * Returns the parsed model of the XML document that is loaded into the
+ * Returns the parsed model of the XML document that is loaded into the
* associated editor.
*
* @return the parsed XML document