Package org.eclipse.wst.xsl.ui.internal.contentassist


org.eclipse.wst.xsl.ui.internal.contentassist
Class SelectAttributeContentAssist



public class SelectAttributeContentAssist
extends org.eclipse.wst.xsl.ui.provisional.contentassist.AbstractXSLContentAssistRequest
This class provides content assistance for the XSL select attribute.


Field Summary

protected static java.lang.StringSELECT_ATTRIBUTE
    

Constructor Summary

SelectAttributeContentAssist(org.w3c.dom.Node node , IStructuredDocumentRegion documentRegion , ITextRegion completionRegion , int begin , int length , java.lang.String filter , ITextViewer textViewer)

Method Summary

protected voidaddSelectProposals(org.w3c.dom.Element rootElement , int offset)
    
protected voidaddTemplates(java.lang.String context , int startOffset)
     Adds XPath related templates to the list of proposals
protected voidadjustXPathStart(java.lang.String attrName)
     This needs to setup the content assistance correctly. Here is what needs to happen: 1. Adjust the matchString (This should have been calculated earlier) 2. Get the current tokens offset position..this will be the starting offset. 3. Get the replacement length...this is the difference between the token offset and the next token or end of the string
protected java.lang.StringextractXPathMatchString(IDOMAttr node , ITextRegion aRegion , int offset)
    
protected IDOMAttrgetAttribute(java.lang.String attrName)
    
public java.util.ArrayListgetCompletionProposals()
     (non-Javadoc)
protected intgetXPathSeperatorPos(int column , java.lang.String nodeValue)
    

Field Detail

SELECT_ATTRIBUTE

protected static java.lang.String SELECT_ATTRIBUTE


Constructor Detail

SelectAttributeContentAssist

public SelectAttributeContentAssist(org.w3c.dom.Node node , IStructuredDocumentRegion documentRegion , ITextRegion completionRegion , int begin , int length , java.lang.String filter , ITextViewer textViewer)

Handles Content Assistance requests for Select Attributes. This is called an instantiated through the use of the computeProposals method from the XSLContentAssistProcessor. It will calculate the available proposals that are available for the XSL select attribute.


Methods Detail

addSelectProposals

protected void addSelectProposals(org.w3c.dom.Element rootElement , int offset)

Parameters

rootElement

offset


addTemplates

protected void addTemplates(java.lang.String context , int startOffset)

Adds XPath related templates to the list of proposals

Parameters

context

startOffset


adjustXPathStart

protected void adjustXPathStart(java.lang.String attrName)

This needs to setup the content assistance correctly. Here is what needs to happen: 1. Adjust the matchString (This should have been calculated earlier) 2. Get the current tokens offset position..this will be the starting offset. 3. Get the replacement length...this is the difference between the token offset and the next token or end of the string

Parameters

attrName - The name of the attribute to use as the starting node.


extractXPathMatchString

protected java.lang.String extractXPathMatchString(IDOMAttr node , ITextRegion aRegion , int offset)

Parameters

node

aRegion

offset

Returns

java.lang.String


getAttribute

protected IDOMAttr getAttribute(java.lang.String attrName)

Parameters

attrName

Returns

IDOMAttr


getCompletionProposals

public java.util.ArrayList getCompletionProposals()

(non-Javadoc)

Returns

java.util.ArrayList


getXPathSeperatorPos

protected int getXPathSeperatorPos(int column , java.lang.String nodeValue)

Parameters

column

nodeValue

Returns

int