use of org.eclipse.wst.xsl.ui.provisional.contentassist.IContentAssistProposalRequest in project webtools.sourceediting by eclipse.
the class EXSLTCommonContentAssistProcessor method computeCompletionProposals.
public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
initializeProposalVariables(textViewer, documentPosition);
// Only provide proposals for elements in either the XSLT Namespace or EXSLT namespace.
String namespaceURI = xmlNode.getNamespaceURI();
if (namespaceURI == null || !namespaceURI.contains("http://exslt.org/") && !namespaceURI.equals(XSLCore.XSL_NAMESPACE_URI)) {
return null;
}
EXSLTContentAssistRequestFactory requestFactory = new EXSLTContentAssistRequestFactory(textViewer, cursorPosition, xmlNode, sdRegion, completionRegion, matchString);
IContentAssistProposalRequest contentAssistRequest = requestFactory.getContentAssistRequest();
exsltProposals = contentAssistRequest.getCompletionProposals();
ICompletionProposal[] proposals = new ICompletionProposal[exsltProposals.size()];
exsltProposals.toArray(proposals);
return proposals;
}
use of org.eclipse.wst.xsl.ui.provisional.contentassist.IContentAssistProposalRequest in project webtools.sourceediting by eclipse.
the class XSLContentAssistRequestFactory method getContentAssistRequest.
/**
* Get the appropriate content assist request class for the XSL request.
* @return
*/
public IContentAssistProposalRequest getContentAssistRequest() {
NamedNodeMap nodeMap = xmlNode.getAttributes();
IDOMElement element = (IDOMElement) xmlNode;
IContentAssistProposalRequest proposal = commonAttributeProposals(nodeMap);
if (proposal instanceof NullContentAssistRequest) {
if (isElementProposal(element)) {
proposal = getElementProposals(nodeMap, element);
}
}
return proposal;
}
use of org.eclipse.wst.xsl.ui.provisional.contentassist.IContentAssistProposalRequest in project webtools.sourceediting by eclipse.
the class XSLContentAssistProcessor method getXSLNamespaceProposals.
private ArrayList<ICompletionProposal> getXSLNamespaceProposals() {
if (XSLCore.isXSLNamespace(xmlNode)) {
XSLContentAssistRequestFactory requestFactory = new XSLContentAssistRequestFactory(textViewer, cursorPosition, xmlNode, sdRegion, completionRegion, matchString);
IContentAssistProposalRequest contentAssistRequest = requestFactory.getContentAssistRequest();
xslProposals = contentAssistRequest.getCompletionProposals();
}
return xslProposals;
}
use of org.eclipse.wst.xsl.ui.provisional.contentassist.IContentAssistProposalRequest in project webtools.sourceediting by eclipse.
the class EXSLTContentAssistRequestFactory method getContentAssistRequest.
/**
* Get the appropriate content assist request class for the XSL request.
* @return
*/
public IContentAssistProposalRequest getContentAssistRequest() {
NamedNodeMap nodeMap = xmlNode.getAttributes();
IDOMElement element = (IDOMElement) xmlNode;
IContentAssistProposalRequest proposal = commonAttributeProposals(nodeMap);
if (proposal instanceof NullContentAssistRequest) {
if (isElementProposal(element)) {
proposal = getNullProposal();
}
}
return proposal;
}
Aggregations