本文整理匯總了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();
}
示例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();
}
示例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;
}