richie
5 years ago
4 changed files with 103 additions and 0 deletions
@ -0,0 +1,20 @@
|
||||
package com.fanruan.api.design.ui.component.code; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-28 |
||||
* 代码编辑器用到的常量 |
||||
*/ |
||||
public interface SyntaxConstants { |
||||
|
||||
String SYNTAX_STYLE_NONE = "text/plain"; |
||||
|
||||
String SYNTAX_STYLE_JAVA = "text/java"; |
||||
|
||||
String SYNTAX_STYLE_JAVASCRIPT = "text/javascript"; |
||||
|
||||
String SYNTAX_STYLE_SQL = "text/sql"; |
||||
|
||||
String SYNTAX_STYLE_FORMULA = "text/formula"; |
||||
} |
@ -0,0 +1,37 @@
|
||||
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 |
||||
* <p> |
||||
* UISyntaxTextArea contentTextArea = new UISyntaxTextArea(); |
||||
* contentTextArea.setCloseCurlyBraces(true); |
||||
* contentTextArea.setLineWrap(true); |
||||
* contentTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); |
||||
* contentTextArea.setCodeFoldingEnabled(true); |
||||
* contentTextArea.setAntiAliasingEnabled(true); |
||||
* </p> |
||||
*/ |
||||
public class UISyntaxTextArea extends RSyntaxTextArea { |
||||
|
||||
public UISyntaxTextArea() { |
||||
super(); |
||||
} |
||||
|
||||
public UISyntaxTextArea(String text) { |
||||
super(text); |
||||
} |
||||
|
||||
public UISyntaxTextArea(int rows, int cols) { |
||||
super(rows, cols); |
||||
} |
||||
|
||||
public UISyntaxTextArea(String text, int rows, int cols) { |
||||
super(text, rows, cols); |
||||
} |
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.fanruan.api.design.ui.component.code; |
||||
|
||||
import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-28 |
||||
* 可滚动的代码编辑器容器 |
||||
*/ |
||||
public class UISyntaxTextScrollPane extends RTextScrollPane { |
||||
|
||||
public UISyntaxTextScrollPane() { |
||||
|
||||
} |
||||
|
||||
public UISyntaxTextScrollPane(Component component) { |
||||
super(component); |
||||
} |
||||
|
||||
public UISyntaxTextScrollPane(Component component, boolean lineNumbers) { |
||||
super(component, lineNumbers); |
||||
} |
||||
|
||||
public UISyntaxTextScrollPane(Component component, boolean lineNumbers, Color lineNumberColor) { |
||||
super(component, lineNumbers, lineNumberColor); |
||||
} |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.fanruan.api.design.ui.container; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-08-28 |
||||
* 可滚动容器 |
||||
*/ |
||||
public class UIScrollPane extends com.fr.design.gui.icontainer.UIScrollPane { |
||||
|
||||
public UIScrollPane(Component component) { |
||||
super(component); |
||||
} |
||||
} |
Loading…
Reference in new issue