protected String getMappedValue(final int tokenType) { String _xifexpression = null; if ((tokenType == Token.INVALID_TOKEN_TYPE)) { _xifexpression = HighlightingStyles.INVALID_TOKEN_ID; } else { _xifexpression = this.mappedValues[(tokenType - Token.MIN_TOKEN_TYPE)]; } return _xifexpression; }
private Color createInactiveColor() { TextStyle commentTextStyle = new TextStyle(); preferenceStoreAccessor.populateTextStyle(HighlightingStyles.COMMENT_ID, commentTextStyle, DEFAULT_HIGHLIGHTING_CONFIGURATION.commentTextStyle()); return new Color(getDisplay(), commentTextStyle.getColor()); }
@Override protected boolean highlightElement(final EObject object, final IHighlightedPositionAcceptor acceptor, final CancelIndicator cancelIndicator) { boolean _switchResult = false; boolean _matched = false; if (object instanceof RecordField) { _matched=true; this.highlightFeature(acceptor, object, OCCIPackage.eINSTANCE.getAttribute_Name(), HighlightingStyles.DEFAULT_ID); return true; } if (!_matched) { if (object instanceof Attribute) { _matched=true; this.highlightFeature(acceptor, object, OCCIPackage.eINSTANCE.getAttribute_Name(), HighlightingStyles.DEFAULT_ID); return true; } } if (!_matched) { if (object instanceof Mixin) { _matched=true; this.highlightFeature(acceptor, object, OCCIPackage.eINSTANCE.getCategory_Name(), HighlightingStyles.DEFAULT_ID); return true; } } if (!_matched) { if (object instanceof MixinBase) { _matched=true; this.highlightFeature(acceptor, object, OCCIPackage.eINSTANCE.getMixinBase_Mixin(), HighlightingStyles.DEFAULT_ID); return true; } } if (!_matched) { if (object instanceof DataType) { _matched=true; this.highlightFeature(acceptor, object, OCCIPackage.eINSTANCE.getDataType_Name(), HighlightingStyles.DEFAULT_ID); if ((object instanceof RecordType)) { EList<RecordField> _recordFields = ((RecordType) object).getRecordFields(); for (final RecordField field : _recordFields) { this.highlightElement(field, acceptor, cancelIndicator); } } return true; } } if (!_matched) { if (object instanceof Kind) { _matched=true; this.highlightFeature(acceptor, object, OCCIPackage.eINSTANCE.getKind_Source(), HighlightingStyles.DEFAULT_ID); this.highlightFeature(acceptor, object, OCCIPackage.eINSTANCE.getKind_Target(), HighlightingStyles.DEFAULT_ID); return true; } } if (!_matched) { _switchResult = false; } return _switchResult; }
@Override protected String calculateId(final String tokenName, final int tokenType) { String _switchResult = null; boolean _matched = false; boolean _matches = DefaultAntlrTokenToAttributeIdMapper.PUNCTUATION.matcher(tokenName).matches(); if (_matches) { _matched=true; _switchResult = HighlightingStyles.PUNCTUATION_ID; } if (!_matched) { boolean _matches_1 = DefaultAntlrTokenToAttributeIdMapper.QUOTED.matcher(tokenName).matches(); if (_matches_1) { _matched=true; _switchResult = HighlightingStyles.KEYWORD_ID; } } if (!_matched) { if (Objects.equal(tokenName, "RULE_STRING")) { _matched=true; _switchResult = HighlightingStyles.STRING_ID; } } if (!_matched) { if (Objects.equal(tokenName, "RULE_INT")) { _matched=true; _switchResult = HighlightingStyles.NUMBER_ID; } } if (!_matched) { if (Objects.equal(tokenName, "RULE_ML_COMMENT")) { _matched=true; } if (!_matched) { if (Objects.equal(tokenName, "RULE_SL_COMMENT")) { _matched=true; } } if (_matched) { _switchResult = HighlightingStyles.COMMENT_ID; } } if (!_matched) { _switchResult = HighlightingStyles.DEFAULT_ID; } return _switchResult; }