1) Fixed issue #858: OpenPHPPerspectiveAction error when creating a new PHP project.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / JavaOutlinePage.java
index f3a1eae..a8c8a0f 100644 (file)
@@ -13,6 +13,7 @@ package net.sourceforge.phpeclipse.phpeditor;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.ResourceBundle;
 import java.util.Vector;
 
 import net.sourceforge.phpdt.core.ElementChangedEvent;
@@ -51,6 +52,7 @@ import net.sourceforge.phpeclipse.PHPeclipsePlugin;
 
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.ListenerList;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuListener;
@@ -60,10 +62,11 @@ import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.Assert;
+//incastrix
+//import org.eclipse.jface.text.Assert;
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.viewers.IBaseLabelProvider;
 import org.eclipse.jface.viewers.IPostSelectionProvider;
@@ -79,8 +82,8 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerFilter;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
+//import org.eclipse.swt.dnd.DND;
+//import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
@@ -101,12 +104,13 @@ import org.eclipse.ui.part.IShowInTarget;
 import org.eclipse.ui.part.IShowInTargetList;
 import org.eclipse.ui.part.Page;
 import org.eclipse.ui.part.ShowInContext;
+import org.eclipse.ui.texteditor.GotoAnnotationAction;
 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.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
+//import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
 
 /**
  * The content outline page of the Java editor. The viewer implements a
@@ -136,8 +140,8 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage,
                        if (d != null) {
                                d.asyncExec(new Runnable() {
                                        public void run() {
-                                               ICompilationUnit cu = (ICompilationUnit) fInput;
-                                               IJavaElement base = cu;
+                                               //ICompilationUnit cu = (ICompilationUnit) fInput;
+                                               //IJavaElement base = cu;
                                                // if (fTopLevelTypeOnly) {
                                                // base= getMainType(cu);
                                                // if (base == null) {
@@ -931,9 +935,11 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage,
                fContextMenuID = contextMenuID;
                fEditor = editor;
                fTogglePresentation = new TogglePresentationAction();
-               fPreviousAnnotation = new GotoAnnotationAction(
-                               "PreviousAnnotation.", false); //$NON-NLS-1$
-               fNextAnnotation = new GotoAnnotationAction("NextAnnotation.", true); //$NON-NLS-1$
+               ResourceBundle bundle = PHPEditorMessages.getResourceBundle();
+               fPreviousAnnotation = new GotoAnnotationAction(bundle,
+                               "PreviousAnnotation.", null, false); //$NON-NLS-1$
+               fNextAnnotation = new GotoAnnotationAction(bundle,
+                               "NextAnnotation.", null, true); //$NON-NLS-1$
                fShowJavadoc = (TextEditorAction) fEditor.getAction("ShowJavaDoc"); //$NON-NLS-1$
                fUndo = fEditor.getAction(ITextEditorActionConstants.UNDO);
                fRedo = fEditor.getAction(ITextEditorActionConstants.REDO);
@@ -1400,9 +1406,9 @@ public class JavaOutlinePage extends Page implements IContentOutlinePage,
        }
 
        private void initDragAndDrop() {
-               int ops = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
-               Transfer[] transfers = new Transfer[] { LocalSelectionTransfer
-                               .getInstance() };
+//             int ops = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+//             Transfer[] transfers = new Transfer[] { LocalSelectionTransfer
+//                             .getInstance() };
 
                // Drop Adapter
                // TransferDropTargetListener[] dropListeners= new