-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Impl. color settings page for Expression Language Syntax Highlighter
- Loading branch information
Showing
3 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
...ienbrault/idea/symfony2plugin/expressionLanguage/ExpressionLanguageColorSettingsPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package fr.adrienbrault.idea.symfony2plugin.expressionLanguage; | ||
|
||
import com.intellij.openapi.editor.colors.TextAttributesKey; | ||
import com.intellij.openapi.fileTypes.SyntaxHighlighter; | ||
import com.intellij.openapi.options.colors.AttributesDescriptor; | ||
import com.intellij.openapi.options.colors.ColorDescriptor; | ||
import com.intellij.openapi.options.colors.ColorSettingsPage; | ||
import fr.adrienbrault.idea.symfony2plugin.Symfony2Icons; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import javax.swing.*; | ||
import java.util.Map; | ||
|
||
public class ExpressionLanguageColorSettingsPage implements ColorSettingsPage { | ||
|
||
private static final AttributesDescriptor[] ATTRIBUTE_DESCRIPTORS = new AttributesDescriptor[]{ | ||
new AttributesDescriptor("Number", ExpressionLanguageSyntaxHighlighter.NUMBER), | ||
new AttributesDescriptor("String", ExpressionLanguageSyntaxHighlighter.STRING), | ||
new AttributesDescriptor("Identifier", ExpressionLanguageSyntaxHighlighter.IDENTIFIER), | ||
new AttributesDescriptor("Keyword", ExpressionLanguageSyntaxHighlighter.KEYWORD), | ||
}; | ||
|
||
@Nullable | ||
@Override | ||
public Icon getIcon() { | ||
return Symfony2Icons.SYMFONY; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public SyntaxHighlighter getHighlighter() { | ||
return new ExpressionLanguageSyntaxHighlighter(); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String getDemoText() { | ||
return "article.getCommentCount(true) > 100 and article.category not in [\"misc\", null, true] === false"; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String getDisplayName() { | ||
return "Symfony Expression Language"; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public AttributesDescriptor[] getAttributeDescriptors() { | ||
return ATTRIBUTE_DESCRIPTORS; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public ColorDescriptor[] getColorDescriptors() { | ||
return ColorDescriptor.EMPTY_ARRAY; | ||
} | ||
|
||
@Override | ||
public @Nullable | ||
Map<String, TextAttributesKey> getAdditionalHighlightingTagToDescriptorMap() { | ||
return null; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters