added missing action descriptions
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / JavaOutlinePage.java
index 6a23ef8..c552344 100644 (file)
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
+ * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/cpl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -35,9 +35,6 @@ import net.sourceforge.phpdt.internal.ui.IJavaHelpContextIds;
 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import net.sourceforge.phpdt.internal.ui.actions.AbstractToggleLinkingAction;
 import net.sourceforge.phpdt.internal.ui.actions.CompositeActionGroup;
-import net.sourceforge.phpdt.internal.ui.dnd.JdtViewerDragAdapter;
-import net.sourceforge.phpdt.internal.ui.dnd.TransferDragSourceListener;
-import net.sourceforge.phpdt.internal.ui.packageview.SelectionTransferDragAdapter;
 import net.sourceforge.phpdt.internal.ui.preferences.MembersOrderPreferenceCache;
 import net.sourceforge.phpdt.internal.ui.viewsupport.AppearanceAwareLabelProvider;
 import net.sourceforge.phpdt.internal.ui.viewsupport.DecoratingJavaLabelProvider;
@@ -93,9 +90,10 @@ import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.Widget;
 import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.ActionContext;
+import org.eclipse.ui.actions.ActionFactory;
 import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.help.WorkbenchHelp;
 import org.eclipse.ui.model.IWorkbenchAdapter;
 import org.eclipse.ui.model.WorkbenchAdapter;
 import org.eclipse.ui.part.IPageSite;
@@ -108,10 +106,8 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
 import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
 import org.eclipse.ui.texteditor.IUpdate;
 import org.eclipse.ui.texteditor.TextEditorAction;
-import org.eclipse.ui.texteditor.TextOperationAction;
 import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
 import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-import org.eclipse.ui.views.navigator.RefactorActionGroup;
 
 
 /**
@@ -123,18 +119,18 @@ import org.eclipse.ui.views.navigator.RefactorActionGroup;
 public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdaptable , IPostSelectionProvider {
 
                        static Object[] NO_CHILDREN= new Object[0];
-   
+
                        /**
                         * The element change listener of the java outline viewer.
                         * @see IElementChangedListener
                         */
                        class ElementChangedListener implements IElementChangedListener {
-                               
+
                                public void elementChanged(final ElementChangedEvent e) {
-                                       
+
                                        if (getControl() == null)
                                                return;
-                                               
+
                                        Display d= getControl().getDisplay();
                                        if (d != null) {
                                                d.asyncExec(new Runnable() {
@@ -142,12 +138,12 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                                ICompilationUnit cu= (ICompilationUnit) fInput;
                                                                IJavaElement base= cu;
 //                                                             if (fTopLevelTypeOnly) {
-                                                                       base= getMainType(cu);
-                                                                       if (base == null) {
+//                                                                     base= getMainType(cu);
+//                                                                     if (base == null) {
                                                                                if (fOutlineViewer != null)
                                                                                        fOutlineViewer.refresh(true);
                                                                                return;
-                                                                       }
+//                                                                     }
 //                                                             }
 //                                                             IJavaElementDelta delta= findElement(base, e.getDelta());
 //                                                             if (delta != null && fOutlineViewer != null) {
@@ -157,7 +153,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                });
                                        }
                                }
-                               
+
                                private boolean isPossibleStructuralChange(IJavaElementDelta cuDelta) {
                                        if (cuDelta.getKind() != IJavaElementDelta.CHANGED) {
                                                return true; // add or remove
@@ -168,39 +164,39 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        return (flags & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_FINE_GRAINED)) == IJavaElementDelta.F_CONTENT;
                                }
-                               
+
                                protected IJavaElementDelta findElement(IJavaElement unit, IJavaElementDelta delta) {
-                                       
+
                                        if (delta == null || unit == null)
                                                return null;
-                                       
+
                                        IJavaElement element= delta.getElement();
-                                       
+
                                        if (unit.equals(element)) {
                                                if (isPossibleStructuralChange(delta)) {
                                                        return delta;
                                                }
                                                return null;
                                        }
-                                               
-                                       
+
+
                                        if (element.getElementType() > IJavaElement.CLASS_FILE)
                                                return null;
-                                               
+
                                        IJavaElementDelta[] children= delta.getAffectedChildren();
                                        if (children == null || children.length == 0)
                                                return null;
-                                               
+
                                        for (int i= 0; i < children.length; i++) {
                                                IJavaElementDelta d= findElement(unit, children[i]);
                                                if (d != null)
                                                        return d;
                                        }
-                                       
+
                                        return null;
                                }
                        }
-         
+
                        static class NoClassElement extends WorkbenchAdapter implements IAdaptable {
                                /*
                                 * @see java.lang.Object#toString()
@@ -208,7 +204,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                public String toString() {
                                        return PHPEditorMessages.getString("JavaOutlinePage.error.NoTopLevelType"); //$NON-NLS-1$
                                }
-               
+
                                /*
                                 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class)
                                 */
@@ -218,17 +214,17 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        return null;
                                }
                        }
-                       
+
                        /**
                         * Content provider for the children of an ICompilationUnit or
                         * an IClassFile
                         * @see ITreeContentProvider
                         */
                        class ChildrenProvider implements ITreeContentProvider {
-            
+
                                private Object[] NO_CLASS= new Object[] {new NoClassElement()};
                                private ElementChangedListener fListener;
-                               
+
                                protected boolean matches(IJavaElement element) {
                                        if (element.getElementType() == IJavaElement.METHOD) {
                                                String name= element.getElementName();
@@ -236,7 +232,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        return false;
                                }
-                               
+
                                protected IJavaElement[] filter(IJavaElement[] children) {
                                        boolean initializers= false;
                                        for (int i= 0; i < children.length; i++) {
@@ -245,22 +241,22 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                        break;
                                                }
                                        }
-                                                       
+
                                        if (!initializers)
                                                return children;
-                                               
+
                                        Vector v= new Vector();
                                        for (int i= 0; i < children.length; i++) {
                                                if (matches(children[i]))
                                                        continue;
                                                v.addElement(children[i]);
                                        }
-                                       
+
                                        IJavaElement[] result= new IJavaElement[v.size()];
                                        v.copyInto(result);
                                        return result;
                                }
-                               
+
                                public Object[] getChildren(Object parent) {
                                        if (parent instanceof IParent) {
                                                IParent c= (IParent) parent;
@@ -277,7 +273,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        return NO_CHILDREN;
                                }
-                               
+
                                public Object[] getElements(Object parent) {
                                        if (fTopLevelTypeOnly) {
                                                if (parent instanceof ICompilationUnit) {
@@ -287,19 +283,19 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                        } catch (JavaModelException e) {
                                                                PHPeclipsePlugin.log(e);
                                                        }
-                                               } 
+                                               }
 //                                             else if (parent instanceof IClassFile) {
 //                                                     try {
 //                                                             IType type= getMainType((IClassFile) parent);
 //                                                             return type != null ? type.getChildren() : NO_CLASS;
 //                                                     } catch (JavaModelException e) {
 //                                                             PHPeclipsePlugin.log(e);
-//                                                     }                                                       
+//                                                     }
 //                                             }
                                        }
                                        return getChildren(parent);
                                }
-                               
+
                                public Object getParent(Object child) {
                                        if (child instanceof IJavaElement) {
                                                IJavaElement e= (IJavaElement) child;
@@ -307,7 +303,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        return null;
                                }
-                               
+
                                public boolean hasChildren(Object parent) {
                                        if (parent instanceof IParent) {
                                                IParent c= (IParent) parent;
@@ -325,24 +321,24 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        return false;
                                }
-                               
+
                                public boolean isDeleted(Object o) {
                                        return false;
                                }
-                               
+
                                public void dispose() {
                                        if (fListener != null) {
                                                JavaCore.removeElementChangedListener(fListener);
                                                fListener= null;
-                                       }               
+                                       }
                                }
-                               
+
                                /*
                                 * @see IContentProvider#inputChanged(Viewer, Object, Object)
                                 */
                                public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
                                        boolean isCU= (newInput instanceof ICompilationUnit);
-                                                                       
+
                                        if (isCU && fListener == null) {
                                                fListener= new ElementChangedListener();
                                                JavaCore.addElementChangedListener(fListener);
@@ -352,10 +348,10 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                }
                        }
-                       
-                       
+
+
                        class JavaOutlineViewer extends TreeViewer {
-                               
+
                                /**
                                 * Indicates an item which has been reused. At the point of
                                 * its reuse it has been expanded. This field is used to
@@ -365,17 +361,17 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                private Item fReusedExpandedItem;
                                private boolean fReorderedMembers;
                                private boolean fForceFireSelectionChanged;
-                               
+
                                public JavaOutlineViewer(Tree tree) {
                                        super(tree);
                                        setAutoExpandLevel(ALL_LEVELS);
                                        setUseHashlookup(true);
                                }
-                               
+
                                /**
                                 * Investigates the given element change event and if affected
                                 * incrementally updates the Java outline.
-                                * 
+                                *
                                 * @param delta the Java element delta used to reconcile the Java outline
                                 */
                                public void reconcile(IJavaElementDelta delta) {
@@ -404,7 +400,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                refresh(true);
                                        }
                                }
-                               
+
                                /*
                                 * @see TreeViewer#internalExpandToLevel
                                 */
@@ -423,31 +419,31 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        super.internalExpandToLevel(node, level);
                                }
-                                                               
+
                                protected void reuseTreeItem(Item item, Object element) {
-                                       
+
                                        // remove children
                                        Item[] c= getChildren(item);
                                        if (c != null && c.length > 0) {
-                                               
+
                                                if (getExpanded(item))
                                                        fReusedExpandedItem= item;
-                                               
+
                                                for (int k= 0; k < c.length; k++) {
                                                        if (c[k].getData() != null)
                                                                disassociate(c[k]);
                                                        c[k].dispose();
                                                }
                                        }
-                                       
+
                                        updateItem(item, element);
                                        updatePlus(item, element);
                                        internalExpandToLevel(item, ALL_LEVELS);
-                                       
+
                                        fReusedExpandedItem= null;
                                        fForceFireSelectionChanged= true;
                                }
-                               
+
                                protected boolean mustUpdateParent(IJavaElementDelta delta, IJavaElement element) {
                                        if (element instanceof IMethod) {
                                                if ((delta.getKind() & IJavaElementDelta.ADDED) != 0) {
@@ -461,7 +457,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        return false;
                                }
-                               
+
                                /*
                                 * @see org.eclipse.jface.viewers.AbstractTreeViewer#isExpandable(java.lang.Object)
                                 */
@@ -471,7 +467,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        return super.isExpandable(element);
                                }
-                               
+
                                protected ISourceRange getSourceRange(IJavaElement element) throws JavaModelException {
                                        if (element instanceof ISourceReference)
                                                return ((ISourceReference) element).getSourceRange();
@@ -479,13 +475,13 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                return ((IMember) element).getNameRange();
                                        return null;
                                }
-                               
+
                                protected boolean overlaps(ISourceRange range, int start, int end) {
                                        return start <= (range.getOffset() + range.getLength() - 1) && range.getOffset() <= end;
                                }
-                               
+
                                protected boolean filtered(IJavaElement parent, IJavaElement child) {
-                                       
+
                                        Object[] result= new Object[] { child };
                                        ViewerFilter[] filters= getFilters();
                                        for (int i= 0; i < filters.length; i++) {
@@ -493,23 +489,23 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                if (result.length == 0)
                                                        return true;
                                        }
-                                       
+
                                        return false;
                                }
-                               
+
                                protected void update(Widget w, IJavaElementDelta delta) {
-                                       
+
                                        Item item;
-                                       
+
                                        IJavaElement parent= delta.getElement();
                                        IJavaElementDelta[] affected= delta.getAffectedChildren();
                                        Item[] children= getChildren(w);
 
                                        boolean doUpdateParent= false;
                                        boolean doUpdateParentsPlus= false;
-                                                                               
+
                                        Vector deletions= new Vector();
-                                       Vector additions= new Vector();                         
+                                       Vector additions= new Vector();
 
                                        for (int i= 0; i < affected.length; i++) {
                                            IJavaElementDelta affectedDelta= affected[i];
@@ -521,15 +517,15 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                for (j= 0; j < children.length; j++)
                                                    if (affectedElement.equals(children[j].getData()))
                                                        break;
-                                               
+
                                                if (j == children.length) {
                                                        // remove from collapsed parent
                                                        if ((status & IJavaElementDelta.REMOVED) != 0) {
                                                                doUpdateParentsPlus= true;
                                                                continue;
-                                                       }                                                       
+                                                       }
                                                        // addition
-                                                       if ((status & IJavaElementDelta.CHANGED) != 0 &&                                                        
+                                                       if ((status & IJavaElementDelta.CHANGED) != 0 &&
                                                                (affectedDelta.getFlags() & IJavaElementDelta.F_MODIFIERS) != 0 &&
                                                                !filtered(parent, affectedElement))
                                                        {
@@ -540,34 +536,34 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
 
                                                item= children[j];
 
-                                               // removed                                                  
+                                               // removed
                                                if ((status & IJavaElementDelta.REMOVED) != 0) {
                                                        deletions.addElement(item);
                                                        doUpdateParent= doUpdateParent || mustUpdateParent(affectedDelta, affectedElement);
 
-                                               // changed                                                  
+                                               // changed
                                                } else if ((status & IJavaElementDelta.CHANGED) != 0) {
                                                        int change= affectedDelta.getFlags();
                                                        doUpdateParent= doUpdateParent || mustUpdateParent(affectedDelta, affectedElement);
-                                                       
+
                                                        if ((change & IJavaElementDelta.F_MODIFIERS) != 0) {
                                                                if (filtered(parent, affectedElement))
                                                                        deletions.addElement(item);
                                                                else
                                                                        updateItem(item, affectedElement);
                                                        }
-                                                       
+
                                                        if ((change & IJavaElementDelta.F_CONTENT) != 0)
                                                                updateItem(item, affectedElement);
-                                                               
+
                                                        if ((change & IJavaElementDelta.F_CHILDREN) != 0)
-                                                               update(item, affectedDelta);                                                                                                                        
-                                                       
+                                                               update(item, affectedDelta);
+
                                                        if ((change & IJavaElementDelta.F_REORDER) != 0)
                                                                fReorderedMembers= true;
                                                }
                                        }
-                                       
+
                                        // find all elements to add
                                        IJavaElementDelta[] add= delta.getAddedChildren();
                                        if (additions.size() > 0) {
@@ -577,16 +573,16 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                        tmp[i + add.length]= (IJavaElementDelta) additions.elementAt(i);
                                                add= tmp;
                                        }
-                                       
+
                                        // add at the right position
                                        go2: for (int i= 0; i < add.length; i++) {
-                                               
+
                                                try {
-                                                       
+
                                                        IJavaElement e= add[i].getElement();
                                                        if (filtered(parent, e))
                                                                continue go2;
-                                                               
+
                                                        doUpdateParent= doUpdateParent || mustUpdateParent(add[i], e);
                                                        ISourceRange rng= getSourceRange(e);
                                                        int start= rng.getOffset();
@@ -597,32 +593,32 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                                if (nameRange != null)
                                                                        nameOffset= nameRange.getOffset();
                                                        }
-                                                       
+
                                                        Item last= null;
                                                        item= null;
                                                        children= getChildren(w);
-                                                       
+
                                                        for (int j= 0; j < children.length; j++) {
                                                                item= children[j];
                                                                IJavaElement r= (IJavaElement) item.getData();
-                                                               
+
                                                                if (r == null) {
                                                                        // parent node collapsed and not be opened before -> do nothing
                                                                        continue go2;
                                                                }
-                                                               
-                                                                       
+
+
                                                                try {
                                                                        rng= getSourceRange(r);
 
-                                                                       // multi-field declarations always start at 
+                                                                       // multi-field declarations always start at
                                                                        // the same offset. They also have the same
                                                                        // end offset if the field sequence is terminated
                                                                        // with a semicolon. If not, the source range
                                                                        // ends behind the identifier / initializer
                                                                        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=51851
-                                                                       boolean multiFieldDeclaration= 
-                                                                               r.getElementType() == IJavaElement.FIELD 
+                                                                       boolean multiFieldDeclaration=
+                                                                               r.getElementType() == IJavaElement.FIELD
                                                                                        && e.getElementType() == IJavaElement.FIELD
                                                                                        && rng.getOffset() == start;
 
@@ -640,16 +636,16 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                                                        }
                                                                                }
                                                                        }
-                                                                       
+
                                                                        if (!multiFieldDeclaration && overlaps(rng, start, end)) {
-                                                                               
-                                                                               // be tolerant if the delta is not correct, or if 
+
+                                                                               // be tolerant if the delta is not correct, or if
                                                                                // the tree has been updated other than by a delta
                                                                                reuseTreeItem(item, e);
                                                                                continue go2;
-                                                                               
+
                                                                        } else if (multiFieldOrderBefore || rng.getOffset() > start) {
-                                                                               
+
                                                                                if (last != null && deletions.contains(last)) {
                                                                                        // reuse item
                                                                                        deletions.removeElement(last);
@@ -660,14 +656,14 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                                                }
                                                                                continue go2;
                                                                        }
-                                                                       
+
                                                                } catch (JavaModelException x) {
                                                                        // stumbled over deleted element
                                                                }
-                                                               
+
                                                                last= item;
                                                        }
-                                               
+
                                                        // add at the end of the list
                                                        if (last != null && deletions.contains(last)) {
                                                                // reuse item
@@ -677,13 +673,13 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                                // nothing to reuse
                                                                createTreeItem(w, e, -1);
                                                        }
-                                               
+
                                                } catch (JavaModelException x) {
                                                        // the element to be added is not present -> don't add it
                                                }
                                        }
-                                       
-                                       
+
+
                                        // remove items which haven't been reused
                                        Enumeration e= deletions.elements();
                                        while (e.hasMoreElements()) {
@@ -691,15 +687,15 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                                disassociate(item);
                                                item.dispose();
                                        }
-                                       
+
                                        if (doUpdateParent)
                                                updateItem(w, delta.getElement());
                                        if (!doUpdateParent && doUpdateParentsPlus && w instanceof Item)
                                                updatePlus((Item)w, delta.getElement());
                                }
-                               
 
-                                                               
+
+
                                /*
                                 * @see ContentViewer#handleLabelProviderChanged(LabelProviderChangedEvent)
                                 */
@@ -727,43 +723,43 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                        }
                                        super.handleLabelProviderChanged(event);
                                }
-                               
+
                                private IResource getUnderlyingResource() {
                                        Object input= getInput();
                                        if (input instanceof ICompilationUnit) {
                                                ICompilationUnit cu= (ICompilationUnit) input;
                                                cu= JavaModelUtil.toOriginal(cu);
-                                               return cu.getResource();                
-                                       } 
+                                               return cu.getResource();
+                                       }
 //                                     else if (input instanceof IClassFile) {
 //                                             return ((IClassFile) input).getResource();
 //                                     }
                                        return null;
-                               }                               
-                               
+                               }
+
 
                        }
-                               
+
                        class LexicalSortingAction extends Action {
-                               
-                               private JavaElementSorter fSorter= new JavaElementSorter();                     
+
+                               private JavaElementSorter fSorter= new JavaElementSorter();
 
                                public LexicalSortingAction() {
                                        super();
-                                       WorkbenchHelp.setHelp(this, IJavaHelpContextIds.LEXICAL_SORTING_OUTLINE_ACTION);
+                                       PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.LEXICAL_SORTING_OUTLINE_ACTION);
                                        setText(PHPEditorMessages.getString("JavaOutlinePage.Sort.label")); //$NON-NLS-1$
                                        PHPUiImages.setLocalImageDescriptors(this, "alphab_sort_co.gif"); //$NON-NLS-1$
                                        setToolTipText(PHPEditorMessages.getString("JavaOutlinePage.Sort.tooltip")); //$NON-NLS-1$
                                        setDescription(PHPEditorMessages.getString("JavaOutlinePage.Sort.description")); //$NON-NLS-1$
-                                       
+
                                        boolean checked= PHPeclipsePlugin.getDefault().getPreferenceStore().getBoolean("LexicalSortingAction.isChecked"); //$NON-NLS-1$
                                        valueChanged(checked, false);
                                }
-                               
+
                                public void run() {
                                        valueChanged(isChecked(), true);
                                }
-                               
+
                                private void valueChanged(final boolean on, boolean store) {
                                        setChecked(on);
                                        BusyIndicator.showWhile(fOutlineViewer.getControl().getDisplay(), new Runnable() {
@@ -780,7 +776,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
 
                        public ClassOnlyAction() {
                                super();
-                               WorkbenchHelp.setHelp(this, IJavaHelpContextIds.GO_INTO_TOP_LEVEL_TYPE_ACTION);
+                               PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.GO_INTO_TOP_LEVEL_TYPE_ACTION);
                                setText(PHPEditorMessages.getString("JavaOutlinePage.GoIntoTopLevelType.label")); //$NON-NLS-1$
                                setToolTipText(PHPEditorMessages.getString("JavaOutlinePage.GoIntoTopLevelType.tooltip")); //$NON-NLS-1$
                                setDescription(PHPEditorMessages.getString("JavaOutlinePage.GoIntoTopLevelType.description")); //$NON-NLS-1$
@@ -802,8 +798,8 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                fTopLevelTypeOnly= show;
                                setChecked(show);
                                fOutlineViewer.refresh(false);
-                               
-                               IPreferenceStore preferenceStore= PHPeclipsePlugin.getDefault().getPreferenceStore(); 
+
+                               IPreferenceStore preferenceStore= PHPeclipsePlugin.getDefault().getPreferenceStore();
                                preferenceStore.setValue("GoIntoTopLevelTypeAction.isChecked", show); //$NON-NLS-1$
                        }
                }
@@ -811,16 +807,16 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                /**
                 * This action toggles whether this Java Outline page links
                 * its selection to the active editor.
-                * 
+                *
                 * @since 3.0
                 */
                public class ToggleLinkingAction extends AbstractToggleLinkingAction {
-               
+
                        JavaOutlinePage fJavaOutlinePage;
-               
+
                        /**
                         * Constructs a new action.
-                        * 
+                        *
                         * @param outlinePage the Java outline page
                         */
                        public ToggleLinkingAction(JavaOutlinePage outlinePage) {
@@ -828,7 +824,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                setChecked(isLinkingEnabled);
                                fJavaOutlinePage= outlinePage;
                        }
-       
+
                        /**
                         * Runs the action.
                         */
@@ -837,34 +833,34 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                if (isChecked() && fEditor != null)
                                        fEditor.synchronizeOutlinePage(fEditor.computeHighlightRangeSourceReference(), false);
                        }
-       
+
                }
 
 
        /** A flag to show contents of top level type only */
        private boolean fTopLevelTypeOnly;
-                       
+
        private IJavaElement fInput;
        private String fContextMenuID;
        private Menu fMenu;
        private JavaOutlineViewer fOutlineViewer;
        private PHPEditor fEditor;
-       
+
        private MemberFilterActionGroup fMemberFilterActionGroup;
-               
+
        private ListenerList fSelectionChangedListeners= new ListenerList();
        private ListenerList fPostSelectionChangedListeners= new ListenerList();
        private Hashtable fActions= new Hashtable();
-       
+
        private TogglePresentationAction fTogglePresentation;
        private GotoAnnotationAction fPreviousAnnotation;
        private GotoAnnotationAction fNextAnnotation;
        private TextEditorAction fShowJavadoc;
-       private TextOperationAction fUndo;
-       private TextOperationAction fRedo;
-       
+       private IAction fUndo;
+       private IAction fRedo;
+
        private ToggleLinkingAction fToggleLinkingAction;
-       
+
        private CompositeActionGroup fActionGroups;
 
        private IPropertyChangeListener fPropertyChangeListener;
@@ -873,26 +869,25 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
         * @since 3.0
         */
        private CustomFiltersActionGroup fCustomFiltersActionGroup;
-       
+
        public JavaOutlinePage(String contextMenuID, PHPEditor editor) {
                super();
-               
+
                Assert.isNotNull(editor);
-               
+
                fContextMenuID= contextMenuID;
                fEditor= editor;
-               
                fTogglePresentation= new TogglePresentationAction();
                fPreviousAnnotation= new GotoAnnotationAction("PreviousAnnotation.", false); //$NON-NLS-1$
                fNextAnnotation= new GotoAnnotationAction("NextAnnotation.", true); //$NON-NLS-1$
                fShowJavadoc= (TextEditorAction) fEditor.getAction("ShowJavaDoc"); //$NON-NLS-1$
-               fUndo= (TextOperationAction) fEditor.getAction(ITextEditorActionConstants.UNDO);
-               fRedo= (TextOperationAction) fEditor.getAction(ITextEditorActionConstants.REDO);
-               
+               fUndo= fEditor.getAction(ITextEditorActionConstants.UNDO);
+               fRedo= fEditor.getAction(ITextEditorActionConstants.REDO);
+
                fTogglePresentation.setEditor(editor);
                fPreviousAnnotation.setEditor(editor);
-               fNextAnnotation.setEditor(editor);      
-               
+               fNextAnnotation.setEditor(editor);
+
                fPropertyChangeListener= new IPropertyChangeListener() {
                        public void propertyChange(PropertyChangeEvent event) {
                                doPropertyChange(event);
@@ -900,20 +895,20 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                };
                PHPeclipsePlugin.getDefault().getPreferenceStore().addPropertyChangeListener(fPropertyChangeListener);
        }
-   
+
        /**
         * Returns the primary type of a compilation unit (has the same
         * name as the compilation unit).
-        * 
+        *
         * @param compilationUnit the compilation unit
         * @return returns the primary type of the compilation unit, or
         * <code>null</code> if is does not have one
         */
        protected IType getMainType(ICompilationUnit compilationUnit) {
-               
+
                if (compilationUnit == null)
                        return null;
-               
+
                String name= compilationUnit.getElementName();
                int index= name.indexOf('.');
                if (index != -1)
@@ -924,7 +919,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
 
        /**
         * Returns the primary type of a class file.
-        * 
+        *
         * @param classFile the class file
         * @return returns the primary type of the class file, or <code>null</code>
         * if is does not have one
@@ -934,25 +929,25 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
 //                     IType type= classFile.getType();
 //                     return type != null && type.exists() ? type : null;
 //             } catch (JavaModelException e) {
-//                     return null;    
+//                     return null;
 //             }
 //     }
-       
+
        /* (non-Javadoc)
         * Method declared on Page
         */
        public void init(IPageSite pageSite) {
                super.init(pageSite);
        }
-       
+
        private void doPropertyChange(PropertyChangeEvent event) {
                if (fOutlineViewer != null) {
                        if (MembersOrderPreferenceCache.isMemberOrderProperty(event.getProperty())) {
                                fOutlineViewer.refresh(false);
                        }
                }
-       }       
-       
+       }
+
        /*
         * @see ISelectionProvider#addSelectionChangedListener(ISelectionChangedListener)
         */
@@ -962,7 +957,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                else
                        fSelectionChangedListeners.add(listener);
        }
-       
+
        /*
         * @see ISelectionProvider#removeSelectionChangedListener(ISelectionChangedListener)
         */
@@ -972,15 +967,15 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                else
                        fSelectionChangedListeners.remove(listener);
        }
-       
+
        /*
         * @see ISelectionProvider#setSelection(ISelection)
         */
        public void setSelection(ISelection selection) {
                if (fOutlineViewer != null)
-                       fOutlineViewer.setSelection(selection);         
-       }       
-       
+                       fOutlineViewer.setSelection(selection);
+       }
+
        /*
         * @see ISelectionProvider#getSelection()
         */
@@ -989,7 +984,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                        return StructuredSelection.EMPTY;
                return fOutlineViewer.getSelection();
        }
-       
+
        /*
         * @see org.eclipse.jface.text.IPostSelectionProvider#addPostSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
         */
@@ -999,7 +994,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                else
                        fPostSelectionChangedListeners.add(listener);
        }
-       
+
        /*
         * @see org.eclipse.jface.text.IPostSelectionProvider#removePostSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
         */
@@ -1007,34 +1002,34 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                if (fOutlineViewer != null)
                        fOutlineViewer.removePostSelectionChangedListener(listener);
                else
-                       fPostSelectionChangedListeners.remove(listener);        
+                       fPostSelectionChangedListeners.remove(listener);
        }
-       
+
        private void registerToolbarActions(IActionBars actionBars) {
-               
+
                IToolBarManager toolBarManager= actionBars.getToolBarManager();
-               if (toolBarManager != null) {   
+               if (toolBarManager != null) {
                        toolBarManager.add(new LexicalSortingAction());
-                       
+
                        fMemberFilterActionGroup= new MemberFilterActionGroup(fOutlineViewer, "net.sourceforge.phpeclipse.JavaOutlinePage"); //$NON-NLS-1$
                        fMemberFilterActionGroup.contributeToToolBar(toolBarManager);
 
                        fCustomFiltersActionGroup.fillActionBars(actionBars);
-                       
+
                        IMenuManager menu= actionBars.getMenuManager();
                        menu.add(new Separator("EndFilterGroup")); //$NON-NLS-1$
-                       
+
                        fToggleLinkingAction= new ToggleLinkingAction(this);
-                       menu.add(new ClassOnlyAction());                
+                       menu.add(new ClassOnlyAction());
                        menu.add(fToggleLinkingAction);
                }
        }
-       
+
        /*
         * @see IPage#createControl
         */
        public void createControl(Composite parent) {
-               
+
                Tree tree= new Tree(parent, SWT.MULTI);
 
                AppearanceAwareLabelProvider lprovider= new AppearanceAwareLabelProvider(
@@ -1042,23 +1037,23 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                        AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS
                );
 
-               fOutlineViewer= new JavaOutlineViewer(tree);            
+               fOutlineViewer= new JavaOutlineViewer(tree);
                initDragAndDrop();
                fOutlineViewer.setContentProvider(new ChildrenProvider());
                fOutlineViewer.setLabelProvider(new DecoratingJavaLabelProvider(lprovider));
-               
+
                Object[] listeners= fSelectionChangedListeners.getListeners();
                for (int i= 0; i < listeners.length; i++) {
                        fSelectionChangedListeners.remove(listeners[i]);
                        fOutlineViewer.addSelectionChangedListener((ISelectionChangedListener) listeners[i]);
                }
-               
+
                listeners= fPostSelectionChangedListeners.getListeners();
                for (int i= 0; i < listeners.length; i++) {
                        fPostSelectionChangedListeners.remove(listeners[i]);
                        fOutlineViewer.addPostSelectionChangedListener((ISelectionChangedListener) listeners[i]);
                }
-                                               
+
                MenuManager manager= new MenuManager(fContextMenuID, fContextMenuID);
                manager.setRemoveAllWhenShown(true);
                manager.addMenuListener(new IMenuListener() {
@@ -1068,32 +1063,32 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                });
                fMenu= manager.createContextMenu(tree);
                tree.setMenu(fMenu);
-               
+
                IPageSite site= getSite();
                site.registerContextMenu(PHPeclipsePlugin.getPluginId() + ".outline", manager, fOutlineViewer); //$NON-NLS-1$
                site.setSelectionProvider(fOutlineViewer);
 
                // we must create the groups after we have set the selection provider to the site
                fActionGroups= new CompositeActionGroup(new ActionGroup[] {
-//                             new OpenViewActionGroup(this), 
+//                             new OpenViewActionGroup(this),
 //                             new CCPActionGroup(this),
                                new GenerateActionGroup(this)});
-//                             new RefactorActionGroup(this), 
+//                             new RefactorActionGroup(this),
 //                             new JavaSearchActionGroup(this)});
-                               
+
                // register global actions
                IActionBars bars= site.getActionBars();
-               
+
                bars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, fUndo);
                bars.setGlobalActionHandler(ITextEditorActionConstants.REDO, fRedo);
-               bars.setGlobalActionHandler(ITextEditorActionConstants.PREVIOUS, fPreviousAnnotation);
-               bars.setGlobalActionHandler(ITextEditorActionConstants.NEXT, fNextAnnotation);
+               bars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), fPreviousAnnotation);
+               bars.setGlobalActionHandler(ActionFactory.NEXT.getId(), fNextAnnotation);
                bars.setGlobalActionHandler(PHPdtActionConstants.SHOW_JAVA_DOC, fShowJavadoc);
                bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY, fTogglePresentation);
                bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, fNextAnnotation);
                bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, fPreviousAnnotation);
-               
-               
+
+
                fActionGroups.fillActionBars(bars);
 
                IStatusLineManager statusLineManager= bars.getStatusLineManager();
@@ -1105,32 +1100,32 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                fCustomFiltersActionGroup= new CustomFiltersActionGroup("net.sourceforge.phpdt.ui.JavaOutlinePage", fOutlineViewer); //$NON-NLS-1$
 
                registerToolbarActions(bars);
-                               
-               fOutlineViewer.setInput(fInput);        
+
+               fOutlineViewer.setInput(fInput);
        }
 
        public void dispose() {
-               
+
                if (fEditor == null)
                        return;
-                       
+
                if (fMemberFilterActionGroup != null) {
                        fMemberFilterActionGroup.dispose();
                        fMemberFilterActionGroup= null;
                }
-               
+
                if (fCustomFiltersActionGroup != null) {
                        fCustomFiltersActionGroup.dispose();
                        fCustomFiltersActionGroup= null;
                }
-                       
-                       
+
+
                fEditor.outlinePageClosed();
                fEditor= null;
 
                fSelectionChangedListeners.clear();
                fSelectionChangedListeners= null;
-               
+
                fPostSelectionChangedListeners.clear();
                fPostSelectionChangedListeners= null;
 
@@ -1138,39 +1133,39 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                        PHPeclipsePlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPropertyChangeListener);
                        fPropertyChangeListener= null;
                }
-               
+
                if (fMenu != null && !fMenu.isDisposed()) {
                        fMenu.dispose();
                        fMenu= null;
                }
-               
+
                if (fActionGroups != null)
                        fActionGroups.dispose();
-                       
+
                fTogglePresentation.setEditor(null);
                fPreviousAnnotation.setEditor(null);
-               fNextAnnotation.setEditor(null);        
-               
+               fNextAnnotation.setEditor(null);
+
                fOutlineViewer= null;
-               
+
                super.dispose();
        }
-       
+
        public Control getControl() {
                if (fOutlineViewer != null)
                        return fOutlineViewer.getControl();
                return null;
        }
-       
+
        public void setInput(IJavaElement inputElement) {
-               fInput= inputElement;   
+               fInput= inputElement;
                if (fOutlineViewer != null)
                        fOutlineViewer.setInput(fInput);
        }
-               
+
        public void select(ISourceReference reference) {
                if (fOutlineViewer != null) {
-                       
+
                        ISelection s= fOutlineViewer.getSelection();
                        if (s instanceof IStructuredSelection) {
                                IStructuredSelection ss= (IStructuredSelection) s;
@@ -1182,7 +1177,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                        }
                }
        }
-       
+
        public void setAction(String actionID, IAction action) {
                Assert.isNotNull(actionID);
                if (action == null)
@@ -1190,7 +1185,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                else
                        fActions.put(actionID, action);
        }
-       
+
        public IAction getAction(String actionID) {
                Assert.isNotNull(actionID);
                return (IAction) fActions.get(actionID);
@@ -1221,7 +1216,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
        /**
         * Convenience method to add the action installed under the given actionID to the
         * specified group of the menu.
-        * 
+        *
         * @param menu          the menu manager
         * @param group         the group to which to add the action
         * @param actionID      the ID of the new action
@@ -1231,7 +1226,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                if (action != null) {
                        if (action instanceof IUpdate)
                                ((IUpdate) action).update();
-                               
+
                        if (action.isEnabled()) {
                                IMenuManager subMenu= menu.findMenuUsingPath(group);
                                if (subMenu != null)
@@ -1241,16 +1236,16 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                        }
                }
        }
-        
+
        protected void contextMenuAboutToShow(IMenuManager menu) {
-               
+
                PHPeclipsePlugin.createStandardGroups(menu);
-                               
+
                IStructuredSelection selection= (IStructuredSelection)getSelection();
                fActionGroups.setContext(new ActionContext(selection));
                fActionGroups.fillContextMenu(menu);
        }
-       
+
        /*
         * @see Page#setFocus()
         */
@@ -1258,15 +1253,15 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                if (fOutlineViewer != null)
                        fOutlineViewer.getControl().setFocus();
        }
-       
+
        /**
         * Checks whether a given Java element is an inner type.
-        * 
+        *
         * @param element the java element
         * @return <code>true</code> iff the given element is an inner type
         */
        private boolean isInnerType(IJavaElement element) {
-               
+
                if (element != null && element.getElementType() == IJavaElement.TYPE) {
                        IType type= (IType)element;
                        try {
@@ -1279,13 +1274,13 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                                }
                        }
                }
-               
-               return false;           
+
+               return false;
        }
-       
+
        /**
         * Returns the <code>IShowInSource</code> for this view.
-        * 
+        *
         * @return the {@link IShowInSource}
         */
        protected IShowInSource getShowInSource() {
@@ -1300,7 +1295,7 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
 
        /**
         * Returns the <code>IShowInTarget</code> for this view.
-        * 
+        *
         * @return the {@link IShowInTarget}
         */
        protected IShowInTarget getShowInTarget() {
@@ -1320,23 +1315,23 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage, IAdapt
                        }
                };
        }
-       
+
        private void initDragAndDrop() {
                int ops= DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
                Transfer[] transfers= new Transfer[] {
                        LocalSelectionTransfer.getInstance()
                        };
-               
+
                // Drop Adapter
 //             TransferDropTargetListener[] dropListeners= new TransferDropTargetListener[] {
 //                     new SelectionTransferDropAdapter(fOutlineViewer)
 //             };
 //             fOutlineViewer.addDropSupport(ops | DND.DROP_DEFAULT, transfers, new DelegatingDropAdapter(dropListeners));
-               
+
                // Drag Adapter
-               TransferDragSourceListener[] dragListeners= new TransferDragSourceListener[] {
-                       new SelectionTransferDragAdapter(fOutlineViewer)
-               };
-               fOutlineViewer.addDragSupport(ops, transfers, new JdtViewerDragAdapter(fOutlineViewer, dragListeners));
+//             TransferDragSourceListener[] dragListeners= new TransferDragSourceListener[] {
+//                     new SelectionTransferDragAdapter(fOutlineViewer)
+//             };
+//             fOutlineViewer.addDragSupport(ops, transfers, new JdtViewerDragAdapter(fOutlineViewer, dragListeners));
        }
 }