/** * Constructor. * * @param delay The delay between when the caret last moves and when the * text should be scanned for matching occurrences. This should * be in milliseconds. * @param color The color to use to mark the occurrences. This cannot be * <code>null</code>. */ MarkOccurrencesSupport(int delay, Color color) { timer = new Timer(delay, this); timer.setRepeats(false); p = new SmartHighlightPainter(); setColor(color); }
@Override protected void init() { super.init(); // NOTE: Our actions are created here instead of in a static block // so they are only created when the first RTextArea is instantiated, // not before. There have been reports of users calling static getters // (e.g. RSyntaxTextArea.getDefaultBracketMatchBGColor()) which would // cause these actions to be created and (possibly) incorrectly // localized, if they were in a static block. if (cutAction==null) { createPopupMenuActions(); } // Install the undo manager. undoManager = createUndoManager(); getDocument().addUndoableEditListener(undoManager); // Set the defaults for various stuff. Color markAllHighlightColor = getDefaultMarkAllHighlightColor(); markAllHighlightPainter = new SmartHighlightPainter( markAllHighlightColor); setMarkAllHighlightColor(markAllHighlightColor); carets = new CaretStyle[2]; setCaretStyle(INSERT_MODE, CaretStyle.THICK_VERTICAL_LINE_STYLE); setCaretStyle(OVERWRITE_MODE, CaretStyle.BLOCK_STYLE); setDragEnabled(true); // Enable drag-and-drop. setTextMode(INSERT_MODE); // Carets array must be created first! setMarkAllOnOccurrenceSearches(true); // Fix the odd "Ctrl+H <=> Backspace" Java behavior. fixCtrlH(); }
/** * Constructor. * * @param delay The delay between when the caret last moves and when the * text should be scanned for matching occurrences. This should * be in milliseconds. * @param color The color to use to mark the occurrences. This cannot be * <code>null</code>. */ MarkOccurrencesSupport(int delay, Color color) { timer = new Timer(delay, this); timer.setRepeats(false); p = new SmartHighlightPainter(); setColor(color); }
@Override protected void init() { super.init(); // NOTE: Our actions are created here instead of in a static block // so they are only created when the first RTextArea is instantiated, // not before. There have been reports of users calling static getters // (e.g. RSyntaxTextArea.getDefaultBracketMatchBGColor()) which would // cause these actions to be created and (possibly) incorrectly // localized, if they were in a static block. if (cutAction==null) { createPopupMenuActions(); } // Install the undo manager. undoManager = createUndoManager(); getDocument().addUndoableEditListener(undoManager); // Set the defaults for various stuff. Color markAllHighlightColor = getDefaultMarkAllHighlightColor(); markAllHighlightPainter = new SmartHighlightPainter( markAllHighlightColor); setMarkAllHighlightColor(markAllHighlightColor); carets = new CaretStyle[2]; setCaretStyle(INSERT_MODE, CaretStyle.THICK_VERTICAL_LINE_STYLE); setCaretStyle(OVERWRITE_MODE, CaretStyle.BLOCK_STYLE); setDragEnabled(true); // Enable drag-and-drop. setTextMode(INSERT_MODE); // Carets array must be created first! setMarkAllOnOccurrenceSearches(true); // Fix the odd "Ctrl+H <=> Backspace" Java behavior. fixCtrlH(); }