FileDocCategorySizeDatePackage
ConfigSectionTransferLAN.javaAPI DocAzureus 3.0.3.44315Thu Jan 11 00:55:22 GMT 2007org.gudy.azureus2.ui.swt.views.configsections

ConfigSectionTransferLAN

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

Fields Summary
private final String
CFG_PREFIX
private final int
REQUIRED_MODE
Constructors Summary
Methods Summary
public org.eclipse.swt.widgets.CompositeconfigSectionCreate(org.eclipse.swt.widgets.Composite parent)

		GridData gridData;

		Composite cSection = new Composite(parent, SWT.NULL);

		gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
		cSection.setLayoutData(gridData);
		GridLayout advanced_layout = new GridLayout();
		advanced_layout.numColumns = 2;
		cSection.setLayout(advanced_layout);

		int userMode = COConfigurationManager.getIntParameter("User Mode");
		if (userMode < REQUIRED_MODE) {
			Label label = new Label(cSection, SWT.WRAP);
			gridData = new GridData();
			gridData.horizontalSpan = 2;
			label.setLayoutData(gridData);

			final String[] modeKeys = { "ConfigView.section.mode.beginner",
					"ConfigView.section.mode.intermediate",
					"ConfigView.section.mode.advanced" };

			String param1, param2;
			if (REQUIRED_MODE < modeKeys.length)
				param1 = MessageText.getString(modeKeys[REQUIRED_MODE]);
			else
				param1 = String.valueOf(REQUIRED_MODE);
					
			if (userMode < modeKeys.length)
				param2 = MessageText.getString(modeKeys[userMode]);
			else
				param2 = String.valueOf(userMode);

			label.setText(MessageText.getString("ConfigView.notAvailableForMode",
					new String[] { param1, param2 } ));

			return cSection;
		}

		
		BooleanParameter enable_lan = new BooleanParameter(
				cSection, "LAN Speed Enabled",
				CFG_PREFIX + "enable" );
		gridData = new GridData();
		gridData.horizontalSpan = 2;
		enable_lan.setLayoutData(gridData);
		
		IntParameter lan_max_upload = new IntParameter( cSection, "Max LAN Upload Speed KBs" );
		gridData = new GridData();
		gridData.widthHint = 40;
		lan_max_upload.setLayoutData(gridData);
		Label llmux = new Label(cSection, SWT.NULL);
		Messages.setLanguageText( llmux, CFG_PREFIX + "uploadrate" );
		
		
		IntParameter lan_max_download = new IntParameter( cSection, "Max LAN Download Speed KBs" );
		gridData = new GridData();
		gridData.widthHint = 40;
		lan_max_download.setLayoutData(gridData);
		Label llmdx = new Label(cSection, SWT.NULL);
		Messages.setLanguageText( llmdx, CFG_PREFIX + "downloadrate" );
		
		enable_lan.setAdditionalActionPerformer(
	    		new ChangeSelectionActionPerformer( new Parameter[]{ lan_max_upload, lan_max_download } ));
		enable_lan.setAdditionalActionPerformer(
	    		new ChangeSelectionActionPerformer( new Control[]{ llmux, llmdx }));


		return cSection;

	
public voidconfigSectionDelete()

	
public java.lang.StringconfigSectionGetName()

		return "transfer.lan";
	
public java.lang.StringconfigSectionGetParentSection()


	   
		return ConfigSection.SECTION_TRANSFER;
	
public voidconfigSectionSave()