idea 方法调用高亮_Java开发工具IntelliJ IDEA使用教程:语法高亮和颜色设置页面...

本文介绍了如何在IntelliJ IDEA中自定义语法高亮和颜色设置,包括创建Syntax Highlighter、Syntax Highlighter Factory,定义颜色设置页面,并详细展示了相关代码示例和步骤。
摘要由CSDN通过智能技术生成

在用户使用Intellij IDEA的过程中,我们需要对语法的高亮和颜色设置的页面进行定义之后,才能征程的进行使用,下面是具体的操作代码和图例说明。

1 定义syntax highlighterpackage com.simpleplugin;

import com.intellij.lexer.FlexAdapter;

import com.intellij.lexer.Lexer;

import com.intellij.openapi.editor.SyntaxHighlighterColors;

import com.intellij.openapi.editor.colors.TextAttributesKey;

import com.intellij.openapi.editor.markup.TextAttributes;

import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;

import com.intellij.psi.TokenType;

import com.intellij.psi.tree.IElementType;

import com.simpleplugin.psi.SimpleTypes;

import org.jetbrains.annotations.NotNull;

import java.awt.*;

import java.io.Reader;

import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey;

public class SimpleSyntaxHighlighter extends SyntaxHighlighterBase {

public static final TextAttributesKey SEPARATOR = createTextAttributesKey("SIMPLE_SEPARATOR", SyntaxHighlighterColors.OPERATION_SIGN);

public static final TextAttributesKey KEY = createTextAttributesKey("SIMPLE_KEY", SyntaxHighlighterColors.KEYWORD);

public static final TextAttributesKey VALUE = createTextAttributesKey("SIMPLE_VALUE", SyntaxHighlighterColors.STRING);

public static final TextAttributesKey COMMENT = createTextAttrib

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值