diff --git a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultUndoManager.java b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultUndoManager.java index 18708ce1fae..0d106787dce 100644 --- a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultUndoManager.java +++ b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultUndoManager.java @@ -85,17 +85,23 @@ public class DefaultUndoManager implements IUndoManager, IUndoManagerExtension { class TextCommand extends AbstractOperation { /** The start index of the replaced text. */ + @Deprecated protected int fStart= -1; /** The end index of the replaced text. */ + @Deprecated protected int fEnd= -1; /** The newly inserted text. */ + @Deprecated protected String fText; /** The replaced text. */ + @Deprecated protected String fPreservedText; /** The undo modification stamp. */ + @Deprecated protected long fUndoModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; /** The redo modification stamp. */ + @Deprecated protected long fRedoModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; /** @@ -104,6 +110,7 @@ class TextCommand extends AbstractOperation { * @param context the undo context for this command * @since 3.1 */ + @Deprecated TextCommand(IUndoContext context) { super(JFaceTextMessages.getString("DefaultUndoManager.operationLabel")); //$NON-NLS-1$ addContext(context); @@ -112,6 +119,7 @@ class TextCommand extends AbstractOperation { /** * Re-initializes this text command. */ + @Deprecated protected void reinitialize() { fStart= fEnd= -1; fText= fPreservedText= null; @@ -125,6 +133,7 @@ protected void reinitialize() { * @param start the start index * @param end the end index */ + @Deprecated protected void set(int start, int end) { fStart= start; fEnd= end; @@ -132,6 +141,7 @@ protected void set(int start, int end) { fPreservedText= null; } + @Deprecated @Override public void dispose() { reinitialize(); @@ -142,6 +152,7 @@ public void dispose() { * * @since 2.0 */ + @Deprecated protected void undoTextChange() { try { IDocument document= fTextViewer.getDocument(); @@ -154,6 +165,7 @@ protected void undoTextChange() { } } + @Deprecated @Override public boolean canUndo() { @@ -208,6 +220,7 @@ public boolean canUndo() { return false; } + @Deprecated @Override public boolean canRedo() { if (isConnected() && isValid()) { @@ -223,11 +236,13 @@ public boolean canRedo() { return false; } + @Deprecated @Override public boolean canExecute() { return isConnected(); } + @Deprecated @Override public IStatus execute(IProgressMonitor monitor, IAdaptable uiInfo) { // Text commands execute as they are typed, so executing one has no effect. @@ -247,6 +262,7 @@ public IStatus execute(IProgressMonitor monitor, IAdaptable uiInfo) { * @param uiInfo an adaptable that can provide UI info if needed * @return the status */ + @Deprecated @Override public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) { if (isValid()) { @@ -263,6 +279,7 @@ public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) { * * @since 2.0 */ + @Deprecated protected void redoTextChange() { try { IDocument document= fTextViewer.getDocument(); @@ -283,6 +300,7 @@ protected void redoTextChange() { * @param uiInfo an adaptable that can provide UI info if needed * @return the status */ + @Deprecated @Override public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) { if (isValid()) { @@ -300,6 +318,7 @@ public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) { * @since 3.1 */ + @Deprecated protected void updateCommand() { fText= fTextBuffer.toString(); fTextBuffer.setLength(0); @@ -313,6 +332,7 @@ protected void updateCommand() { * * @return a new, uncommitted text command or a compound text command */ + @Deprecated protected TextCommand createCurrent() { return fFoldingIntoCompoundChange ? new CompoundTextCommand(fUndoContext) : new TextCommand(fUndoContext); } @@ -320,6 +340,7 @@ protected TextCommand createCurrent() { /** * Commits the current change into this command. */ + @Deprecated protected void commit() { if (fStart < 0) { if (fFoldingIntoCompoundChange) { @@ -340,6 +361,7 @@ protected void commit() { * * @since 3.1 */ + @Deprecated protected void pretendCommit() { if (fStart > -1) { fText= fTextBuffer.toString(); @@ -355,6 +377,7 @@ protected void pretendCommit() { * new fCurrent, false if not. * @since 3.1 */ + @Deprecated protected boolean attemptCommit() { pretendCommit(); if (isValid()) { @@ -370,12 +393,14 @@ protected boolean attemptCommit() { * @return true if the command is valid for undo or redo * @since 3.1 */ + @Deprecated protected boolean isValid() { return fStart > -1 && fEnd > -1 && fText != null; } + @Deprecated @Override public String toString() { String delimiter= ", "; //$NON-NLS-1$ @@ -408,6 +433,7 @@ public String toString() { * @return the undo modification stamp for this command * @since 3.1 */ + @Deprecated protected long getUndoModificationStamp() { return fUndoModificationStamp; } @@ -418,6 +444,7 @@ protected long getUndoModificationStamp() { * @return the redo modification stamp for this command * @since 3.1 */ + @Deprecated protected long getRedoModificationStamp() { return fRedoModificationStamp; } @@ -439,6 +466,7 @@ class CompoundTextCommand extends TextCommand { * @param context the undo context for this command * @since 3.1 */ + @Deprecated CompoundTextCommand(IUndoContext context) { super(context); } @@ -448,10 +476,12 @@ class CompoundTextCommand extends TextCommand { * * @param command the command to be added */ + @Deprecated protected void add(TextCommand command) { fCommands.add(command); } + @Deprecated @Override public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) { resetProcessChangeSate(); @@ -473,6 +503,7 @@ public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) { return Status.OK_STATUS; } + @Deprecated @Override public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) { resetProcessChangeSate(); @@ -498,6 +529,7 @@ public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) { */ + @Deprecated @Override protected void updateCommand() { // first gather the data from the buffers @@ -520,6 +552,7 @@ protected void updateCommand() { /* * @see TextCommand#createCurrent */ + @Deprecated @Override protected TextCommand createCurrent() { @@ -531,6 +564,7 @@ protected TextCommand createCurrent() { return this; } + @Deprecated @Override protected void commit() { // if there is pending data, update the command @@ -547,6 +581,7 @@ protected void commit() { * @return true if the command is valid. * @since 3.1 */ + @Deprecated @Override protected boolean isValid() { if (isConnected()) { @@ -561,6 +596,7 @@ protected boolean isValid() { * @return the undo modification stamp * @since 3.1 */ + @Deprecated @Override protected long getUndoModificationStamp() { if (fStart > -1) { @@ -578,6 +614,7 @@ protected long getUndoModificationStamp() { * @return the redo modification stamp * @since 3.1 */ + @Deprecated @Override protected long getRedoModificationStamp() { if (fStart > -1) { @@ -599,6 +636,7 @@ class KeyAndMouseListener implements MouseListener, KeyListener { /* * @see MouseListener#mouseDoubleClick */ + @Deprecated @Override public void mouseDoubleClick(MouseEvent e) { } @@ -607,6 +645,7 @@ public void mouseDoubleClick(MouseEvent e) { * If the right mouse button is pressed, the current editing command is closed * @see MouseListener#mouseDown */ + @Deprecated @Override public void mouseDown(MouseEvent e) { if (e.button == 1) { @@ -617,6 +656,7 @@ public void mouseDown(MouseEvent e) { /* * @see MouseListener#mouseUp */ + @Deprecated @Override public void mouseUp(MouseEvent e) { } @@ -624,6 +664,7 @@ public void mouseUp(MouseEvent e) { /* * @see KeyListener#keyPressed */ + @Deprecated @Override public void keyReleased(KeyEvent e) { } @@ -632,6 +673,7 @@ public void keyReleased(KeyEvent e) { * On cursor keys, the current editing command is closed * @see KeyListener#keyPressed */ + @Deprecated @Override public void keyPressed(KeyEvent e) { switch (e.keyCode) { @@ -653,6 +695,7 @@ class DocumentListener implements IDocumentListener { private String fReplacedText; + @Deprecated @Override public void documentAboutToBeChanged(DocumentEvent event) { try { @@ -663,6 +706,7 @@ public void documentAboutToBeChanged(DocumentEvent event) { } } + @Deprecated @Override public void documentChanged(DocumentEvent event) { fPreservedRedoModificationStamp= event.getModificationStamp(); @@ -703,6 +747,7 @@ public void documentChanged(DocumentEvent event) { @Deprecated class TextInputListener implements ITextInputListener { + @Deprecated @Override public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { if (oldInput != null && fDocumentListener != null) { @@ -711,6 +756,7 @@ public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput } } + @Deprecated @Override public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { if (newInput != null) { @@ -731,6 +777,7 @@ public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { class HistoryListener implements IOperationHistoryListener { private IUndoableOperation fOperation; + @Deprecated @Override public void historyNotification(final OperationHistoryEvent event) { final int type= event.getEventType();