本文整理汇总了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;
}