// Seeding Automation Setup
GridData gridData;
GridLayout layout;
Label label;
Composite cSeeding = new Composite(parent, SWT.NULL);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginHeight = 0;
cSeeding.setLayout(layout);
gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
cSeeding.setLayoutData(gridData);
// General Seeding Options
label = new Label(cSeeding, SWT.NULL);
Messages.setLanguageText(label, "ConfigView.label.minSeedingTime");
gridData = new GridData();
gridData.widthHint = 40;
new IntParameter(cSeeding, "StartStopManager_iMinSeedingTime").setLayoutData(gridData);
gridData = new GridData();
gridData.horizontalSpan = 2;
new BooleanParameter(cSeeding, "Disconnect Seed",
"ConfigView.label.disconnetseed").setLayoutData(gridData);
gridData = new GridData();
gridData.horizontalSpan = 2;
new BooleanParameter(cSeeding, "Use Super Seeding",
"ConfigView.label.userSuperSeeding").setLayoutData(gridData);
gridData = new GridData();
gridData.horizontalSpan = 2;
new BooleanParameter(cSeeding, "StartStopManager_bAutoReposition",
"ConfigView.label.seeding.autoReposition").setLayoutData(gridData);
label = new Label(cSeeding, SWT.NULL);
Messages.setLanguageText(label, "ConfigView.label.seeding.addForSeedingDLCopyCount");
gridData = new GridData();
gridData.widthHint = 40;
new IntParameter(cSeeding, "StartStopManager_iAddForSeedingDLCopyCount").setLayoutData(gridData);
label = new Label(cSeeding, SWT.NULL);
Messages.setLanguageText(label, "ConfigView.label.seeding.numPeersAsFullCopy");
Composite cArea = new Composite(cSeeding, SWT.NULL);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 2;
cArea.setLayout(layout);
gridData = new GridData();
cArea.setLayoutData(gridData);
gridData = new GridData();
gridData.widthHint = 20;
final IntParameter paramFakeFullCopy = new IntParameter(cArea, "StartStopManager_iNumPeersAsFullCopy");
paramFakeFullCopy.setLayoutData(gridData);
label = new Label(cArea, SWT.NULL);
Messages.setLanguageText(label, "ConfigView.label.peers");
final Composite cFullCopyOptionsArea = new Composite(cSeeding, SWT.NULL);
layout = new GridLayout();
layout.numColumns = 4;
layout.marginWidth = 0;
layout.marginHeight = 0;
cFullCopyOptionsArea.setLayout(layout);
gridData = new GridData();
gridData.horizontalIndent = 15;
gridData.horizontalSpan = 2;
cFullCopyOptionsArea.setLayoutData(gridData);
label = new Label(cFullCopyOptionsArea, SWT.NULL);
Image img = ImageRepository.getImage("subitem");
img.setBackground(label.getBackground());
gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label.setLayoutData(gridData);
label.setImage(img);
label = new Label(cFullCopyOptionsArea, SWT.NULL);
Messages.setLanguageText(label, "ConfigView.label.seeding.fakeFullCopySeedStart");
gridData = new GridData();
gridData.widthHint = 20;
new IntParameter(cFullCopyOptionsArea, "StartStopManager_iFakeFullCopySeedStart").setLayoutData(gridData);
label = new Label(cFullCopyOptionsArea, SWT.NULL);
Messages.setLanguageText(label, "ConfigView.label.seeds");
final int iNumPeersAsFullCopy = COConfigurationManager.getIntParameter("StartStopManager_iNumPeersAsFullCopy");
controlsSetEnabled(cFullCopyOptionsArea.getChildren(), iNumPeersAsFullCopy != 0);
paramFakeFullCopy.addChangeListener(new ParameterChangeAdapter() {
public void parameterChanged(Parameter p, boolean caused_internally) {
Utils.execSWTThread(new AERunnable() {
public void runSupport() {
try {
int value = paramFakeFullCopy.getValue();
boolean enabled = (value != 0);
if (cFullCopyOptionsArea.getEnabled() != enabled) {
cFullCopyOptionsArea.setEnabled(enabled);
controlsSetEnabled(cFullCopyOptionsArea.getChildren(), enabled);
}
} catch (Exception e) {
}
}
});
}
});
paramFakeFullCopy.getControl().addListener(SWT.Modify, new Listener() {
public void handleEvent(Event event) {
}
});
return cSeeding;