/** * Creates an undo manager for use in this text area. * * @return The undo manager. */ protected RUndoManager createUndoManager() { return new RUndoManager(this); }
/** * Creates an undo manager for use in this text area. * * @return The undo manager. */ protected RUndoManager createUndoManager() { return new RUndoManager(this); }
/** * Deserializes a text area. * * @param s The stream to read from. * @throws ClassNotFoundException * @throws IOException */ private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); // UndoManagers cannot be serialized without Exceptions. See // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4275892 undoManager = new RUndoManager(this); getDocument().addUndoableEditListener(undoManager); lineHighlightManager = null; // Keep FindBugs happy. }
/** * De-serializes a text area. * * @param s The stream to read from. * @throws ClassNotFoundException * @throws IOException */ private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); // UndoManagers cannot be serialized without Exceptions. See // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4275892 undoManager = new RUndoManager(this); getDocument().addUndoableEditListener(undoManager); lineHighlightManager = null; // Keep FindBugs happy. }
/** * Removes all undoable edits from this document's undo manager. This * method also makes the undo/redo actions disabled. */ /* * NOTE: For some reason, it appears I have to create an entirely new * <code>undoManager</code> for undo/redo to continue functioning * properly; if I don't, it only ever lets you do one undo. Not * too sure why this is... */ public void discardAllEdits() { undoManager.discardAllEdits(); getDocument().removeUndoableEditListener(undoManager); undoManager = new RUndoManager(this); getDocument().addUndoableEditListener(undoManager); undoManager.updateActions(); }
/** * Removes all undoable edits from this document's undo manager. This * method also makes the undo/redo actions disabled. */ /* * NOTE: For some reason, it appears I have to create an entirely new * <code>undoManager</code> for undo/redo to continue functioning * properly; if I don't, it only ever lets you do one undo. Not * too sure why this is... */ public void discardAllEdits() { undoManager.discardAllEdits(); getDocument().removeUndoableEditListener(undoManager); undoManager = new RUndoManager(this); getDocument().addUndoableEditListener(undoManager); undoManager.updateActions(); }
this.undoManager = new RUndoManager(this.editor);
this.undoManager = new RUndoManager(this.editor);
/** * Initializes this text area. * * @param textMode The text mode. */ private void init(int textMode) { // Install the undo manager. undoManager = new RUndoManager(this); getDocument().addUndoableEditListener(undoManager); // Set the defaults for various stuff. Color markAllHighlightColor = getDefaultMarkAllHighlightColor(); markAllHighlightPainter = new ChangeableHighlightPainter( markAllHighlightColor); setMarkAllHighlightColor(markAllHighlightColor); carets = new int[2]; setCaretStyle(INSERT_MODE, ConfigurableCaret.THICK_VERTICAL_LINE_STYLE); setCaretStyle(OVERWRITE_MODE, ConfigurableCaret.BLOCK_STYLE); setDragEnabled(true); // Enable drag-and-drop. // Set values for stuff the user passed in. setTextMode(textMode); // carets array must be initialized first! // Fix the odd "Ctrl+H <=> Backspace" Java behavior. fixCtrlH(); }
undoManager = new RUndoManager(this); getDocument().addUndoableEditListener(undoManager);