当前位置: 首页>>代码示例>>Java>>正文


Java DefaultHighlightingConfiguration类代码示例

本文整理汇总了Java中org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration的典型用法代码示例。如果您正苦于以下问题:Java DefaultHighlightingConfiguration类的具体用法?Java DefaultHighlightingConfiguration怎么用?Java DefaultHighlightingConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DefaultHighlightingConfiguration类属于org.eclipse.xtext.ui.editor.syntaxcoloring包,在下文中一共展示了DefaultHighlightingConfiguration类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: provideHighligtingFor

import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; //导入依赖的package包/类
private void provideHighligtingFor(ElementReferenceExpression expression,
		org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightedPositionAcceptor acceptor) {
	EObject reference = expression.getReference();
	if (reference instanceof Declaration) {
		Declaration decl = (Declaration) expression.getReference();
		switch (decl.getName()) {
		case "msg":
		case "block":
		case "tx":
		case "now":
		case "this":
		case "super":
			ICompositeNode node = NodeModelUtils.findActualNodeFor(expression);
			acceptor.addPosition(node.getTotalOffset(), node.getLength() + 1,
					DefaultHighlightingConfiguration.KEYWORD_ID);
		}
	}
}
 
开发者ID:Yakindu,项目名称:solidity-ide,代码行数:19,代码来源:SoliditySemanticHighlighter.java

示例2: highlightSpecialIdentifiers

import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; //导入依赖的package包/类
@Override
protected void highlightSpecialIdentifiers(final IHighlightedPositionAcceptor acceptor, final ICompositeNode root) {
  TerminalRule idRule = grammarAccess.getIDRule();

  for (ILeafNode leaf : root.getLeafNodes()) {
    if (commentProvider.isJavaDocComment(leaf)) {
      // not really a special identifier, but we don't want to iterate over the leaf nodes twice, do we?
      acceptor.addPosition(leaf.getOffset(), leaf.getLength(), CheckHighlightingConfiguration.JAVADOC_ID);
    } else if (!leaf.isHidden()) {
      if (leaf.getGrammarElement() instanceof Keyword) {
        // Check if it is a keyword used as an identifier.
        ParserRule rule = GrammarUtil.containingParserRule(leaf.getGrammarElement());
        if (FEATURE_CALL_ID_RULE_NAME.equals(rule.getName())) {
          acceptor.addPosition(leaf.getOffset(), leaf.getLength(), DefaultHighlightingConfiguration.DEFAULT_ID);
        }
      } else {
        highlightSpecialIdentifiers(leaf, acceptor, idRule);
      }
    }
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:22,代码来源:CheckHighlightingCalculator.java

示例3: calculateId

import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; //导入依赖的package包/类
@Override
protected String calculateId(String tokenName, int tokenType) {
	switch (tokenType) {
	case RULE_TEMPLATE_HEAD:
	case RULE_TEMPLATE_END:
	case RULE_NO_SUBSTITUTION_TEMPLATE_LITERAL:
		return HighlightingConfiguration.TEMPLATE_ID;
	case RULE_TEMPLATE_CONTINUATION:
		return HighlightingConfiguration.TEMPLATE_DELIMITER_ID;
	case RULE_REGEX_START:
	case RULE_REGEX_TAIL:
		return HighlightingConfiguration.REGEX_ID;
	case CommercialAt:
	case CommercialAtCommercialAt:
		return HighlightingConfiguration.ANNOTATION_ID;
	case TYPE_REF_TOKEN:
		return HighlightingConfiguration.TYPE_REF_ID;
	case NUMBER_LITERAL_TOKEN:
		return DefaultHighlightingConfiguration.NUMBER_ID;
	case RULE_IDENTIFIER:
		return HighlightingConfiguration.IDENTIFIER_ID;
	case IDENTIFIER_REF_TOKEN:
		return HighlightingConfiguration.IDENTIFIER_REF_ID;
	case ENUM_LITERAL_TOKEN:
		return HighlightingConfiguration.ENUM_LITERAL_ID;
	case TYPE_VARIABLE_TOKEN:
		return HighlightingConfiguration.TYPE_VARIABLE_ID;
	case JS_DOC_TOKEN:
		return HighlightingConfiguration.JS_DOC_ID;
	case ES5_KW_TOKEN:
		return HighlightingConfiguration.ES5_KW_ID;
	case ES6_KW_TOKEN:
		return HighlightingConfiguration.ES6_KW_ID;
	case FUTURE_KW_TOKEN:
		return HighlightingConfiguration.FUTURE_KW_ID;
	case NULL_TOKEN:
		return HighlightingConfiguration.NULL_LITERAL_ID;
	case BOOLEAN_TOKEN:
		return HighlightingConfiguration.BOOLEAN_LITERAL_ID;
	case N4JS_KW_TOKEN:
		return HighlightingConfiguration.N4JS_KW_ID;
	default:
		return super.calculateId(tokenName, tokenType);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:46,代码来源:TokenToAttributeIdMapper.java

示例4: bindDefaultHighlightingConfiguration

import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; //导入依赖的package包/类
public Class<? extends DefaultHighlightingConfiguration> bindDefaultHighlightingConfiguration () {
	 return QueryITHighlightingConfiguration.class;
}
 
开发者ID:TodorovicNikola,项目名称:SurveyDSL,代码行数:4,代码来源:QueryITUiModule.java

示例5: bindISemanticHighlightingConfiguration

import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; //导入依赖的package包/类
public Class<? extends DefaultHighlightingConfiguration> bindISemanticHighlightingConfiguration() {
	return SemanticHighlightingConfiguration.class;
}
 
开发者ID:visor-vu,项目名称:chariot,代码行数:4,代码来源:ChariotUiModule.java

示例6: getMappedValue

import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; //导入依赖的package包/类
protected String getMappedValue(int tokenType) {
	if (tokenType == Token.INVALID_TOKEN_TYPE)
		return DefaultHighlightingConfiguration.INVALID_TOKEN_ID;
	return mappedValues[tokenType-Token.MIN_TOKEN_TYPE];
}
 
开发者ID:cplutte,项目名称:bts,代码行数:6,代码来源:TokenTypeToStringMapper.java

示例7: provideHighlightingFor

import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; //导入依赖的package包/类
public void provideHighlightingFor(XtextResource resource,
		IHighlightedPositionAcceptor acceptor) {
	if (resource == null)
		return;
	IParseResult parseResult = resource.getParseResult();
	if(parseResult==null)
		return;
	INode root = parseResult.getRootNode();
	Iterator<ILeafNode> leafNodesIt = root.getLeafNodes().iterator();
		
	while (leafNodesIt.hasNext()){
		ILeafNode nextLeaf = leafNodesIt.next();
		EObject semanticElement = nextLeaf.getSemanticElement();
		EObject grammarElement = nextLeaf.getGrammarElement();
		if(!isHiddenToken(grammarElement)) {
			if(semanticElement instanceof StringLiteral){
				acceptor.addPosition(nextLeaf.getOffset(), nextLeaf.getLength(), JavaJRExpressionHighlightingConfiguration.STRING_ID);
			}
			else if(semanticElement instanceof JRParameterObj){
				acceptor.addPosition(nextLeaf.getOffset(), nextLeaf.getLength(), JavaJRExpressionHighlightingConfiguration.PARAM_TOKEN);
			}
			else if(semanticElement instanceof JRVariableObj){
				System.out.println(nextLeaf.getGrammarElement());
				acceptor.addPosition(nextLeaf.getOffset(), nextLeaf.getLength(), JavaJRExpressionHighlightingConfiguration.VARIABLE_TOKEN);
			}
			else if(semanticElement instanceof JRFieldObj){
				acceptor.addPosition(nextLeaf.getOffset(), nextLeaf.getLength(), JavaJRExpressionHighlightingConfiguration.FIELD_TOKEN);
			}
			else if(semanticElement instanceof JRResourceBundleKeyObj) {
				acceptor.addPosition(nextLeaf.getOffset(), nextLeaf.getLength(), JavaJRExpressionHighlightingConfiguration.RESOURCE_BUNDLE_KEY);
			}
			else if(semanticElement instanceof FullMethodName){
				if(JRExpressionsModelUtil.isFunctionLibrary((FullMethodName)semanticElement)){
					acceptor.addPosition(nextLeaf.getOffset(), nextLeaf.getLength(), JavaJRExpressionHighlightingConfiguration.FUNCTION_METHOD);
				}
			}
			else if(isNumberElement(semanticElement)){
				acceptor.addPosition(nextLeaf.getOffset(), nextLeaf.getLength(), DefaultHighlightingConfiguration.NUMBER_ID);
			}
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:43,代码来源:JavaJRExpressionHighlightingCalculator.java


注:本文中的org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。