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;