本文整理汇总了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setClearWhitespaceLinesEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java RSyntaxTextArea.setClearWhitespaceLinesEnabled方法的具体用法?Java RSyntaxTextArea.setClearWhitespaceLinesEnabled怎么用?Java RSyntaxTextArea.setClearWhitespaceLinesEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
的用法示例。
在下文中一共展示了RSyntaxTextArea.setClearWhitespaceLinesEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTextArea
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
private RSyntaxTextArea createTextArea() {
final RSyntaxTextArea queryText = new RSyntaxTextArea(25, 70);
queryText.setTabSize(3);
queryText.setCaretPosition(0);
queryText.requestFocusInWindow();
queryText.setMarkOccurrences(false);
queryText.setCodeFoldingEnabled(true);
queryText.setClearWhitespaceLinesEnabled(false);
queryText.setAntiAliasingEnabled(true);
queryText.setLineWrap(false);
return queryText;
}
示例2: JavaEditor
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public JavaEditor(JavaFile file) {
this.file = file;
mainSplitPane = new JSplitPane();
mainSplitPane.setContinuousLayout(true);
mainSplitPane.setResizeWeight(0.5);
textArea = new RSyntaxTextArea();
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
textArea.setEditable(false);
textArea.setAnimateBracketMatching(true);
textArea.setAntiAliasingEnabled(true);
textArea.setClearWhitespaceLinesEnabled(true);
textArea.setCodeFoldingEnabled(true);
textArea.setPaintMarkOccurrencesBorder(true);
textArea.setPaintMatchedBracketPair(true);
textArea.setMarkOccurrences(true);
textArea.getCaret().addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent paramChangeEvent) {
textArea.getCaret().setVisible(true);
}
});
int mod = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
ResourceBundle msg = ResourceBundle.getBundle("org.fife.ui.rtextarea.RTextArea");
RecordableTextAction copyAction = new RTextAreaEditorKit.CopyAction();
copyAction.setProperties(msg, "Action.Copy");
copyAction.setAccelerator(KeyStroke.getKeyStroke(67, mod));
JPopupMenu menu = new JPopupMenu();
menu.add(createPopupMenuItem(copyAction));
menu.add(createPopupMenuItem(new RenameAction()));
textArea.setPopupMenu(menu);
textArea.setText(
"package abc;\r\n\r\npublic class Example{\r\n\tprivate int example = 0;\r\n\t\r\n\tpublic void example(){\r\n\t\tSystem.out.println(\"hi!\");\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args){\r\n\t\texample();\r\n\t}\r\n}");
textArea.convertSpacesToTabs();
theme.apply(textArea);
RTextScrollPane scrollPane = new RTextScrollPane(textArea, true);
scrollPane.getGutter().setBookmarkingEnabled(true);
scrollPane.getGutter()
.setBookmarkIcon(new ImageIcon(EditorWindow.class.getResource("/resources/menu/connection.gif")));
scrollPane.setIconRowHeaderEnabled(true);
scrollPane.setFoldIndicatorEnabled(true);
mainSplitPane.setLeftComponent(scrollPane);
JScrollPane treeScrollPane = new JScrollPane();
mainSplitPane.setRightComponent(treeScrollPane);
JTree tree = new JTree();
tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Example") {
{
DefaultMutableTreeNode node_1;
node_1 = new DefaultMutableTreeNode("Variables");
node_1.add(new DefaultMutableTreeNode("int example"));
add(node_1);
node_1 = new DefaultMutableTreeNode("Methods");
node_1.add(new DefaultMutableTreeNode("public void example()"));
node_1.add(new DefaultMutableTreeNode("public static void main(String[] args)"));
add(node_1);
add(new DefaultMutableTreeNode("Patches"));
}
}));
treeScrollPane.setViewportView(tree);
}