FileDocCategorySizeDatePackage
ConfigSectionSharing.javaAPI DocAzureus 3.0.3.45250Thu Aug 09 12:38:38 BST 2007org.gudy.azureus2.ui.swt.views.configsections

ConfigSectionSharing

public class ConfigSectionSharing extends Object implements org.gudy.azureus2.ui.swt.plugins.UISWTConfigSection

Fields Summary
Constructors Summary
Methods Summary
public CompositeconfigSectionCreate(Composite parent)

    GridData gridData;
	GridLayout layout;

    Composite gSharing = new Composite(parent, SWT.WRAP);
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gSharing.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 0;
    gSharing.setLayout(layout);

    	// row
    
	gridData = new GridData();
    Label protocol_lab = new Label(gSharing, SWT.NULL);
    Messages.setLanguageText(protocol_lab, "ConfigView.section.sharing.protocol");
	protocol_lab.setLayoutData( gridData );
	
	String[]	protocols = {"HTTP","HTTPS","UDP","DHT" };
    String[]	descs = {"HTTP","HTTPS (SSL)", "UDP", "Decentralised" };
    
	new StringListParameter(gSharing, "Sharing Protocol", "DHT", descs, protocols );

	// row
    
	GridData grid_data = new GridData();
	grid_data.horizontalSpan = 2;
	final BooleanParameter private_torrent = 
		new BooleanParameter(gSharing, 	"Sharing Torrent Private", 
                         			"ConfigView.section.sharing.privatetorrent");
	private_torrent.setLayoutData(grid_data);
	

	// row
    gridData = new GridData();
    gridData.horizontalSpan = 2;
	final BooleanParameter permit_dht = 
		new BooleanParameter(gSharing, "Sharing Permit DHT", 
                         "ConfigView.section.sharing.permitdht");
	permit_dht.setLayoutData( gridData );

	private_torrent.setAdditionalActionPerformer(new ChangeSelectionActionPerformer( permit_dht.getControls(), true ));

	private_torrent.addChangeListener(
		new ParameterChangeAdapter()
		{
			public void 
			parameterChanged(
				Parameter p, 
				boolean caused_internally )
			{
				if ( private_torrent.isSelected() ){
					
					permit_dht.setSelected( false );
				}
			}
	
		});
	
    	// row
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    new BooleanParameter(gSharing, "Sharing Add Hashes", 
                         "wizard.createtorrent.extrahashes").setLayoutData( gridData );
    

    	// row
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    BooleanParameter rescan_enable = 
    	new BooleanParameter(gSharing, "Sharing Rescan Enable", 
    						"ConfigView.section.sharing.rescanenable");
    
	rescan_enable.setLayoutData( gridData );

    	//row
    gridData = new GridData();
	gridData.horizontalIndent = 25;
    Label period_label = new Label(gSharing, SWT.NULL );
    Messages.setLanguageText(period_label, "ConfigView.section.sharing.rescanperiod");
	period_label.setLayoutData( gridData );

    gridData = new GridData();
    gridData.widthHint = 30;
	IntParameter rescan_period = new IntParameter(gSharing, "Sharing Rescan Period");
    rescan_period.setMinimumValue(1);
    rescan_period.setLayoutData( gridData );
    
    rescan_enable.setAdditionalActionPerformer(new ChangeSelectionActionPerformer( rescan_period.getControls() ));
    rescan_enable.setAdditionalActionPerformer(new ChangeSelectionActionPerformer( new Control[]{period_label} ));
	
    	// comment
    
    Label comment_label = new Label(gSharing, SWT.NULL );
    Messages.setLanguageText(comment_label, "ConfigView.section.sharing.torrentcomment");
	
	new Label(gSharing, SWT.NULL);
	
	gridData = new GridData(GridData.FILL_HORIZONTAL);
	gridData.horizontalIndent = 25;
	gridData.horizontalSpan = 2;
    StringParameter torrent_comment = new StringParameter(gSharing, "Sharing Torrent Comment", "" ); 
    torrent_comment.setLayoutData(gridData);
    
    return gSharing;
       
  
public voidconfigSectionDelete()

  
public java.lang.StringconfigSectionGetName()

		return "sharing";
	
public java.lang.StringconfigSectionGetParentSection()

    return ConfigSection.SECTION_ROOT;
  
public voidconfigSectionSave()