當前位置: 首頁>>代碼示例>>Java>>正文


Java WindowManager.getOpenedTopComponents方法代碼示例

本文整理匯總了Java中org.openide.windows.WindowManager.getOpenedTopComponents方法的典型用法代碼示例。如果您正苦於以下問題:Java WindowManager.getOpenedTopComponents方法的具體用法?Java WindowManager.getOpenedTopComponents怎麽用?Java WindowManager.getOpenedTopComponents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openide.windows.WindowManager的用法示例。


在下文中一共展示了WindowManager.getOpenedTopComponents方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: view

import org.openide.windows.WindowManager; //導入方法依賴的package包/類
@Override
public void view(InputGraph graph, boolean clone) {
    
    if (!clone) {
        WindowManager manager = WindowManager.getDefault();
        for (Mode m : manager.getModes()) {
            for (TopComponent t : manager.getOpenedTopComponents(m)) {
                if (t instanceof EditorTopComponent) {
                    EditorTopComponent etc = (EditorTopComponent) t;
                    if (etc.getModel().getGroup().getGraphs().contains(graph)) {
                        etc.getModel().selectGraph(graph);
                        t.requestActive();
                        return;
                    }
                }
            }
        }
    }
    
    Diagram diagram = Diagram.createDiagram(graph, Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT));
    EditorTopComponent tc = new EditorTopComponent(diagram);
    tc.open();
    tc.requestActive();
}
 
開發者ID:arodchen,項目名稱:MaxSim,代碼行數:25,代碼來源:GraphViewerImplementation.java

示例2: view

import org.openide.windows.WindowManager; //導入方法依賴的package包/類
@Override
public void view(InputGraph graph, boolean clone) {

    if (!clone) {
        WindowManager manager = WindowManager.getDefault();
        for (Mode m : manager.getModes()) {
            for (TopComponent t : manager.getOpenedTopComponents(m)) {
                if (t instanceof EditorTopComponent) {
                    EditorTopComponent etc = (EditorTopComponent) t;
                    if (etc.getModel().getGroup().getGraphs().contains(graph)) {
                        etc.getModel().selectGraph(graph);
                        t.requestActive();
                        return;
                    }
                }
            }
        }
    }

    Diagram diagram = Diagram.createDiagram(graph, Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT));
    EditorTopComponent tc = new EditorTopComponent(diagram);
    tc.open();
    tc.requestActive();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:25,代碼來源:GraphViewerImplementation.java

示例3: isCSSStylesTCOpened

import org.openide.windows.WindowManager; //導入方法依賴的package包/類
/**
 * Checks if the CssStylesTC TopComponent is opened but does not initialize it.
 */
private boolean isCSSStylesTCOpened() {
    WindowManager wm = WindowManager.getDefault();
    for(Mode mode : wm.getModes()) {
        if(CssStylesTCController.CSS_TC_MODE.equals(mode.getName())) {
            for(TopComponent tc : wm.getOpenedTopComponents(mode)) {
                if(tc instanceof CssStylesTC) {
                    return true;
                }
            }
            break;
        }
    }
    return false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:CssStylesTCController.java


注:本文中的org.openide.windows.WindowManager.getOpenedTopComponents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。