Label lblNotAvail = new Label(cSection, SWT.WRAP);
Messages.setLanguageText(lblNotAvail, "core.not.available");
return cSection;
}
ImageLoader imageLoader = ImageLoader.getInstance();
Image imgOpenFolder = imageLoader.getImage("openFolderButton");
String sCurConfigID;
GridData gridData;
int userMode = COConfigurationManager.getIntParameter("User Mode");
final IpFilterManager ipFilterManager = AzureusCoreFactory.getSingleton().getIpFilterManager();
filter = ipFilterManager.getIPFilter();
Composite gFilter = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
gFilter.setLayout(layout);
gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
gFilter.setLayoutData(gridData);
// start controls
// row: enable filter + allow/deny
gridData = new GridData();
BooleanParameter enabled = new BooleanParameter(gFilter, "Ip Filter Enabled");
enabled.setLayoutData( gridData );
Messages.setLanguageText(enabled.getControl(), "ConfigView.section.ipfilter.enable");
gridData = new GridData();
BooleanParameter deny = new BooleanParameter(gFilter, "Ip Filter Allow");
deny.setLayoutData( gridData );
Messages.setLanguageText(deny.getControl(), "ConfigView.section.ipfilter.allow");
deny.addChangeListener(
new ParameterChangeAdapter()
{
public void
parameterChanged(
Parameter p,
boolean caused_internally )
{
setPercentageBlocked();
}
});
// row persist banning
gridData = new GridData();
BooleanParameter persist_bad_data_banning = new BooleanParameter(gFilter, "Ip Filter Banning Persistent");
persist_bad_data_banning.setLayoutData( gridData );
Messages.setLanguageText(persist_bad_data_banning.getControl(), "ConfigView.section.ipfilter.persistblocking");
Group gBlockBanning = new Group(gFilter, SWT.NULL);
Messages.setLanguageText(gBlockBanning, "ConfigView.section.ipfilter.peerblocking.group");
layout = new GridLayout();
layout.numColumns = 2;
gBlockBanning.setLayout(layout);
// row block bad + group ban
BooleanParameter enable_bad_data_banning = new BooleanParameter(
gBlockBanning, "Ip Filter Enable Banning",
"ConfigView.section.ipfilter.enablebanning");
gridData = new GridData();
gridData.horizontalSpan = 2;
enable_bad_data_banning.setLayoutData(gridData);
Label discard_label = new Label(gBlockBanning, SWT.NULL);
Messages.setLanguageText(discard_label,
"ConfigView.section.ipfilter.discardbanning");
FloatParameter discard_ratio = new FloatParameter(gBlockBanning, "Ip Filter Ban Discard Ratio");
gridData = new GridData();
discard_ratio.setLayoutData(gridData);
Composite cIndent = new Composite(gBlockBanning, SWT.NONE);
gridData = new GridData(GridData.FILL_BOTH);
gridData.horizontalSpan = 2;
gridData.horizontalIndent = 15;
cIndent.setLayoutData(gridData);
layout = new GridLayout(3, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
cIndent.setLayout(layout);
Image img = imageLoader.getImage("subitem");
Label label = new Label(cIndent, SWT.NULL);
gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label.setLayoutData(gridData);
label.setImage(img);