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


org.eclipse.wst.xsl.ui.provisional.contentassist
Class AbstractXSLContentAssistRequest



public class AbstractXSLContentAssistRequest
extends java.lang.Object
An extension of the XML ContentAssistRequest class. This provides a basis for the XSL content assistance. Classes may subclass this class and implement specific functionality.


Field Summary

protected IStructuredDocumentRegiondocumentRegion
    
protected java.util.ArrayListmacros
    
protected java.lang.StringmatchString
    
protected org.w3c.dom.Nodenode
    
protected java.util.ArrayListproposals
    
protected ITextRegionregion
    
protected intreplacementBeginPosition
    
protected intreplacementLength
    
protected ITextViewertextViewer
    

Constructor Summary

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

Method Summary

protected voidaddMacro(ICompletionProposal newProposal)
    
protected voidaddProposal(ICompletionProposal newProposal)
    
protected java.util.ArrayListgetAllCompletionProposals()
    
public java.util.ArrayListgetCompletionProposals()
     Returns a list of proposals. Implementations are to provide the appropriate implementation for the proposals they would like to return. Use of the getAllCompletionProposals should be used to return the actual proposals from this method.
protected intgetCursorPosition()
     Get the cursor position within the Text Viewer
protected IStructuredDocumentRegiongetDocumentRegion()
    
protected java.lang.StringgetLocation()
     Retrieves the base location for the IDOMDocument for this class. This is used to populate a new Path class for retrieving an IFile instance.
protected java.util.ListgetMacros()
    
protected java.lang.StringgetMatchString()
    
protected java.util.CollectiongetNamespaces(IDOMElement element)
    
protected org.w3c.dom.NodegetNode()
    
protected org.w3c.dom.NodegetParent()
    
protected java.util.ListgetProposals()
    
protected ITextRegiongetRegion()
    
protected intgetReplacementBeginPosition()
    
protected intgetReplacementLength()
    
protected intgetStartOffset()
    
protected org.eclipse.wst.xsl.core.model.StylesheetModelgetStylesheetModel()
    
protected java.lang.StringgetText()
    
protected intgetTextEndOffset()
    
protected booleanhasNodes(org.w3c.dom.NodeList nodes)
     Checks to make sure that the NodeList has data
protected voidsetDocumentRegion(IStructuredDocumentRegion region)
    
protected voidsetMatchString(java.lang.String newMatchString)
    
protected voidsetNode(org.w3c.dom.Node newNode)
    
protected voidsetRegion(ITextRegion newRegion)
    
protected voidsetReplacementBeginPosition(int newReplacementBeginPosition)
    
protected voidsetReplacementLength(int newReplacementLength)
    
protected java.util.ArrayListsortProposals(java.util.ArrayList proposalsIn)
    
public java.lang.StringtoString()
    

Field Detail

documentRegion

protected IStructuredDocumentRegion documentRegion


macros

protected java.util.ArrayList macros


matchString

protected java.lang.String matchString


node

protected org.w3c.dom.Node node


proposals

protected java.util.ArrayList proposals


region

protected ITextRegion region


replacementBeginPosition

protected int replacementBeginPosition


replacementLength

protected int replacementLength


textViewer

protected ITextViewer textViewer


Constructor Detail

AbstractXSLContentAssistRequest

public AbstractXSLContentAssistRequest(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

addMacro

protected void addMacro(ICompletionProposal newProposal)

Parameters

newProposal


addProposal

protected void addProposal(ICompletionProposal newProposal)

Parameters

newProposal


getAllCompletionProposals

protected java.util.ArrayList getAllCompletionProposals()

Returns

java.util.ArrayList


getCompletionProposals

public java.util.ArrayList getCompletionProposals()

Returns a list of proposals. Implementations are to provide the appropriate implementation for the proposals they would like to return. Use of the getAllCompletionProposals should be used to return the actual proposals from this method.

Returns

java.util.ArrayList


getCursorPosition

protected int getCursorPosition()

Get the cursor position within the Text Viewer

Returns

int - An int value containing the cursor position


getDocumentRegion

protected IStructuredDocumentRegion getDocumentRegion()

Returns

IStructuredDocumentRegion


getLocation

protected java.lang.String getLocation()

Retrieves the base location for the IDOMDocument for this class. This is used to populate a new Path class for retrieving an IFile instance.

Returns

java.lang.String


getMacros

protected java.util.List getMacros()

Returns

java.util.List


getMatchString

protected java.lang.String getMatchString()

Returns

java.lang.String


getNamespaces

protected java.util.Collection getNamespaces(IDOMElement element)

Parameters

element

Returns

java.util.Collection


getNode

protected org.w3c.dom.Node getNode()

Returns

org.w3c.dom.Node


getParent

protected org.w3c.dom.Node getParent()

Returns

org.w3c.dom.Node


getProposals

protected java.util.List getProposals()

Returns

java.util.List


getRegion

protected ITextRegion getRegion()

Returns

ITextRegion


getReplacementBeginPosition

protected int getReplacementBeginPosition()

Returns

int


getReplacementLength

protected int getReplacementLength()

Returns

int


getStartOffset

protected int getStartOffset()

Returns

int


getStylesheetModel

protected org.eclipse.wst.xsl.core.model.StylesheetModel getStylesheetModel()

Returns

org.eclipse.wst.xsl.core.model.StylesheetModel


getText

protected java.lang.String getText()

Returns

java.lang.String


getTextEndOffset

protected int getTextEndOffset()

Returns

int


hasNodes

protected boolean hasNodes(org.w3c.dom.NodeList nodes)

Checks to make sure that the NodeList has data

Parameters

nodes - A NodeList object

Returns

boolean - True if has data, false if empty


setDocumentRegion

protected void setDocumentRegion(IStructuredDocumentRegion region)

Parameters

region


setMatchString

protected void setMatchString(java.lang.String newMatchString)

Parameters

newMatchString


setNode

protected void setNode(org.w3c.dom.Node newNode)

Parameters

newNode


setRegion

protected void setRegion(ITextRegion newRegion)

Parameters

newRegion


setReplacementBeginPosition

protected void setReplacementBeginPosition(int newReplacementBeginPosition)

Parameters

newReplacementBeginPosition


setReplacementLength

protected void setReplacementLength(int newReplacementLength)

Parameters

newReplacementLength


sortProposals

protected java.util.ArrayList sortProposals(java.util.ArrayList proposalsIn)

Parameters

proposalsIn

Returns

java.util.ArrayList


toString

public java.lang.String toString()

Returns

java.lang.String - java.lang.String