forked from fanruan/finekit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.8 KiB
76 lines
1.8 KiB
package com.fanruan.api.design.ui.component.code; |
|
|
|
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; |
|
|
|
/** |
|
* @author richie |
|
* @version 10.0 |
|
* Created by richie on 2019-08-28 |
|
* 代码编辑器,支持javascript、sql、java、公式和普通文本 |
|
* @see com.fanruan.api.design.ui.component.code.SyntaxConstants |
|
* <pre> {@code |
|
* |
|
* UISyntaxTextArea contentTextArea = new UISyntaxTextArea(); |
|
* contentTextArea.setCloseCurlyBraces(true); |
|
* contentTextArea.setLineWrap(true); |
|
* |
|
* contentTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); |
|
* contentTextArea.setCodeFoldingEnabled(true); |
|
* contentTextArea.setAntiAliasingEnabled(true); |
|
* } |
|
* </pre> |
|
*/ |
|
public class UISyntaxTextArea extends RSyntaxTextArea { |
|
|
|
/** |
|
* 构建默认的代码编辑器 |
|
*/ |
|
public UISyntaxTextArea() { |
|
super(); |
|
} |
|
|
|
/** |
|
* 构建包含初始代码文本的代码编辑器 |
|
* @param text 代码文本 |
|
*/ |
|
public UISyntaxTextArea(String text) { |
|
super(text); |
|
} |
|
|
|
/** |
|
* 构建指定行列的代码编辑器 |
|
* @param rows 行数 |
|
* @param cols 列数 |
|
*/ |
|
public UISyntaxTextArea(int rows, int cols) { |
|
super(rows, cols); |
|
} |
|
|
|
/** |
|
* 构建指定行列和默认代码文本的代码编辑器 |
|
* @param text 代码文本 |
|
* @param rows 行数 |
|
* @param cols 列数 |
|
*/ |
|
public UISyntaxTextArea(String text, int rows, int cols) { |
|
super(text, rows, cols); |
|
} |
|
|
|
/** |
|
* 设置需要显示到代码编辑器中的文本 |
|
* @param t 待展示的文本 |
|
*/ |
|
@Override |
|
public void setText(String t) { |
|
super.setText(t); |
|
} |
|
|
|
/** |
|
* 获取代码编辑器中的代码文本 |
|
* @return 代码文本 |
|
*/ |
|
@Override |
|
public String getText() { |
|
return super.getText(); |
|
} |
|
}
|
|
|