Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
Expand All @@ -112,6 +119,7 @@ class TextCommand extends AbstractOperation {
/**
* Re-initializes this text command.
*/
@Deprecated
protected void reinitialize() {
fStart= fEnd= -1;
fText= fPreservedText= null;
Expand All @@ -125,13 +133,15 @@ 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;
fText= null;
fPreservedText= null;
}

@Deprecated
@Override
public void dispose() {
reinitialize();
Expand All @@ -142,6 +152,7 @@ public void dispose() {
*
* @since 2.0
*/
@Deprecated
protected void undoTextChange() {
try {
IDocument document= fTextViewer.getDocument();
Expand All @@ -154,6 +165,7 @@ protected void undoTextChange() {
}
}

@Deprecated
@Override
public boolean canUndo() {

Expand Down Expand Up @@ -208,6 +220,7 @@ public boolean canUndo() {
return false;
}

@Deprecated
@Override
public boolean canRedo() {
if (isConnected() && isValid()) {
Expand All @@ -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.
Expand All @@ -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()) {
Expand All @@ -263,6 +279,7 @@ public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) {
*
* @since 2.0
*/
@Deprecated
protected void redoTextChange() {
try {
IDocument document= fTextViewer.getDocument();
Expand All @@ -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()) {
Expand All @@ -300,6 +318,7 @@ public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) {
* @since 3.1
*/

@Deprecated
protected void updateCommand() {
fText= fTextBuffer.toString();
fTextBuffer.setLength(0);
Expand All @@ -313,13 +332,15 @@ 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);
}

/**
* Commits the current change into this command.
*/
@Deprecated
protected void commit() {
if (fStart < 0) {
if (fFoldingIntoCompoundChange) {
Expand All @@ -340,6 +361,7 @@ protected void commit() {
*
* @since 3.1
*/
@Deprecated
protected void pretendCommit() {
if (fStart > -1) {
fText= fTextBuffer.toString();
Expand All @@ -355,6 +377,7 @@ protected void pretendCommit() {
* new fCurrent, false if not.
* @since 3.1
*/
@Deprecated
protected boolean attemptCommit() {
pretendCommit();
if (isValid()) {
Expand All @@ -370,12 +393,14 @@ protected boolean attemptCommit() {
* @return <code>true</code> 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$
Expand Down Expand Up @@ -408,6 +433,7 @@ public String toString() {
* @return the undo modification stamp for this command
* @since 3.1
*/
@Deprecated
protected long getUndoModificationStamp() {
return fUndoModificationStamp;
}
Expand All @@ -418,6 +444,7 @@ protected long getUndoModificationStamp() {
* @return the redo modification stamp for this command
* @since 3.1
*/
@Deprecated
protected long getRedoModificationStamp() {
return fRedoModificationStamp;
}
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -498,6 +529,7 @@ public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) {

*/

@Deprecated
@Override
protected void updateCommand() {
// first gather the data from the buffers
Expand All @@ -520,6 +552,7 @@ protected void updateCommand() {
/*
* @see TextCommand#createCurrent
*/
@Deprecated
@Override
protected TextCommand createCurrent() {

Expand All @@ -531,6 +564,7 @@ protected TextCommand createCurrent() {
return this;
}

@Deprecated
@Override
protected void commit() {
// if there is pending data, update the command
Expand All @@ -547,6 +581,7 @@ protected void commit() {
* @return true if the command is valid.
* @since 3.1
*/
@Deprecated
@Override
protected boolean isValid() {
if (isConnected()) {
Expand All @@ -561,6 +596,7 @@ protected boolean isValid() {
* @return the undo modification stamp
* @since 3.1
*/
@Deprecated
@Override
protected long getUndoModificationStamp() {
if (fStart > -1) {
Expand All @@ -578,6 +614,7 @@ protected long getUndoModificationStamp() {
* @return the redo modification stamp
* @since 3.1
*/
@Deprecated
@Override
protected long getRedoModificationStamp() {
if (fStart > -1) {
Expand All @@ -599,6 +636,7 @@ class KeyAndMouseListener implements MouseListener, KeyListener {
/*
* @see MouseListener#mouseDoubleClick
*/
@Deprecated
@Override
public void mouseDoubleClick(MouseEvent e) {
}
Expand All @@ -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) {
Expand All @@ -617,13 +656,15 @@ public void mouseDown(MouseEvent e) {
/*
* @see MouseListener#mouseUp
*/
@Deprecated
@Override
public void mouseUp(MouseEvent e) {
}

/*
* @see KeyListener#keyPressed
*/
@Deprecated
@Override
public void keyReleased(KeyEvent e) {
}
Expand All @@ -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) {
Expand All @@ -653,6 +695,7 @@ class DocumentListener implements IDocumentListener {

private String fReplacedText;

@Deprecated
@Override
public void documentAboutToBeChanged(DocumentEvent event) {
try {
Expand All @@ -663,6 +706,7 @@ public void documentAboutToBeChanged(DocumentEvent event) {
}
}

@Deprecated
@Override
public void documentChanged(DocumentEvent event) {
fPreservedRedoModificationStamp= event.getModificationStamp();
Expand Down Expand Up @@ -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) {
Expand All @@ -711,6 +756,7 @@ public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput
}
}

@Deprecated
@Override
public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
if (newInput != null) {
Expand All @@ -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();
Expand Down
Loading