本文整理汇总了Java中org.fife.ui.rtextarea.RTextScrollPane.setLineNumbersEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java RTextScrollPane.setLineNumbersEnabled方法的具体用法?Java RTextScrollPane.setLineNumbersEnabled怎么用?Java RTextScrollPane.setLineNumbersEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fife.ui.rtextarea.RTextScrollPane
的用法示例。
在下文中一共展示了RTextScrollPane.setLineNumbersEnabled方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTextComponentImpl
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
@Override
protected RSyntaxTextArea createTextComponentImpl() {
RSyntaxTextArea impl = new RSyntaxTextArea();
int height = (int) impl.getPreferredSize().getHeight();
impl.setMinimumSize(new Dimension(0, height));
RTextScrollPane scrollPane = new RTextScrollPane(impl);
scrollPane.setLineNumbersEnabled(showGutter);
composition = scrollPane;
composition.setPreferredSize(new Dimension(150, height));
composition.setMinimumSize(new Dimension(0, height));
doc.putProperty("filterNewlines", false);
return impl;
}
示例2: addTextArea
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
private void addTextArea() {
textArea = new RSyntaxTextArea();
textArea.setHighlightCurrentLine(true);
textArea.setAnimateBracketMatching(true);
textArea.setAntiAliasingEnabled(true);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_HTML);
scrollBar = new RTextScrollPane(textArea);
scrollBar.setBorder(null);
scrollBar.setLineNumbersEnabled(true);
scrollBar.setViewportView(textArea);
this.getContentPane().add(scrollBar);
}
示例3: QueryEditor
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public QueryEditor(SyntaxElementSource syntaxElementSource, CompletionsSource completionsSource,
ClientSettings clientSettings) {
Check.notNull(syntaxElementSource);
this.syntaxElementSource = syntaxElementSource;
this.completionsSource = completionsSource;
this.clientSettings = clientSettings;
queryText = createTextArea();
queryText.addParser(new GftParser(syntaxElementSource, onStartParsing, onFinshParsing));
queryText.setMarkOccurrences(false);
queryText.setHighlightCurrentLine(clientSettings.highlightCurrentLine);
queryText.setParserDelay(700);
waitStateDisplay = new WaitStateDisplay(queryText);
scrollPane = new RTextScrollPane(queryText, false);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
Gutter gutter = scrollPane.getGutter();
gutter.setBookmarkingEnabled(true);
scrollPane.setIconRowHeaderEnabled(true);
scrollPane.setLineNumbersEnabled(clientSettings.lineNumbersEnabled);
setTheme(clientSettings.editorThemeXml);
URL url = getClass().getResource(Const.resourcePath + "bookmark.png");
gutter.setBookmarkIcon(new ImageIcon(url));
getContentPane().add(scrollPane);
ErrorStrip errorStrip = new ErrorStrip(queryText);
getContentPane().add(errorStrip, BorderLayout.LINE_END);
setCompletionProvider();
setTokenMaker();
queryText.setSyntaxEditingStyle(Const.languageId);
registerForLongOperationEvent();
}
示例4: configureScriptTextArea
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
private void configureScriptTextArea(RSyntaxTextArea eventContent, RTextScrollPane scrollPane_2, String syntaxStyle)
{
eventContent.setSyntaxEditingStyle(syntaxStyle);
eventContent.getFoldManager().setCodeFoldingEnabled(true);
eventContent.setFont(new Font("Hack", Font.PLAIN, 16));
eventContent.setRows(3);
eventContent.setMarkOccurrences(true);
eventContent.setLineWrap(true);
eventContent.setWrapStyleWord(true);
scrollPane_2.setLineNumbersEnabled(true);
scrollPane_2.setFoldIndicatorEnabled(true);
}
示例5: SyntaxSnippetEditor
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public SyntaxSnippetEditor() {
textArea = new RSyntaxTextArea(20, 20);
textArea.setCodeFoldingEnabled(true);
scrollPane = new RTextScrollPane(textArea);
scrollPane.setLineNumbersEnabled(false);
scrollPane.setIconRowHeaderEnabled(false);
GuiUtil.removeBorder(scrollPane);
}
示例6: RSyntaxSourceEditor
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public RSyntaxSourceEditor()
{
textArea = new RSyntaxTextArea();
textArea.setOpaque( true );
textArea.setBracketMatchingEnabled( true );
textArea.setSyntaxEditingStyle( SyntaxConstants.SYNTAX_STYLE_HTML );
scroller = new RTextScrollPane( textArea );
scroller.setLineNumbersEnabled( true );
}
示例7: ScriptEditField
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public ScriptEditField() {
scriptDoc = new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
scriptTextArea = new RSyntaxTextArea(scriptDoc);
scriptTextArea.setAutoIndentEnabled(true);
scriptTextArea.setAnimateBracketMatching(true);
scriptTextArea.setCodeFoldingEnabled(true);
scriptScroll = new RTextScrollPane(scriptTextArea);
scriptScroll.setLineNumbersEnabled(true);
}
示例8: SimonkEditorPanel
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
public SimonkEditorPanel(KKMulticopterFlashTool parent) {
this.parent = parent;
//create the CellContraints
cc = new CellConstraints();
// create the Layout for Panel this
String panelColumns = "fill:pref:grow";
String panelRows = "pref,3dlu,fill:pref:grow,3dlu,pref";
FormLayout formLayout = new FormLayout(panelColumns, panelRows);
this.setLayout(formLayout);
githubPanel = new GithubPanel("sim-/tgy");
githubPanel.addGithubPanelListener(this);
tgyTextArea = new RSyntaxTextArea(20, 60);
tgyTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_ASSEMBLER_X86);
tgyTextArea.setCodeFoldingEnabled(true);
tgyTextArea.setAntiAliasingEnabled(true);
RTextScrollPane tgyEditorPane = new RTextScrollPane(tgyTextArea);
tgyEditorPane.setFoldIndicatorEnabled(true);
tgyEditorPane.setLineNumbersEnabled(true);
incTextArea = new RSyntaxTextArea(20, 60);
incTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_ASSEMBLER_X86);
incTextArea.setCodeFoldingEnabled(true);
incTextArea.setAntiAliasingEnabled(true);
RTextScrollPane incEditorPane = new RTextScrollPane(incTextArea);
incEditorPane.setFoldIndicatorEnabled(true);
incEditorPane.setLineNumbersEnabled(true);
tabs = new JTabbedPane();
tabs.add("empty",tgyEditorPane);
tabs.add("empty",incEditorPane);
saveButton = new JButton(_("save"));
saveButton.addActionListener(this);
saveButton.setEnabled(false);
compileButton = new JButton(_("compile"));
compileButton.addActionListener(this);
compileButton.setEnabled(false);
saveCompileButton = new JButton(_("save") + " & " +_("compile"));
saveCompileButton.addActionListener(this);
saveCompileButton.setEnabled(false);
bar = new ButtonBarBuilder2();
bar.addButton(saveButton);
bar.addButton(compileButton);
bar.addGlue();
bar.addUnrelatedGap();
bar.addButton(saveCompileButton);
this.add(githubPanel, cc.xy(1, 1));
this.add(tabs, cc.xy(1, 3));
this.add(bar.getPanel(), cc.xy(1, 5));
try {
Theme theme = Theme.load(SimonkEditorPanel.class.getResourceAsStream("/de/lazyzero/kkMulticopterFlashTool/gui/widgets/dark.xml"));
theme.apply(tgyTextArea);
theme.apply(incTextArea);
} catch (IOException ioe) { // Never happens
ioe.printStackTrace();
}
}
示例9: addTextArea
import org.fife.ui.rtextarea.RTextScrollPane; //导入方法依赖的package包/类
private void addTextArea() {
jtfFilter = new JTextField();
findButton = new JButton("Next word");
textArea = new RSyntaxTextArea();
textArea.setHighlightCurrentLine(true);
textArea.setAnimateBracketMatching(true);
textArea.setAntiAliasingEnabled(true);
textArea.setEditable(false);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
scrollBar = new RTextScrollPane(textArea);
scrollBar.setBorder(null);
scrollBar.setLineNumbersEnabled(true);
scrollBar.setViewportView(textArea);
this.getContentPane().add(scrollBar);
JPanel panel = new JPanel(new BorderLayout());
panel.add(new JLabel("Specify a word to match:"), BorderLayout.WEST);
panel.add(jtfFilter, BorderLayout.CENTER);
panel.add(findButton, BorderLayout.EAST);
add(panel, BorderLayout.SOUTH);
findButton.addActionListener(e -> {
String find = jtfFilter.getText().toLowerCase();
textArea.requestFocusInWindow();
if (!Strings.isBlank(find)) {
Document document = textArea.getDocument();
int findLength = find.length();
try {
boolean found = false;
if (pos + findLength > document.getLength()) {
pos = 0;
}
while (pos + findLength <= document.getLength()) {
String match = document.getText(pos, findLength).toLowerCase();
if (match.equals(find)) {
found = true;
break;
}
pos++;
}
if (found) {
Rectangle viewRect = textArea.modelToView(pos);
textArea.scrollRectToVisible(viewRect);
textArea.setCaretPosition(pos + findLength);
textArea.moveCaretPosition(pos);
pos += findLength;
}
} catch (Exception exp) {
logger.log(Level.ERROR, exp);
}
}
});
}