org.openide.actions.RedoAction Java Examples

The following examples show how to use org.openide.actions.RedoAction. 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 check out the related API usage on the sidebar.
Example #1
Source File: NbEditorKit.java    From netbeans with 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 File: NbEditorKit.java    From netbeans with 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);
        }
    }
}