Created JetHighlightingColors constant container and moved keyword text attributes key there.

This commit is contained in:
Evgeny Gerashchenko
2012-03-22 22:31:59 +04:00
parent da2f41843b
commit fc236f93e5
3 changed files with 33 additions and 8 deletions
@@ -95,7 +95,7 @@ public class JetColorSettingsPage implements ColorSettingsPage {
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
return new AttributesDescriptor[]{
new AttributesDescriptor("Keyword", JetHighlighter.JET_KEYWORD)
new AttributesDescriptor(JetHighlightingColors.JET_KEYWORD.getExternalName(), JetHighlightingColors.JET_KEYWORD)
};
}
@@ -41,11 +41,6 @@ public class JetHighlighter extends SyntaxHighlighterBase {
private static final Map<IElementType, TextAttributesKey> keys1;
private static final Map<IElementType, TextAttributesKey> keys2;
static final TextAttributesKey JET_KEYWORD = TextAttributesKey.createTextAttributesKey(
"JET.KEYWORD",
SyntaxHighlighterColors.KEYWORD.getDefaultAttributes()
);
public static final TextAttributesKey JET_SOFT_KEYWORD;
static {
TextAttributes attributes = SyntaxHighlighterColors.KEYWORD.getDefaultAttributes().clone();
@@ -173,9 +168,9 @@ public class JetHighlighter extends SyntaxHighlighterBase {
keys2 = new HashMap<IElementType, TextAttributesKey>();
fillMap(keys1, JetTokens.KEYWORDS, JET_KEYWORD);
fillMap(keys1, JetTokens.KEYWORDS, JetHighlightingColors.JET_KEYWORD);
keys1.put(JetTokens.AS_SAFE, JET_KEYWORD);
keys1.put(JetTokens.AS_SAFE, JetHighlightingColors.JET_KEYWORD);
keys1.put(JetTokens.LABEL_IDENTIFIER, JET_LABEL_IDENTIFIER);
keys1.put(JetTokens.ATAT, JET_LABEL_IDENTIFIER);
keys1.put(JetTokens.FIELD_IDENTIFIER, JET_FIELD_IDENTIFIER);
@@ -0,0 +1,30 @@
/*
* Copyright 2010-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.plugin.highlighter;
import com.intellij.openapi.editor.SyntaxHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
public class JetHighlightingColors {
public final static TextAttributesKey JET_KEYWORD = TextAttributesKey.createTextAttributesKey(
"Keyword",
SyntaxHighlighterColors.KEYWORD.getDefaultAttributes()
);
private JetHighlightingColors() {
}
}