本文整理汇总了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setTabsEmulated方法的典型用法代码示例。如果您正苦于以下问题:Java RSyntaxTextArea.setTabsEmulated方法的具体用法?Java RSyntaxTextArea.setTabsEmulated怎么用?Java RSyntaxTextArea.setTabsEmulated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
的用法示例。
在下文中一共展示了RSyntaxTextArea.setTabsEmulated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PrologSourceEditor
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public PrologSourceEditor() {
super("Editor", new RSyntaxTextArea());
final RSyntaxTextArea theEditor = (RSyntaxTextArea) this.editor;
theEditor.setTabsEmulated(true);
theEditor.setSyntaxEditingStyle("text/jprol");
theEditor.getSyntaxScheme().getStyle(Token.VARIABLE).foreground = Color.RED.darker();
theEditor.getSyntaxScheme().getStyle(Token.VARIABLE).font = theEditor.getFont().deriveFont(Font.BOLD);
theEditor.getInputMap().put(KeyStroke.getKeyStroke("control Z"), "none");
theEditor.getInputMap().put(KeyStroke.getKeyStroke("control Y"), "none");
theEditor.setAntiAliasingEnabled(true);
theEditor.setBracketMatchingEnabled(true);
theEditor.setCodeFoldingEnabled(true);
removePropertyFromList("EdWordWrap");
editor.setForeground(Color.BLACK);
editor.setBackground(Color.WHITE);
editor.setCaretColor(Color.BLACK);
editor.setFont(new Font("Courier", Font.BOLD, 14));
editor.setVisible(true);
setEnabled(true);
this.undoManager = new RUndoManager(theEditor);
}
示例2: MacroEditor
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public MacroEditor() {
setLayout(new BorderLayout(0, 0));
SCToolBar toolBar = new SCToolBar();
toolBar.setFocusable(false);
toolBar.setFloatable(false);
add(toolBar, BorderLayout.NORTH);
toolBar.add("macro:Open", AwesomeIconConstants.FA_FOLDER_OPEN_O,
CoreBundle.get("key.open") + "...");
toolBar.add("macro:Save", AwesomeIconConstants.FA_SAVE, CoreBundle.get("key.save") + "...");
toolBar.addSeparator();
JButton startRecordButton = toolBar.add("macro:ToggleRecordingMacro",
AwesomeIconConstants.FA_CIRCLE, CoreBundle.get("key.startRecordMacro"));
JButton stopRecordButton = toolBar.add("macro:ToggleRecordingMacro",
AwesomeIconConstants.FA_STOP, CoreBundle.get("key.stopRecordMacro"));
stopRecordButton.setVisible(false);
toolBar.addSeparator();
toolBar.add("macro:Run", AwesomeIconConstants.FA_PLAY, CoreBundle.get("key.run"));
MacroRecorder.RECORDING
.addValueChangedListener(new Consumer<Condition.ConditionValueChangeEvent>() {
@Override
public void accept(ConditionValueChangeEvent t) {
startRecordButton.setVisible(!t.newValue);
stopRecordButton.setVisible(t.newValue);
}
});
textArea = new RSyntaxTextArea();
// textArea.setWrapStyleWord(true);
// textArea.setLineWrap(true);
textArea.setTabSize(2);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
textArea.setCodeFoldingEnabled(true);
textArea.setMarkOccurrences(true);
textArea.setTabsEmulated(true);
installAutoComplete(textArea);
RTextScrollPane scrollPane = new RTextScrollPane(textArea);
scrollPane.setBorder(
BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.getDefaultBorderColor()));
add(scrollPane, BorderLayout.CENTER);
MacroRecorder.setMacroAppendListener(lines -> {
textArea.setText(String.join("\n", lines));
});
}