本文整理匯總了Java中org.eclipse.jface.text.rules.Token.EOF屬性的典型用法代碼示例。如果您正苦於以下問題:Java Token.EOF屬性的具體用法?Java Token.EOF怎麽用?Java Token.EOF使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.jface.text.rules.Token
的用法示例。
在下文中一共展示了Token.EOF屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: nextToken
@Override
public IToken nextToken() {
if (currentTemplateTextToken != null) {
if (currentTemplateTextToken.hasNext())
return currentTemplateTextToken.nextToken();
else
currentTemplateTextToken = null;
}
if (!getIterator().hasNext())
return Token.EOF;
ILexerTokenRegion next = getIterator().next();
int tokenType = next.getLexerTokenType();
switch (tokenType) {
case RULE_TEMPLATE_HEAD:
case RULE_TEMPLATE_MIDDLE: {
currentTemplateTextToken = createTemplateToken(tokenType, next);
return currentTemplateTextToken.nextToken();
}
default:
setCurrentToken(next);
return createToken(next);
}
}
示例2: nextToken
public IToken nextToken() {
boolean isOriginalToken = true;
if (!nextTokens.isEmpty()) {
currentToken = nextTokens.remove(0);
isOriginalToken = false;
} else {
currentToken = lexer.getNextToken();
}
if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
return Token.EOF;
}
if (isOriginalToken) {
splitCurrentToken();
}
TextAttribute textAttribute = null;
String tokenName = currentToken.getName();
if (tokenName != null) {
de.darwinspl.preferences.resource.dwprofile.IDwprofileTokenStyle staticStyle = getStaticTokenStyle();
// now call dynamic token styler to allow to apply modifications to the static
// style
de.darwinspl.preferences.resource.dwprofile.IDwprofileTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
if (dynamicStyle != null) {
textAttribute = getTextAttribute(dynamicStyle);
}
}
return new Token(textAttribute);
}
示例3: nextToken
public IToken nextToken() {
boolean isOriginalToken = true;
if (!nextTokens.isEmpty()) {
currentToken = nextTokens.remove(0);
isOriginalToken = false;
} else {
currentToken = lexer.getNextToken();
}
if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
return Token.EOF;
}
if (isOriginalToken) {
splitCurrentToken();
}
TextAttribute textAttribute = null;
String tokenName = currentToken.getName();
if (tokenName != null) {
eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTokenStyle staticStyle = getStaticTokenStyle();
// now call dynamic token styler to allow to apply modifications to the static
// style
eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
if (dynamicStyle != null) {
textAttribute = getTextAttribute(dynamicStyle);
}
}
return new Token(textAttribute);
}
示例4: nextToken
public IToken nextToken() {
boolean isOriginalToken = true;
if (!nextTokens.isEmpty()) {
currentToken = nextTokens.remove(0);
isOriginalToken = false;
} else {
currentToken = lexer.getNextToken();
}
if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
return Token.EOF;
}
if (isOriginalToken) {
splitCurrentToken();
}
TextAttribute textAttribute = null;
String tokenName = currentToken.getName();
if (tokenName != null) {
eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTokenStyle staticStyle = getStaticTokenStyle();
// now call dynamic token styler to allow to apply modifications to the static
// style
eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
if (dynamicStyle != null) {
textAttribute = getTextAttribute(dynamicStyle);
}
}
return new Token(textAttribute);
}
示例5: nextToken
public IToken nextToken() {
boolean isOriginalToken = true;
if (!nextTokens.isEmpty()) {
currentToken = nextTokens.remove(0);
isOriginalToken = false;
} else {
currentToken = lexer.getNextToken();
}
if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
return Token.EOF;
}
if (isOriginalToken) {
splitCurrentToken();
}
TextAttribute textAttribute = null;
String tokenName = currentToken.getName();
if (tokenName != null) {
eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTokenStyle staticStyle = getStaticTokenStyle();
// now call dynamic token styler to allow to apply modifications to the static
// style
eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
if (dynamicStyle != null) {
textAttribute = getTextAttribute(dynamicStyle);
}
}
return new Token(textAttribute);
}
示例6: nextToken
public IToken nextToken() {
boolean isOriginalToken = true;
if (!nextTokens.isEmpty()) {
currentToken = nextTokens.remove(0);
isOriginalToken = false;
} else {
currentToken = lexer.getNextToken();
}
if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
return Token.EOF;
}
if (isOriginalToken) {
splitCurrentToken();
}
TextAttribute textAttribute = null;
String tokenName = currentToken.getName();
if (tokenName != null) {
eu.hyvar.feature.mapping.resource.hymapping.IHymappingTokenStyle staticStyle = getStaticTokenStyle();
// now call dynamic token styler to allow to apply modifications to the static
// style
eu.hyvar.feature.mapping.resource.hymapping.IHymappingTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
if (dynamicStyle != null) {
textAttribute = getTextAttribute(dynamicStyle);
}
}
return new Token(textAttribute);
}
示例7: nextToken
public IToken nextToken() {
boolean isOriginalToken = true;
if (!nextTokens.isEmpty()) {
currentToken = nextTokens.remove(0);
isOriginalToken = false;
} else {
currentToken = lexer.getNextToken();
}
if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
return Token.EOF;
}
if (isOriginalToken) {
splitCurrentToken();
}
TextAttribute textAttribute = null;
String tokenName = currentToken.getName();
if (tokenName != null) {
eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTokenStyle staticStyle = getStaticTokenStyle();
// now call dynamic token styler to allow to apply modifications to the static
// style
eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
if (dynamicStyle != null) {
textAttribute = getTextAttribute(dynamicStyle);
}
}
return new Token(textAttribute);
}
示例8: nextToken
public IToken nextToken() {
boolean isOriginalToken = true;
if (!nextTokens.isEmpty()) {
currentToken = nextTokens.remove(0);
isOriginalToken = false;
} else {
currentToken = lexer.getNextToken();
}
if (currentToken == null || !currentToken.canBeUsedForSyntaxHighlighting()) {
return Token.EOF;
}
if (isOriginalToken) {
splitCurrentToken();
}
TextAttribute textAttribute = null;
String tokenName = currentToken.getName();
if (tokenName != null) {
eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTokenStyle staticStyle = getStaticTokenStyle();
// now call dynamic token styler to allow to apply modifications to the static
// style
eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTokenStyle dynamicStyle = getDynamicTokenStyle(staticStyle);
if (dynamicStyle != null) {
textAttribute = getTextAttribute(dynamicStyle);
}
}
return new Token(textAttribute);
}
示例9: nextToken
@Override
public IToken nextToken() {
if (styles == null || styles.size() == 0) {
lastStyle = Optional.absent();
return Token.EOF;
} else {
lastStyle = Optional.of(styles.get(0));
styles.remove(0);
SyntaxStyle styleDef = lastStyle.get().style;
Color color = ColorManager.getDefault().getColor(styleDef.color);
return new Token(new TextAttribute(color, null, getStyleBitmap(styleDef)));
}
}
示例10: useContractedElementCompletion
/**
* Used to determine whether there is any text after the current offset
* within the same partition, excluding the current word Also returns true
* if there is no white
*/
private boolean useContractedElementCompletion( int documentOffset,
IDocument document){
boolean textReached = false;
boolean isRemainingWhiteSpace = true;
try {
ITypedRegion region = document.getPartition(documentOffset);
int partitionOffset = region.getOffset();
int partitionLength = region.getLength();
int readLength = documentOffset - partitionOffset;
int remainingLength = partitionLength - readLength;
if( document.getLength() >= documentOffset + 1) {
String firstTwo = document.get(partitionOffset, 2);
if( firstTwo.equals("<<"))
return false;
}
scanner.setRange(document, documentOffset, remainingLength);
IToken token = null;
while ((token = scanner.nextToken()) != Token.WHITESPACE
&& token != Token.EOF) {
isRemainingWhiteSpace = false;
continue;
}
while ((token = scanner.nextToken()) == Token.WHITESPACE
&& token != Token.EOF) {
isRemainingWhiteSpace = true;
continue;
}
char c = (char) 0;
while ((c == scanner.read())) {
if( c == XMLTagScanner.EOF)
break;
if( c == '<') {
break;
}
if( !Character.isWhitespace(c))
textReached = true;
}
} catch (BadLocationException e) {
ExceptionHandler.handle(e);
}
if( textReached)
return true;
if( !isRemainingWhiteSpace && !textReached)
return true;
else
return false;
}