FileDocCategorySizeDatePackage
InstallPluginWizard.javaAPI DocAzureus 3.0.3.44455Tue May 08 19:02:34 BST 2007org.gudy.azureus2.ui.swt.pluginsinstaller

InstallPluginWizard

public class InstallPluginWizard extends org.gudy.azureus2.ui.swt.wizard.Wizard
author
Olivier Chalouhi

Fields Summary
int
mode
org.gudy.azureus2.plugins.installer.StandardPlugin[]
standard_plugins
List
plugins
boolean
shared
String
list_title_text
Constructors Summary
public InstallPluginWizard(com.aelitis.azureus.core.AzureusCore azureus_core, org.eclipse.swt.widgets.Display display)

		super(azureus_core,"installPluginsWizard.title");			
				
		IPWModePanel mode_panel = new IPWModePanel(this,null);
	
		setFirstPanel(mode_panel);
	
public InstallPluginWizard(com.aelitis.azureus.core.AzureusCore azureus_core, org.eclipse.swt.widgets.Display display, String reason, org.gudy.azureus2.plugins.installer.StandardPlugin plugin)

		super(azureus_core,"installPluginsWizard.title");			
			
		standard_plugins 	= new StandardPlugin[]{ plugin };
		list_title_text		= reason;
		
		plugins = new ArrayList();
		plugins.add( plugin );
		
		IPWListPanel list_panel = new IPWListPanel(this,null);
		
		setFirstPanel(list_panel);
	
Methods Summary
protected java.lang.StringgetListTitleText()

  		if ( list_title_text == null ){
  			
  			list_title_text = MessageText.getString( "installPluginsWizard.list.loaded" );
  		}
  		
  		return( list_title_text );
  	
public java.util.ListgetPluginList()

  		return( plugins );
  	
protected org.gudy.azureus2.plugins.installer.StandardPlugin[]getStandardPlugins()

  		if ( standard_plugins == null ){
  			
  			standard_plugins = getAzureusCore().getPluginManager().getPluginInstaller().getStandardPlugins();
  		}
  		
  		return( standard_plugins );
  	
public voidonClose()

		// Call the parent class to clean up resources
		super.onClose();	
	
public voidperformInstall()

   	  InstallablePlugin[]	ps = new InstallablePlugin[ plugins.size()];
  	  
  	  plugins.toArray( ps );
  	  
  	  if ( ps.length > 0 ){
  	  	
  	    try{
  	    	
  	      ps[0].getInstaller().install(ps,shared);
  	      
  	    }catch(Exception e){
  	    	
  	      Debug.printStackTrace(e);
  	      
  	      Logger.log(new LogAlert(LogAlert.REPEATABLE,
						"Failed to initialise installer", e));
  	    }
  	  }
  	
public static voidregister(com.aelitis.azureus.core.AzureusCore core, org.eclipse.swt.widgets.Display display)

  
     
  
	 		
	 			 
  
	core.getPluginManager().getPluginInstaller().addListener(
		new PluginInstallerListener()
		{
			public boolean
			installRequest(
				final String			reason,
				final InstallablePlugin	plugin )
			
				throws PluginException
			{
				if ( plugin instanceof StandardPlugin ){
					
					display.asyncExec(
						new Runnable()
						{
							public void
							run()
							{
								new InstallPluginWizard( core, display, reason, (StandardPlugin)plugin );
							}
						});
					
					return( true );
				}else{
					
					return( false );
				}
			}
		});
  
public voidsetPluginList(java.util.List _plugins)

  	  plugins = _plugins;