本文整理匯總了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setTabSize方法的典型用法代碼示例。如果您正苦於以下問題:Java RSyntaxTextArea.setTabSize方法的具體用法?Java RSyntaxTextArea.setTabSize怎麽用?Java RSyntaxTextArea.setTabSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
的用法示例。
在下文中一共展示了RSyntaxTextArea.setTabSize方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: SqlEditor
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
public SqlEditor() {
setBorder(null);
setLayout(new BorderLayout(0, 0));
SCToolBar toolBar = new SCToolBar();
toolBar.add("sql:Run", AwesomeIconConstants.FA_PLAY, "Run SQL");
toolBar.addSeparator();
toolBar.add("sql:Open", AwesomeIconConstants.FA_FOLDER_OPEN_O, "Open...");
toolBar.add("sql:Save", AwesomeIconConstants.FA_SAVE, "Save...");
toolBar.addSeparator();
toolBar.add("sql:ShowSqlHistory", AwesomeIconConstants.FA_HISTORY, "Show SQL History...");
toolBar.add("sql:PreviousSql", AwesomeIconConstants.FA_ARROW_CIRCLE_LEFT,
"Restore Previous SQL From History");
toolBar.add("sql:NextSql", AwesomeIconConstants.FA_ARROW_CIRCLE_RIGHT,
"Restore Next SQL From History");
add(toolBar, BorderLayout.NORTH);
textArea = new RSyntaxTextArea();
// textArea.setWrapStyleWord(true);
// textArea.setLineWrap(true);
textArea.setTabSize(4);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
// textArea.setCodeFoldingEnabled(true);
RTextScrollPane scrollPane = new RTextScrollPane(textArea);
scrollPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0,
UIConstants.getDefaultBorderColor()));
add(scrollPane, BorderLayout.CENTER);
}
示例3: createTextArea
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
/**
* Creates the text area for this application.
*
* @return The text area.
*/
private RSyntaxTextArea createTextArea() {
RSyntaxTextArea textArea = new RSyntaxTextArea(25, 70);
textArea.setTabSize(2);
textArea.setCaretPosition(0);
//textArea.addHyperlinkListener(this);
textArea.requestFocusInWindow();
//textArea.setMarkOccurrences(true);
//textArea.setCodeFoldingEnabled(true);
//textArea.setClearWhitespaceLinesEnabled(false);
//textArea.setText("int java = 2");
return textArea;
}
示例4: 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));
});
}
示例5: getTextComponent
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
protected JTextComponent getTextComponent(final ConfiguredPropertyDescriptor propertyDescriptor) {
final boolean multiline;
final boolean password;
final String mimeType;
if (_stringPropertyAnnotation == null) {
multiline = false;
mimeType = null;
password = false;
} else {
multiline = _stringPropertyAnnotation.multiline();
final String[] mimeTypes = _stringPropertyAnnotation.mimeType();
mimeType = getTextAreaMimeType(mimeTypes);
password = _stringPropertyAnnotation.password();
}
final JTextComponent textComponent;
if (multiline) {
if (mimeType != null) {
final RSyntaxTextArea syntaxArea = new RSyntaxTextArea(8, 17);
syntaxArea.setFont(WidgetUtils.FONT_MONOSPACE);
syntaxArea.setTabSize(2);
syntaxArea.setSyntaxEditingStyle(mimeType);
textComponent = syntaxArea;
} else {
textComponent = WidgetFactory.createTextArea(propertyDescriptor.getName());
}
} else {
if (password) {
textComponent = WidgetFactory.createPasswordField();
} else {
textComponent = WidgetFactory.createTextField(propertyDescriptor.getName());
}
}
textComponent.getDocument().addDocumentListener(new DCDocumentListener() {
@Override
protected void onChange(final DocumentEvent e) {
fireValueChanged();
}
});
return textComponent;
}