try {
UIManager ui_manager = AzureusCoreFactory.getSingleton().getPluginManager().getDefaultPluginInterface().getUIManager();
ui_manager.addUIListener(new UIManagerListener() {
public void UIAttached(UIInstance instance) {
if (instance instanceof UISWTInstance) {
if (view instanceof PluginViewWrapper) {
// legacy support for RSSImport plugin
// model already registered, no need to do anything as UI will pick it up
} else {
UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
if (uiFunctions instanceof UIFunctionsSWT) {
((UIFunctionsSWT)uiFunctions).addPluginView(view);
if (bAutoOpen) {
((UIFunctionsSWT)uiFunctions).openPluginView(view);
}
}
}
}
}
public void UIDetached(UIInstance instance) {
}
});
} catch (Throwable e) {
// SWT not available prolly
}