diff options
author | nsandonato | 2010-08-10 20:34:36 +0000 |
---|---|---|
committer | nsandonato | 2010-08-10 20:34:36 +0000 |
commit | 46b88c5f9b415436caec46f09005d0b4164bbafa (patch) | |
tree | c2e43ef87b3c3e61183f11bb6fad90bc3c799da1 /bundles/org.eclipse.wst.xml.ui | |
parent | 0ebf87dd6de1b384d452dce6a9ce16c2d6928eea (diff) | |
download | webtools.sourceediting-46b88c5f9b415436caec46f09005d0b4164bbafa.tar.gz webtools.sourceediting-46b88c5f9b415436caec46f09005d0b4164bbafa.tar.xz webtools.sourceediting-46b88c5f9b415436caec46f09005d0b4164bbafa.zip |
[319771] Templates of "All XML" context are missing from proposals
Diffstat (limited to 'bundles/org.eclipse.wst.xml.ui')
-rw-r--r-- | bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java index 0ab2300063..287baaaec3 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java @@ -10,6 +10,10 @@ *******************************************************************************/ package org.eclipse.wst.xml.ui.internal.contentassist; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext; import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML; @@ -102,4 +106,19 @@ public class XMLTemplatesCompletionProposalComputer extends } } } + + public List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor) { + List list = new ArrayList(super.computeCompletionProposals(context, monitor)); + + if (fTemplateProcessor != null) { + fTemplateProcessor.setContextType(TemplateContextTypeIdsXML.ALL); + ICompletionProposal[] proposals = fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset()); + if (proposals != null) { + for (int i = 0; i < proposals.length; i++) { + list.add(proposals[i]); + } + } + } + return list; + } } |