当前位置: 首页>>代码示例>>Java>>正文


Java UndoAction类代码示例

本文整理汇总了Java中org.openide.actions.UndoAction的典型用法代码示例。如果您正苦于以下问题:Java UndoAction类的具体用法?Java UndoAction怎么用?Java UndoAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UndoAction类属于org.openide.actions包,在下文中一共展示了UndoAction类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: undo

import org.openide.actions.UndoAction; //导入依赖的package包/类
private void undo() throws Exception {
    final UndoAction ua = SystemAction.get(UndoAction.class);
    assertNotNull("Cannot obtain UndoAction", ua);
    while (ua.isEnabled()) {
        SwingUtilities.invokeAndWait(new Runnable() {

            public void run() {
                ua.performAction();
            }
        });
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:BasicOpenFileTest.java

示例2: updateActions

import org.openide.actions.UndoAction; //导入依赖的package包/类
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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:NbEditorKit.java

示例3: actionPerformed

import org.openide.actions.UndoAction; //导入依赖的package包/类
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 )
    { // Basic way of undo
        super.actionPerformed(evt, target);
    } else { // Deleagte to system undo action
        // Delegate to system undo action
        UndoAction ua = (UndoAction)SystemAction.get(UndoAction.class);
        if (ua != null && ua.isEnabled()) {
            ua.actionPerformed(evt);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:NbEditorKit.java

示例4: registerEditorActions

import org.openide.actions.UndoAction; //导入依赖的package包/类
private void registerEditorActions() {
    registerAction(SystemAction.get(UndoAction.class), "control Z");
    registerAction(SystemAction.get(RedoAction.class), "control R");
    registerAction(SystemAction.get(org.openide.actions.SaveAction.class), "control S");
    registerAction(new TogleCommentAction(editor), "control /");
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:7,代码来源:GRScriptEditor.java


注:本文中的org.openide.actions.UndoAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。