org.eclipse.xtext.ui.editor.model
Class TerminalsTokenTypeToPartitionMapper

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.model.TokenTypeToStringMapper
      extended by org.eclipse.xtext.ui.editor.model.TerminalsTokenTypeToPartitionMapper
All Implemented Interfaces:
ITokenTypeToPartitionTypeMapper
Direct Known Subclasses:
TokenTypeToPartitionMapper

public class TerminalsTokenTypeToPartitionMapper
extends TokenTypeToStringMapper
implements ITokenTypeToPartitionTypeMapper

Author:
Sven Efftinge - Initial contribution and API

Field Summary
static java.lang.String COMMENT_PARTITION
           
static java.lang.String SL_COMMENT_PARTITION
           
static java.lang.String STRING_LITERAL_PARTITION
           
protected static java.lang.String[] SUPPORTED_PARTITIONS
           
 
Constructor Summary
TerminalsTokenTypeToPartitionMapper()
           
 
Method Summary
protected  java.lang.String calculateId(java.lang.String tokenName, int tokenType)
           
 java.lang.String getPartitionType(int antlrTokenType)
          returns the partition type for the given antlr type
 java.lang.String[] getSupportedPartitionTypes()
          returns all supported partition types
 
Methods inherited from class org.eclipse.xtext.ui.editor.model.TokenTypeToStringMapper
getMappedValue, initIds, setTokenDefProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMENT_PARTITION

public static final java.lang.String COMMENT_PARTITION
See Also:
Constant Field Values

SL_COMMENT_PARTITION

public static final java.lang.String SL_COMMENT_PARTITION
Since:
2.0
See Also:
Constant Field Values

STRING_LITERAL_PARTITION

public static final java.lang.String STRING_LITERAL_PARTITION
See Also:
Constant Field Values

SUPPORTED_PARTITIONS

protected static final java.lang.String[] SUPPORTED_PARTITIONS
Constructor Detail

TerminalsTokenTypeToPartitionMapper

public TerminalsTokenTypeToPartitionMapper()
Method Detail

getPartitionType

public java.lang.String getPartitionType(int antlrTokenType)
Description copied from interface: ITokenTypeToPartitionTypeMapper
returns the partition type for the given antlr type

Specified by:
getPartitionType in interface ITokenTypeToPartitionTypeMapper

calculateId

protected java.lang.String calculateId(java.lang.String tokenName,
                                       int tokenType)
Specified by:
calculateId in class TokenTypeToStringMapper

getSupportedPartitionTypes

public java.lang.String[] getSupportedPartitionTypes()
Description copied from interface: ITokenTypeToPartitionTypeMapper
returns all supported partition types

Specified by:
getSupportedPartitionTypes in interface ITokenTypeToPartitionTypeMapper