}
public Composite configSectionCreate(final Composite parent) {
GridData gridData;
Composite cSection = new Composite(parent, SWT.NULL);
gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL + GridData.VERTICAL_ALIGN_FILL);
cSection.setLayoutData(gridData);
GridLayout advanced_layout = new GridLayout();
cSection.setLayout(advanced_layout);
int userMode = COConfigurationManager.getIntParameter("User Mode");
if (userMode < REQUIRED_MODE) {
Label label = new Label(cSection, SWT.WRAP);
gridData = new GridData();
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;
}
Group gCrypto = new Group(cSection, SWT.NULL);
Messages.setLanguageText(gCrypto, CFG_PREFIX + "encrypt.group");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gCrypto.setLayoutData(gridData);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
gCrypto.setLayout(layout);
Label lcrypto = new Label(gCrypto, SWT.WRAP);
Messages.setLanguageText(lcrypto, CFG_PREFIX + "encrypt.info");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 2;
gridData.widthHint = 200; // needed for wrap
lcrypto.setLayoutData(gridData);
gridData = new GridData();
gridData.horizontalSpan = 2;
new LinkLabel(gCrypto, gridData, CFG_PREFIX
+ "encrypt.info.link",
"http://wiki.vuze.com/w/Avoid_traffic_shaping");
final BooleanParameter require = new BooleanParameter(gCrypto, "network.transport.encrypted.require", CFG_PREFIX + "require_encrypted_transport");
gridData = new GridData();
gridData.horizontalSpan = 2;
require.setLayoutData(gridData);
String[] encryption_types = { "Plain", "RC4" };
String dropLabels[] = new String[encryption_types.length];
String dropValues[] = new String[encryption_types.length];
for (int i = 0; i < encryption_types.length; i++) {
dropLabels[i] = encryption_types[i];
dropValues[i] = encryption_types[i];
}
Composite cEncryptLevel = new Composite(gCrypto, SWT.NULL);
gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 2;
cEncryptLevel.setLayoutData(gridData);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 0;
layout.marginHeight = 0;
cEncryptLevel.setLayout(layout);
Label lmin = new Label(cEncryptLevel, SWT.NULL);
Messages.setLanguageText(lmin, CFG_PREFIX + "min_encryption_level");
final StringListParameter min_level = new StringListParameter(cEncryptLevel, "network.transport.encrypted.min_level", encryption_types[1], dropLabels, dropValues);