From: incastrix Date: Wed, 8 Oct 2008 18:50:36 +0000 (+0000) Subject: Fix nasty bug #706. See trac. X-Git-Url: http://secure.phpeclipse.com?hp=3705d338f1a2b378f8882f1188d0b0b718063a96 Fix nasty bug #706. See trac. --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java index 6741cba..682852d 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java @@ -13,8 +13,6 @@ package net.sourceforge.phpdt.internal.ui.viewsupport; import java.util.HashMap; import java.util.Map; -import net.sourceforge.phpdt.core.IJavaElement; - import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; @@ -28,7 +26,6 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.ui.IEditorInput; import org.eclipse.ui.texteditor.ITextEditor; /** @@ -131,10 +128,6 @@ public class SelectionListenerWithASTManager { if (fCurrentJob != null) { fCurrentJob.cancel(); } - final IJavaElement input = getJavaElement(); - if (input == null) { - return; - } fCurrentJob = new Job("SelectionListenerWithASTManager Job") {// JavaUIMessages.SelectionListenerWithASTManager_job_title) // { @@ -143,7 +136,7 @@ public class SelectionListenerWithASTManager { monitor = new NullProgressMonitor(); } synchronized (fJobLock) { - return calculateASTandInform(input, selection, monitor); + return calculateASTandInform(/*input,*/ selection, monitor); } } }; @@ -152,16 +145,7 @@ public class SelectionListenerWithASTManager { fCurrentJob.schedule(); } - private IJavaElement getJavaElement() { - IEditorInput editorInput = fPart.getEditorInput(); - if (editorInput != null) - return (IJavaElement) editorInput - .getAdapter(IJavaElement.class); - - return null; - } - - protected IStatus calculateASTandInform(IJavaElement input, + protected IStatus calculateASTandInform(/*IJavaElement input,*/ ITextSelection selection, IProgressMonitor monitor) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS;