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


org.eclipse.wst.xsl.ui.internal.style
Class LineStyleProviderForXSL



public class LineStyleProviderForXSL
extends AbstractLineStyleProvider
This implements a Syntax Line Style Provider for XSL. It leverages some information from the XML Syntax Coloring, but adds specific coloring for XSL specific elements and attributes.


Field Summary

protected Highlighterhighlighter
    
protected ReconcilerHighlighterrecHighlighter
    
protected IStructuredDocumentstructuredDocument
    

Constructor Summary

LineStyleProviderForXSL()

Method Summary

protected voidaddTextAttribute(java.lang.String colorKey)
     Looks up the colorKey in the preference store and adds the style information to list of TextAttributes
protected voidcommonInit(IStructuredDocument document , Highlighter highlighter)
    
protected TextAttributecreateTextAttribute(RGB foreground , RGB background , boolean bold)
    
protected TextAttributecreateTextAttribute(RGB foreground , RGB background , int style)
    
protected TextAttributegetAttributeFor(ITextRegionCollection collection , ITextRegion textRegion)
    
protected TextAttributegetAttributeFor(ITextRegion region)
    
protected IPreferenceStoregetColorPreferences()
    
protected IStructuredDocumentgetDocument()
    
protected HighlightergetHighlighter()
    
protected voidhandlePropertyChange(PropertyChangeEvent event)
    
public voidinit(IStructuredDocument document , Highlighter highlighter)
    
public voidinit(IStructuredDocument structuredDocument , ISourceViewer sourceViewer)
    
public voidinit(IStructuredDocument structuredDocument , ReconcilerHighlighter highlighter)
    
public booleanisInitialized()
     Returns the initialized.
protected voidloadColors()
    
public booleanprepareRegions(ITypedRegion typedRegion , int lineRequestStart , int lineRequestLength , java.util.Collection holdResults)
    
protected booleanprepareTextRegion(ITextRegionCollection blockedRegion , int partitionStartOffset , int partitionLength , java.util.Collection holdResults)
    
protected booleanprepareTextRegions(IStructuredDocumentRegion structuredDocumentRegion , int partitionStartOffset , int partitionLength , java.util.Collection holdResults)
    
protected voidregisterPreferenceManager()
    
public voidrelease()
    
protected voidunRegisterPreferenceManager()
    

Field Detail

highlighter

protected Highlighter highlighter


recHighlighter

protected ReconcilerHighlighter recHighlighter


structuredDocument

protected IStructuredDocument structuredDocument


Constructor Detail

LineStyleProviderForXSL

public LineStyleProviderForXSL()


Methods Detail

addTextAttribute

protected void addTextAttribute(java.lang.String colorKey)

Looks up the colorKey in the preference store and adds the style information to list of TextAttributes

Parameters

colorKey


commonInit

protected void commonInit(IStructuredDocument document , Highlighter highlighter)

Parameters

document

highlighter


createTextAttribute

protected TextAttribute createTextAttribute(RGB foreground , RGB background , boolean bold)

Parameters

foreground

background

bold

Returns

TextAttribute


createTextAttribute

protected TextAttribute createTextAttribute(RGB foreground , RGB background , int style)

Parameters

foreground

background

style

Returns

TextAttribute


getAttributeFor

protected TextAttribute getAttributeFor(ITextRegionCollection collection , ITextRegion textRegion)

Parameters

collection

textRegion

Returns

TextAttribute


getAttributeFor

protected TextAttribute getAttributeFor(ITextRegion region)

Parameters

region

Returns

TextAttribute


getColorPreferences

protected IPreferenceStore getColorPreferences()

Returns

IPreferenceStore


getDocument

protected IStructuredDocument getDocument()

Returns

IStructuredDocument


getHighlighter

protected Highlighter getHighlighter()

Returns

Highlighter


handlePropertyChange

protected void handlePropertyChange(PropertyChangeEvent event)

Parameters

event


init

public void init(IStructuredDocument document , Highlighter highlighter)

Parameters

document

highlighter


init

public void init(IStructuredDocument structuredDocument , ISourceViewer sourceViewer)

Parameters

structuredDocument

sourceViewer


init

public void init(IStructuredDocument structuredDocument , ReconcilerHighlighter highlighter)

Parameters

structuredDocument

highlighter


isInitialized

public boolean isInitialized()

Returns the initialized.

Returns

boolean - boolean


loadColors

protected void loadColors()


prepareRegions

public boolean prepareRegions(ITypedRegion typedRegion , int lineRequestStart , int lineRequestLength , java.util.Collection holdResults)

Parameters

typedRegion

lineRequestStart

lineRequestLength

holdResults

Returns

boolean


prepareTextRegion

protected boolean prepareTextRegion(ITextRegionCollection blockedRegion , int partitionStartOffset , int partitionLength , java.util.Collection holdResults)

Parameters

blockedRegion

partitionStartOffset

partitionLength

holdResults

Returns

boolean


prepareTextRegions

protected boolean prepareTextRegions(IStructuredDocumentRegion structuredDocumentRegion , int partitionStartOffset , int partitionLength , java.util.Collection holdResults)

Parameters

structuredDocumentRegion

partitionStartOffset

partitionLength

holdResults

Returns

boolean


registerPreferenceManager

protected void registerPreferenceManager()


release

public void release()


unRegisterPreferenceManager

protected void unRegisterPreferenceManager()