當前位置: 首頁>>代碼示例>>Java>>正文


Java RSyntaxTextArea.setMarkOccurrences方法代碼示例

本文整理匯總了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;
}
 
開發者ID:curiosag,項目名稱:ftc,代碼行數:14,代碼來源:QueryEditor.java

示例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);
}
 
開發者ID:d0k1,項目名稱:jsflight,代碼行數:14,代碼來源:MainFrame.java

示例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;
  }
 
開發者ID:RaiMan,項目名稱:SikuliX2,代碼行數:41,代碼來源:PopUpWindow.java

示例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);
}
 
開發者ID:Error22,項目名稱:Lychee,代碼行數:70,代碼來源:JavaEditor.java

示例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));
  });
}
 
開發者ID:kohii,項目名稱:smoothcsv,代碼行數:49,代碼來源:MacroEditor.java


注:本文中的org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setMarkOccurrences方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。