diff --git a/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java b/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java index 478168a..f27e688 100644 --- a/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java +++ b/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java @@ -22,19 +22,55 @@ import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; */ 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(); + } } diff --git a/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextScrollPane.java b/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextScrollPane.java index 4b38e45..9441bfb 100644 --- a/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextScrollPane.java +++ b/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextScrollPane.java @@ -8,22 +8,43 @@ import java.awt.*; * @author richie * @version 10.0 * Created by richie on 2019-08-28 - * 可滚动的代码编辑器容器 + * 可滚动、可显示文本行信息和设置行号颜色的滚动器容器 */ public class UISyntaxTextScrollPane extends RTextScrollPane { + /** + * 构建默认的可滚动容器 + */ public UISyntaxTextScrollPane() { - + super(); } + /** + * 构建包含指定代码编辑器的滚动容器(显示行号) + * + * @param component 代码编辑器 + */ public UISyntaxTextScrollPane(Component component) { super(component); } + /** + * 构建包含指定代码编辑器的滚动容器 + * + * @param component 代码编辑器 + * @param lineNumbers true表示显示行号,否则不显示行号 + */ public UISyntaxTextScrollPane(Component component, boolean lineNumbers) { super(component, lineNumbers); } + /** + * 构建包含指定代码编辑器的滚动容器 + * + * @param component 代码编辑器 + * @param lineNumbers true表示显示行号,否则不显示行号 + * @param lineNumberColor 行号颜色 + */ public UISyntaxTextScrollPane(Component component, boolean lineNumbers, Color lineNumberColor) { super(component, lineNumbers, lineNumberColor); }