Java Code Examples for org.openide.actions.RedoAction

The following examples show how to use org.openide.actions.RedoAction. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: netbeans   Source File: NbEditorKit.java    License: Apache License 2.0 5 votes vote down vote up
protected @Override void updateActions() {
    addSystemActionMapping(cutAction, javax.swing.text.DefaultEditorKit.cutAction);
    addSystemActionMapping(copyAction, javax.swing.text.DefaultEditorKit.copyAction);
    addSystemActionMapping(pasteAction, org.openide.actions.PasteAction.class);
    // #69077 - DeleteAction now delegates to deleteNextCharAction
    addSystemActionMapping(deleteNextCharAction, "delete");
    addSystemActionMapping(showPopupMenuAction, org.openide.actions.PopupAction.class);

    addSystemActionMapping(gotoAction, org.openide.actions.GotoAction.class);

    addSystemActionMapping(undoAction, org.openide.actions.UndoAction.class);
    addSystemActionMapping(redoAction, org.openide.actions.RedoAction.class);
}
 
Example 2
Source Project: netbeans   Source File: NbEditorKit.java    License: Apache License 2.0 5 votes vote down vote up
public @Override void actionPerformed(ActionEvent evt, JTextComponent target) {
    Document doc = target.getDocument();
    if (doc.getProperty(BaseDocument.UNDO_MANAGER_PROP) != null ||
        doc.getProperty(UndoManager.class) != null )
    {
        super.actionPerformed(evt, target);
    } else { // Deleagte to system undo action
        // Delegate to system redo action
        RedoAction ra = (RedoAction)SystemAction.get(RedoAction.class);
        if (ra != null && ra.isEnabled()) {
            ra.actionPerformed(evt);
        }
    }
}