本文整理匯總了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setHighlightCurrentLine方法的典型用法代碼示例。如果您正苦於以下問題:Java RSyntaxTextArea.setHighlightCurrentLine方法的具體用法?Java RSyntaxTextArea.setHighlightCurrentLine怎麽用?Java RSyntaxTextArea.setHighlightCurrentLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
的用法示例。
在下文中一共展示了RSyntaxTextArea.setHighlightCurrentLine方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createBottomPanel
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
/**
* @param debuggerActions
* @param loadChooser
* @return
*/
static Component createBottomPanel(final AgentDebuggerFrame frame) {
JPanel panel = new JPanel(new BorderLayout());
RSyntaxTextArea loggerTA = new RSyntaxTextArea();
frame.setLoggerTA(loggerTA);
loggerTA.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
loggerTA.setHyperlinksEnabled(false);
loggerTA.setEditable(false);
loggerTA.setHighlightCurrentLine(false);
JPopupMenu popupMenu = new JPopupMenu();
popupMenu.add(frame.getDebuggerActions().getSaveLogAction());
popupMenu.add(frame.getDebuggerActions().getClearLogOutputAction());
loggerTA.setPopupMenu(popupMenu);
RTextScrollPane sp = new RTextScrollPane(loggerTA);
sp.setIconRowHeaderEnabled(false);
sp.getGutter().setBookmarkingEnabled(false);
panel.add(sp, BorderLayout.CENTER);
DebuggerAppender.addTextArea(loggerTA);
return panel;
}
示例2: createSyntaxTextField
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
private RSyntaxTextArea createSyntaxTextField()
{
RSyntaxTextArea area = new RSyntaxTextArea();
area.setRows(3);
area.setLineWrap(true);
area.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
area.setHighlightCurrentLine(false);
return area;
}
示例3: addTextArea
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的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);
}
示例4: addTextArea
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的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);
}
}
});
}