org.eclipse.xtext.ui.editor.syntaxcoloring
Class TextAttributeProvider

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.syntaxcoloring.TextAttributeProvider
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.util.IPropertyChangeListener, IHighlightingConfigurationAcceptor, ITextAttributeProvider

public class TextAttributeProvider
extends java.lang.Object
implements ITextAttributeProvider, IHighlightingConfigurationAcceptor, org.eclipse.jface.util.IPropertyChangeListener

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
TextAttributeProvider(IHighlightingConfiguration highlightingConfig, IPreferenceStoreAccess preferenceStoreAccess, PreferenceStoreAccessor prefStoreAccessor)
           
 
Method Summary
 void acceptDefaultHighlighting(java.lang.String id, java.lang.String name, TextStyle style)
          Call this method to announce a specific default style.
protected  org.eclipse.jface.text.TextAttribute createTextAttribute(java.lang.String id, TextStyle defaultTextStyle)
           
 org.eclipse.jface.text.TextAttribute getAttribute(java.lang.String id)
           
 org.eclipse.jface.text.TextAttribute getMergedAttributes(java.lang.String[] ids)
           
 java.lang.String getMergedIds(java.lang.String[] ids)
           
 void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
          Notification that a property has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextAttributeProvider

@Inject
public TextAttributeProvider(IHighlightingConfiguration highlightingConfig,
                                    IPreferenceStoreAccess preferenceStoreAccess,
                                    PreferenceStoreAccessor prefStoreAccessor)
Method Detail

getAttribute

public org.eclipse.jface.text.TextAttribute getAttribute(java.lang.String id)
Specified by:
getAttribute in interface ITextAttributeProvider

getMergedAttributes

public org.eclipse.jface.text.TextAttribute getMergedAttributes(java.lang.String[] ids)
Specified by:
getMergedAttributes in interface ITextAttributeProvider

getMergedIds

public java.lang.String getMergedIds(java.lang.String[] ids)

propertyChange

public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
Description copied from interface: org.eclipse.jface.util.IPropertyChangeListener
Notification that a property has changed.

This method gets called when the observed object fires a property change event.

Specified by:
propertyChange in interface org.eclipse.jface.util.IPropertyChangeListener
Parameters:
event - the property change event object describing which property changed and how

acceptDefaultHighlighting

public void acceptDefaultHighlighting(java.lang.String id,
                                      java.lang.String name,
                                      TextStyle style)
Description copied from interface: IHighlightingConfigurationAcceptor
Call this method to announce a specific default style. Implementors may throw an IllegalStateException when an id is used twice.

Specified by:
acceptDefaultHighlighting in interface IHighlightingConfigurationAcceptor
Parameters:
id - the unique id that should be associated with the given style.
name - the human readable name of the style.
style - the default style with the given id and name.
See Also:
ILexicalHighlightingConfiguration#configure(IHighlightingConfigurationAcceptor), ISemanticHighlightingConfiguration#configure(IHighlightingConfigurationAcceptor)

createTextAttribute

protected org.eclipse.jface.text.TextAttribute createTextAttribute(java.lang.String id,
                                                                   TextStyle defaultTextStyle)