本文整理匯總了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setMarkOccurrences方法的典型用法代碼示例。如果您正苦於以下問題:Java RSyntaxTextArea.setMarkOccurrences方法的具體用法?Java RSyntaxTextArea.setMarkOccurrences怎麽用?Java RSyntaxTextArea.setMarkOccurrences使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
的用法示例。
在下文中一共展示了RSyntaxTextArea.setMarkOccurrences方法的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: configureScriptTextArea
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的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);
}
示例3: PopUpWindow
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
public PopUpWindow() {
JPanel contentPane = new JPanel(new BorderLayout());
RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
textArea.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
if (e.getExtendedKeyCode() == KeyEvent.VK_ESCAPE) {
setVisible(false);
int modifiers = e.getModifiers();
if (modifiers == KeyEvent.CTRL_MASK) {
cellText = textArea.getText();
if (!checkText(cellText)) {
cellText = resetText;
}
script.table.setValueAt(cellText, row, col + 1);
script.table.setSelection(row, col + 1);
}
return;
}
super.keyTyped(e);
}
});
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
textArea.setMarkOccurrences(true);
contentPane.add(new RTextScrollPane(textArea));
CompletionProvider provider = createCompletionProvider();
AutoCompletion ac = new AutoCompletion(provider);
// ((AbstractCompletionProvider)provider).setAutoActivationRules(true, null);
ac.setAutoActivationEnabled(true);
ac.install(textArea);
// ac.setAutoCompleteSingleChoices(true);
setContentPane(contentPane);
setTitle("AutoComplete Demo");
setUndecorated(true);
setAlwaysOnTop(true);
pack();
cellTextArea = textArea;
}
示例4: 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);
}
示例5: 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));
});
}