From a876a4869be7814f98cee47eaae5621c4c25f66d Mon Sep 17 00:00:00 2001 From: incastrix Date: Wed, 8 Oct 2008 18:50:36 +0000 Subject: [PATCH] Fix nasty bug #706. See trac. --- .../SelectionListenerWithASTManager.java | 20 ++------------------ 1 files changed, 2 insertions(+), 18 deletions(-) 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; -- 1.7.1