FileDocCategorySizeDatePackage
IPWInstallModePanel.javaAPI DocAzureus 3.0.3.43631Thu Feb 09 19:42:54 GMT 2006org.gudy.azureus2.ui.swt.pluginsinstaller

IPWInstallModePanel

public class IPWInstallModePanel extends org.gudy.azureus2.ui.swt.wizard.AbstractWizardPanel
author
Olivier Chalouhi

Fields Summary
private static final int
MODE_USER
private static final int
MODE_SHARED
Constructors Summary
public IPWInstallModePanel(org.gudy.azureus2.ui.swt.wizard.Wizard wizard, org.gudy.azureus2.ui.swt.wizard.IWizardPanel previous)

  
   
  
	 					 
	 			  
  
	super(wizard, previous);
  
Methods Summary
public org.gudy.azureus2.ui.swt.wizard.IWizardPanelgetFinishPanel()

	    return new IPWFinishPanel(wizard,this);
	
public booleanisFinishEnabled()

	   return( true );
	
public voidshow()

	wizard.setTitle(MessageText.getString("installPluginsWizard.installMode.title"));
	wizard.setErrorMessage("");
	
	Composite rootPanel = wizard.getPanel();
	GridLayout layout = new GridLayout();
	layout.numColumns = 1;
	rootPanel.setLayout(layout);

	Composite panel = new Composite(rootPanel, SWT.NULL);
	GridData gridData = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
	panel.setLayoutData(gridData);
	layout = new GridLayout();
	layout.numColumns = 1;
	panel.setLayout(layout);

		// default is shared installation
	
	((InstallPluginWizard) wizard).shared = true;

	Button bSharedMode = new Button(panel,SWT.RADIO);
	Messages.setLanguageText(bSharedMode,"installPluginsWizard.installMode.shared");
	bSharedMode.setData("mode",new Integer(MODE_SHARED));
	bSharedMode.setSelection(true);
	GridData data = new GridData(GridData.FILL_VERTICAL);
	data.verticalAlignment = GridData.VERTICAL_ALIGN_END;
	bSharedMode.setLayoutData(data);
	
	
	Button bUserMode = new Button(panel,SWT.RADIO);
	Messages.setLanguageText(bUserMode,"installPluginsWizard.installMode.user");
	bUserMode.setData("mode",new Integer(MODE_USER));
	data = new GridData(GridData.FILL_VERTICAL);
	data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
	bUserMode.setLayoutData(data);
	
	
	Listener modeListener = new Listener() {
	  public void handleEvent(Event e) {
	    ((InstallPluginWizard) wizard).shared = ((Integer) e.widget.getData("mode")).intValue() == MODE_SHARED;
	  }
	};

	bUserMode.addListener(SWT.Selection,modeListener);
	bSharedMode.addListener(SWT.Selection,modeListener);