FileDocCategorySizeDatePackage
SWTManagerImpl.javaAPI DocAzureus 3.0.3.44135Thu Jul 13 09:17:26 BST 2006org.gudy.azureus2.pluginsimpl.local.ui.SWT

SWTManagerImpl

public class SWTManagerImpl extends Object implements org.gudy.azureus2.plugins.ui.SWT.SWTManager

Fields Summary
protected static SWTManagerImpl
singleton
private static org.gudy.azureus2.core3.util.AEMonitor
class_mon
Constructors Summary
Methods Summary
public voidaddView(org.gudy.azureus2.plugins.PluginView view, boolean bAutoOpen)

		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
		}
	
public voidaddView(org.gudy.azureus2.plugins.PluginView view)

  		addView(view, false);
  	
public org.gudy.azureus2.plugins.ui.SWT.GraphicSWTcreateGraphic(org.eclipse.swt.graphics.Image img)

    return new GraphicSWTImpl(img);
  
public org.gudy.azureus2.plugins.PluginViewcreatePluginView(org.gudy.azureus2.plugins.ui.model.PluginViewModel model)

		
		return( new PluginViewWrapper(model));
	
	
public org.eclipse.swt.widgets.DisplaygetDisplay()

  	SWTThread instance = SWTThread.getInstance();
  	if (instance == null)
  		return null;
    return instance.getDisplay();
  
public static org.gudy.azureus2.pluginsimpl.local.ui.SWT.SWTManagerImplgetSingleton()


	    
		try{
			class_mon.enter();
		
			if (singleton == null)
				singleton = new SWTManagerImpl();
			return singleton;
		}finally{
			
			class_mon.exit();
		}