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


Java ActionMap.getParent方法代码示例

本文整理汇总了Java中javax.swing.ActionMap.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java ActionMap.getParent方法的具体用法?Java ActionMap.getParent怎么用?Java ActionMap.getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.ActionMap的用法示例。


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

示例1: toString

import javax.swing.ActionMap; //导入方法依赖的package包/类
/** Converts an action map to a string representation. */
static public String toString(ActionMap am) {
    StringBuilder result = new StringBuilder();
    LinkedHashMap<Object,Object> map = new LinkedHashMap<>();
    for (Object key : am.allKeys()) {
        map.put(key, am.get(key));
    }
    result.append(map);
    result.append('\n');
    ActionMap parent = am.getParent();
    if (parent != null) {
        result.append("Parent: ");
        result.append(toString(parent));
    }
    return result.toString();
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:17,代码来源:Groove.java

示例2: initCustomEditorAndDecorationsInEDT

import javax.swing.ActionMap; //导入方法依赖的package包/类
private boolean initCustomEditorAndDecorationsInEDT() {
    initCustomEditor();
    initDecoration();
    editor.remove(loadingLabel);
    ((QuietEditorPane)pane).setWorking(QuietEditorPane.ALL);
    // set the caret to right possition if this component was deserialized
    int cursorPosition = editor.getCursorPosition();
    if (cursorPosition != -1) {
        Caret caret = pane.getCaret();
        if (caret != null) {
            caret.setDot(cursorPosition);
        }
    }
    ActionMap actionMap = editor.getActionMap();
    ActionMap p = actionMap.getParent();
    actionMap.setParent(null);
    actionMap.setParent(p);

    //#134910: If editor TopComponent is already activated request focus
    //to it again to get focus to correct subcomponent eg. QuietEditorPane which
    //is added above.
    if (shouldRequestFocus(pane)) {
        EDITOR_LOG.log(Level.FINE, "requestFocusInWindow {0}", pane);
        editor.requestFocusInWindow();
    }
    //#162961, #167289: Force repaint of editor. Sometimes editor stays empty.
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            editor.revalidate();
        }
    });

    // Mark the initialization finished here so that CloneableEditor.isEditorPaneReady() returns true
    // Do it before custom editor and decorations since they might query getEditorPane()
    // which would wait indeinitely for initialization completion.
    finishInitialization();
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:CloneableEditorInitializer.java


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