use of org.openide.awt.UndoRedo in project netbeans-rcp-lite by outersky.
the class UndoRedoAction method run.
@Override
public void run() {
if (!EventQueue.isDispatchThread()) {
EventQueue.invokeLater(this);
return;
}
UndoRedo ur = getUndoRedo();
last.removeChangeListener(weakCL);
if (doUndo) {
setEnabled(ur.canUndo());
} else {
setEnabled(ur.canRedo());
}
putValue(NAME, getName());
last = ur;
last.addChangeListener(weakCL);
}
use of org.openide.awt.UndoRedo in project netbeans-rcp-lite by outersky.
the class MultiViewCloneableTopComponent method getUndoRedo.
/**
* Get the undo/redo support for this component.
* The default implementation returns a dummy support that cannot
* undo anything.
*
* @return undoable edit for this component
*/
public UndoRedo getUndoRedo() {
UndoRedo retValue;
retValue = peer.peerGetUndoRedo();
if (retValue == null) {
retValue = super.getUndoRedo();
}
return retValue;
}
use of org.openide.awt.UndoRedo in project netbeans-rcp-lite by outersky.
the class MultiViewTopComponent method getUndoRedo.
/**
* Get the undo/redo support for this component.
* The default implementation returns a dummy support that cannot
* undo anything.
*
* @return undoable edit for this component
*/
@Override
public UndoRedo getUndoRedo() {
UndoRedo retValue;
retValue = peer.peerGetUndoRedo();
if (retValue == null) {
retValue = super.getUndoRedo();
}
return retValue;
}
use of org.openide.awt.UndoRedo in project JJazzLab-X by jjazzboss.
the class SongMemoEditor method getUndoManager.
/**
* Use a local UndoManager per song.
*
* @return
*/
public UndoRedo getUndoManager() {
UndoRedo res = songModel == null ? null : mapSongUndoer.get(songModel).getUndoManager();
// NOI18N
LOGGER.fine("getUndoManager() songModel=" + songModel + " UndoRedo=" + res);
return res;
}
use of org.openide.awt.UndoRedo in project netbeans-rcp-lite by outersky.
the class UndoRedoAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent ev) {
UndoRedo undoRedo = getUndoRedo();
if (doUndo)
try {
if (undoRedo.canUndo()) {
undoRedo.undo();
}
} catch (CannotUndoException ex) {
cannotUndoRedo(ex);
}
else
try {
if (undoRedo.canRedo()) {
undoRedo.redo();
}
} catch (CannotRedoException ex) {
cannotUndoRedo(ex);
}
run();
}
Aggregations