diff options
17 files changed, 60 insertions, 142 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java index 8318040dd7..b517b45aa2 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java @@ -79,7 +79,7 @@ public class JSPDocumentLoader extends AbstractDocumentLoader { super(); } - protected void addNestablePrefix(JSPSourceParser parser, String tagName) { + private void addNestablePrefix(JSPSourceParser parser, String tagName) { TagMarker bm = new TagMarker(tagName); parser.addNestablePrefix(bm); } diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IELHandler.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IELHandler.java deleted file mode 100644 index 963be03c83..0000000000 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/IELHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.jst.jsp.core.internal.java; - -import java.util.ArrayList; -import java.util.HashMap; - -import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion; - -public interface IELHandler { - - public ArrayList translateEL(String elText, - String delim, - IStructuredDocumentRegion currentNode, - int contentStart, - int contentLength, - StringBuffer fUserELExpressions, - HashMap fUserELRanges, - JSPTranslator translator); -} diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPELHandler.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPELHandler.java deleted file mode 100644 index 2ba2434f32..0000000000 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPELHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.jst.jsp.core.internal.java; - -import java.util.ArrayList; -import java.util.HashMap; - -import org.eclipse.jface.text.Position; -import org.eclipse.jst.jsp.core.internal.JSPCoreMessages; -import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression; -import org.eclipse.jst.jsp.core.internal.java.jspel.ELGenerator; -import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser; -import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException; -import org.eclipse.jst.jsp.core.internal.java.jspel.Token; -import org.eclipse.jst.jsp.core.internal.java.jspel.TokenMgrError; -import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion; - -public class JSPELHandler implements IELHandler { - /** - * JSP Expression Language Parser. - */ - private JSPELParser elParser = null; - - private static JSPELHandler handlerInstance = null; - - private JSPELHandler() { - - } - - synchronized public static JSPELHandler getJSPELHandler() { - if(handlerInstance == null) - handlerInstance = new JSPELHandler(); - - return handlerInstance; - } - - public ArrayList translateEL(String elText, String delim, - IStructuredDocumentRegion currentNode, int contentStart, - int contentLength, StringBuffer fUserELExpressions, - HashMap fUserELRanges, JSPTranslator translator) { - - ArrayList elProblems = new ArrayList(); - - try { - synchronized(this) { - if(null == elParser) { - elParser = JSPELParser.createParser(elText); - } else { - elParser.ReInit(elText); - } - - ASTExpression expression = elParser.Expression(); - ELGenerator gen = new ELGenerator(); - gen.generate(expression, fUserELExpressions, fUserELRanges, translator, currentNode, contentStart, contentLength); - } - } catch (ParseException e) { - Token curTok = e.currentToken; - int problemStartOffset; - int problemEndOffset; - Position pos = null; - problemStartOffset = contentStart + curTok.beginColumn; - problemEndOffset = contentStart + curTok.endColumn; - - pos = new Position(problemStartOffset, problemEndOffset - problemStartOffset + 1); - elProblems.add(new ELProblem(pos, e.getLocalizedMessage())); - } catch (TokenMgrError te) { - Position pos = new Position(contentStart, contentLength); - elProblems.add(new ELProblem(pos, JSPCoreMessages.JSPEL_Token)); - } - return elProblems; - } - -} diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java index 90e4ca45c6..2a2b50213f 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java @@ -122,12 +122,12 @@ public class JSPTranslationAdapter implements INodeAdapter, IDocumentListener { * * @return a JSPTranslationExtension */ - public synchronized JSPTranslationExtension getJSPTranslation(IELHandler handler) { + public synchronized JSPTranslationExtension getJSPTranslation() { if (fJSPTranslation == null || fDocumentIsDirty) { JSPTranslator translator = null; if (getXMLModel() != null && getXMLModel().getIndexedRegion(0) != null) { - translator = getTranslator((IDOMNode) getXMLModel().getIndexedRegion(0), handler); + translator = getTranslator((IDOMNode) getXMLModel().getIndexedRegion(0)); translator.translate(); StringBuffer javaContents = translator.getTranslation(); fJavaDocument = new Document(javaContents.toString()); @@ -161,14 +161,14 @@ public class JSPTranslationAdapter implements INodeAdapter, IDocumentListener { * the first node of the JSP document to be translated * @return the JSPTranslator for this adapter (creates if null) */ - private JSPTranslator getTranslator(IDOMNode xmlNode, IELHandler handler) { + private JSPTranslator getTranslator(IDOMNode xmlNode) { if (fTranslator == null) { fTranslationMonitor = new NullProgressMonitor(); fTranslator = new JSPTranslator(); - fTranslator.reset(xmlNode, fTranslationMonitor, handler); + fTranslator.reset(xmlNode, fTranslationMonitor); } else - fTranslator.reset(xmlNode, fTranslationMonitor, handler); + fTranslator.reset(xmlNode, fTranslationMonitor); return fTranslator; } diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java index ae4c2210cb..d652586524 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java @@ -29,11 +29,9 @@ import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; public class JSPTranslationUtil { protected IDocument fDocument = null; protected JSPTranslationExtension fTranslation = null; - protected IELHandler fELHandler; - public JSPTranslationUtil(IDocument document, IELHandler handler) { + public JSPTranslationUtil(IDocument document) { fDocument = document; - fELHandler = handler; } public TextEdit translateTextEdit(TextEdit textEdit) { @@ -103,7 +101,7 @@ public class JSPTranslationUtil { JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class); if (translationAdapter != null) - fTranslation = translationAdapter.getJSPTranslation(fELHandler); + fTranslation = translationAdapter.getJSPTranslation(); } finally { if (xmlModel != null) { diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java index 2e68391bc7..685e121883 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java @@ -31,10 +31,17 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.Position; +import org.eclipse.jst.jsp.core.internal.JSPCoreMessages; import org.eclipse.jst.jsp.core.internal.Logger; import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController; import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager; import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames; +import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression; +import org.eclipse.jst.jsp.core.internal.java.jspel.ELGenerator; +import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser; +import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException; +import org.eclipse.jst.jsp.core.internal.java.jspel.Token; +import org.eclipse.jst.jsp.core.internal.java.jspel.TokenMgrError; import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts; import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelper; import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager; @@ -176,8 +183,6 @@ public class JSPTranslator { private HashMap fUserELRanges = new HashMap(); - private IELHandler fELHandler = null; - /** * ranges that don't directly map from java code to JSP code (eg. * <%@include file="included.jsp"%> @@ -191,16 +196,21 @@ public class JSPTranslator { * the file or strucdtured document depending what is available */ private StringBuffer fJspTextBuffer = new StringBuffer(); - - private ArrayList fELProblems; /** + * JSP Expression Language Parser. + */ + private JSPELParser elParser = null; + + private ArrayList fELProblems = new ArrayList(); + + /** * configure using an XMLNode * * @param node * @param monitor */ - private void configure(IDOMNode node, IProgressMonitor monitor, IELHandler handler) { + private void configure(IDOMNode node, IProgressMonitor monitor) { fProgressMonitor = monitor; fStructuredModel = node.getModel(); @@ -213,8 +223,6 @@ public class JSPTranslator { setClassname(className); fClassHeader = "public class " + className + " extends "; //$NON-NLS-1$ //$NON-NLS-2$ } - - fELHandler = handler; } /** @@ -224,7 +232,7 @@ public class JSPTranslator { * @param jspFile * @param monitor */ - private void configure(IFile jspFile, IProgressMonitor monitor, IELHandler handler) { + private void configure(IFile jspFile, IProgressMonitor monitor) { // when configured on a file // fStructuredModel, fPositionNode, fModelQuery, fStructuredDocument // are all null @@ -236,8 +244,6 @@ public class JSPTranslator { setClassname(className); fClassHeader = "public class " + className + " extends "; //$NON-NLS-1$ //$NON-NLS-2$ } - - fELHandler = handler; } /** @@ -302,10 +308,10 @@ public class JSPTranslator { /** * So that the JSPTranslator can be reused. */ - public void reset(IDOMNode node, IProgressMonitor progress, IELHandler handler) { + public void reset(IDOMNode node, IProgressMonitor progress) { // initialize some things on node - configure(node, progress, handler); + configure(node, progress); reset(); // set the jsp text buffer fJspTextBuffer.append(fStructuredDocument.get()); @@ -317,10 +323,10 @@ public class JSPTranslator { * @param jspFile * @param progress */ - public void reset(IFile jspFile, IProgressMonitor progress, IELHandler handler) { + public void reset(IFile jspFile, IProgressMonitor progress) { // initialize some things on node - configure(jspFile, progress, handler); + configure(jspFile, progress); reset(); // set the jsp text buffer setJspText(jspFile); @@ -1174,8 +1180,30 @@ public class JSPTranslator { private void translateEL(String elText, IStructuredDocumentRegion currentNode, int contentStart, int contentLength) { - fELProblems = fELHandler.translateEL(elText, elText, currentNode, - contentStart, contentLength, fUserELExpressions, fUserELRanges, this); + if(null == elParser) { + elParser = JSPELParser.createParser(elText); + } else { + elParser.ReInit(elText); + } + + try { + ASTExpression expression = elParser.Expression(); + ELGenerator gen = new ELGenerator(); + gen.generate(expression, fUserELExpressions, fUserELRanges, this, currentNode, contentStart, contentLength); + } catch (ParseException e) { + Token curTok = e.currentToken; + int problemStartOffset; + int problemEndOffset; + Position pos = null; + problemStartOffset = contentStart + curTok.beginColumn; + problemEndOffset = contentStart + curTok.endColumn; + + pos = new Position(problemStartOffset, problemEndOffset - problemStartOffset + 1); + fELProblems.add(new ELProblem(pos, e.getLocalizedMessage())); + } catch (TokenMgrError te) { + Position pos = new Position(contentStart, contentLength); + fELProblems.add(new ELProblem(pos, JSPCoreMessages.JSPEL_Token)); + } } /** diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java index 814aa09278..1db9f99aad 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java @@ -24,7 +24,6 @@ import org.eclipse.jdt.core.search.SearchParticipant; import org.eclipse.jface.text.Position; import org.eclipse.jst.jsp.core.internal.Logger; import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; -import org.eclipse.jst.jsp.core.internal.java.JSPELHandler; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory; @@ -110,7 +109,7 @@ public class JSPSearchDocument { setupAdapterFactory(xmlModel); IDOMDocument doc = xmlModel.getDocument(); JSPTranslationAdapter adapter = (JSPTranslationAdapter) doc.getAdapterFor(IJSPTranslation.class); - translation = adapter.getJSPTranslation(JSPELHandler.getJSPELHandler()); + translation = adapter.getJSPTranslation(); } } catch (IOException e) { diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java index 4e93270261..2e1ffb7d2e 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java @@ -23,7 +23,6 @@ import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jst.jsp.core.internal.JSPCoreMessages; import org.eclipse.jst.jsp.core.internal.JSPCorePlugin; import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; -import org.eclipse.jst.jsp.core.internal.java.JSPELHandler; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory; @@ -221,7 +220,7 @@ public class JSPValidator implements IValidator { setupAdapterFactory(model); IDOMDocument xmlDoc = model.getDocument(); JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class); - JSPTranslation translation = translationAdapter.getJSPTranslation(JSPELHandler.getJSPELHandler()); + JSPTranslation translation = translationAdapter.getJSPTranslation(); translation.setProblemCollectingActive(true); translation.reconcileCompilationUnit(); diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java index d00537ac4f..0741695bd8 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java @@ -20,9 +20,7 @@ import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jst.jsp.core.internal.java.IELHandler; import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; -import org.eclipse.jst.jsp.core.internal.java.JSPELHandler; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; import org.eclipse.jst.jsp.ui.internal.JSPUIMessages; @@ -84,7 +82,7 @@ public class JSPCompletionProcessor implements IContentAssistProcessor, IReleasa fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class); if (fTranslationAdapter != null) { - JSPTranslation translation = fTranslationAdapter.getJSPTranslation(getELHandler()); + JSPTranslation translation = fTranslationAdapter.getJSPTranslation(); fJavaPosition = translation.getJavaOffset(getDocumentPosition()); if (DEBUG) @@ -129,10 +127,6 @@ public class JSPCompletionProcessor implements IContentAssistProcessor, IReleasa return results; } - protected IELHandler getELHandler() { - return JSPELHandler.getJSPELHandler(); - } - protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) { return new JSPProposalCollector(cu, translation); } diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java index c50fdf7b01..2c9b02dd3d 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java @@ -25,7 +25,6 @@ import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy; import org.eclipse.jface.text.formatter.FormattingContextProperties; import org.eclipse.jface.text.formatter.IFormattingContext; import org.eclipse.jst.jsp.core.internal.Logger; -import org.eclipse.jst.jsp.core.internal.java.JSPELHandler; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationUtil; import org.eclipse.text.edits.MalformedTreeException; @@ -59,7 +58,7 @@ public class FormattingStrategyJSPJava extends ContextBasedFormattingStrategy { if (document != null && partition != null) { try { - JSPTranslationUtil translationUtil = new JSPTranslationUtil(document, JSPELHandler.getJSPELHandler()); + JSPTranslationUtil translationUtil = new JSPTranslationUtil(document); ICompilationUnit cu = translationUtil.getCompilationUnit(); if (cu != null) { String cuSource = cu.getSource(); diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java index 84b28f3f92..be5c52d0e0 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java @@ -21,7 +21,6 @@ import org.eclipse.jface.text.Region; import org.eclipse.jface.text.hyperlink.IHyperlink; import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; -import org.eclipse.jst.jsp.core.internal.java.JSPELHandler; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; import org.eclipse.jst.jsp.ui.internal.Logger; @@ -180,7 +179,7 @@ public class JSPJavaHyperlinkDetector implements IHyperlinkDetector { IDOMDocument xmlDoc = xmlModel.getDocument(); JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class); if (adapter != null) { - translation = adapter.getJSPTranslation(JSPELHandler.getJSPELHandler()); + translation = adapter.getJSPTranslation(); } } } diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java index b119c2f8c3..1ac5f8a3b3 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java @@ -16,7 +16,6 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; -import org.eclipse.jst.jsp.core.internal.java.JSPELHandler; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; import org.eclipse.ui.texteditor.ITextEditor; @@ -40,7 +39,7 @@ class JSPJavaSelectionProvider { JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class); if (adapter != null) { - JSPTranslation translation = adapter.getJSPTranslation(JSPELHandler.getJSPELHandler()); + JSPTranslation translation = adapter.getJSPTranslation(); elements = translation.getElementsFromJspRange(textSelection.getOffset(), textSelection.getOffset() + textSelection.getLength()); } } diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java index 4462e6c9ae..a8742cb1fa 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java @@ -16,7 +16,6 @@ import org.eclipse.core.resources.IFile; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jst.jsp.core.internal.java.IELHandler; import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; @@ -36,12 +35,6 @@ import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; */ public class JSPFindOccurrencesProcessor extends FindOccurrencesProcessor { - protected IELHandler fELHandler; - - public JSPFindOccurrencesProcessor(IELHandler handler) { - fELHandler = handler; - } - protected String[] getPartitionTypes() { return new String[]{IJSPPartitionTypes.JSP_DEFAULT, IJSPPartitionTypes.JSP_CONTENT_JAVA}; } @@ -73,7 +66,7 @@ public class JSPFindOccurrencesProcessor extends FindOccurrencesProcessor { IDOMDocument xmlDoc = ((IDOMModel) model).getDocument(); JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class); if (adapter != null) { - JSPTranslation translation = adapter.getJSPTranslation(fELHandler); + JSPTranslation translation = adapter.getJSPTranslation(); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=102211 elements = translation.getElementsFromJspRange(selection.getOffset(), selection.getOffset() + selection.getLength()); diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJava.java new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJava.java diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJspTranslation.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJspTranslation.java new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJspTranslation.java diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/StructuredTextReconcilingStrategyForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/StructuredTextReconcilingStrategyForJSP.java new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/StructuredTextReconcilingStrategyForJSP.java diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java index 9e97b0ccd0..7ee1293ea8 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java @@ -21,7 +21,6 @@ import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; -import org.eclipse.jst.jsp.core.internal.java.JSPELHandler; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager; @@ -107,7 +106,7 @@ public class JSPJavaJavadocHoverProcessor implements ITextHover { IDOMDocument xmlDoc = xmlModel.getDocument(); JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class); if (adapter != null) { - JSPTranslation translation = adapter.getJSPTranslation(JSPELHandler.getJSPELHandler()); + JSPTranslation translation = adapter.getJSPTranslation(); IJavaElement[] result = translation.getElementsFromJspRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength()); return getHoverInfo(result); } |