use of org.openide.windows.DummyWindowManager in project ACS by ACS-Community.
the class SimpleLookup method lookup.
public Object lookup(Class clazz) {
log.debug("looking up " + clazz.getName());
// else
if (clazz.getName().indexOf("Registry") != -1) {
WindowManager wm = WindowManager.getDefault();
if (wm != null && wm instanceof DummyWindowManager) {
return ((DummyWindowManager) wm).registry();
} else {
log.warn("unable to return registry");
}
} else if (clazz.getName().indexOf("DialogDisplayer") != -1) {
if (dialog == null) {
dialog = new NbDialogDisplayer();
}
return dialog;
} else if (clazz.getName().indexOf("NodeOp") != -1) {
if (nodeOp == null) {
nodeOp = new NbNodeOperation();
}
return nodeOp;
}
// this can be further tuned to better performance
Lookup.Item item = lookupItem(new Lookup.Template(clazz));
return item == null ? null : item.getInstance();
}
Aggregations