window.setLayout(layout);
FormData formData;
// text blocked area
final StyledText textBlocked = new StyledText(window,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
Button btnClear = new Button(window,SWT.PUSH);
textBlocked.setEditable(false);
final StyledText textBanned = new StyledText(window,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
Button btnOk = new Button(window,SWT.PUSH);
Button btnReset = new Button(window,SWT.PUSH);
textBanned.setEditable(false);
formData = new FormData();
formData.left = new FormAttachment(0,0);
formData.right = new FormAttachment(100,0);
formData.top = new FormAttachment(0,0);
formData.bottom = new FormAttachment(40,0);
textBlocked.setLayoutData(formData);
textBlocked.setText(ipsBlocked);
// label blocked area
Label blockedInfo = new Label(window, SWT.NULL);
Messages.setLanguageText(blockedInfo,"ConfigView.section.ipfilter.blockedinfo");
formData = new FormData();
formData.top = new FormAttachment(textBlocked);
formData.right = new FormAttachment(btnClear);
formData.left = new FormAttachment(0,0);
blockedInfo.setLayoutData( formData );
// clear button
Messages.setLanguageText(btnClear,"Button.clear");
formData = new FormData();
formData.top = new FormAttachment(textBlocked);
formData.right = new FormAttachment(95,0 );
//formData.bottom = new FormAttachment(textBanned);
formData.width = 70;
btnClear.setLayoutData(formData);
btnClear.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event e) {
azureus_core.getIpFilterManager().getIPFilter().clearBlockedIPs();
textBlocked.setText( "" );
}
});
// text banned area
formData = new FormData();
formData.left = new FormAttachment(0,0);
formData.right = new FormAttachment(100,0);
formData.top = new FormAttachment(btnClear);
formData.bottom = new FormAttachment(btnOk);
textBanned.setLayoutData(formData);
textBanned.setText(ipsBanned);
// label banned area
Label bannedInfo = new Label(window, SWT.NULL);
Messages.setLanguageText(bannedInfo,"ConfigView.section.ipfilter.bannedinfo");
formData = new FormData();
formData.right = new FormAttachment(btnReset);
formData.left = new FormAttachment(0,0);
formData.bottom = new FormAttachment(100,0);
bannedInfo.setLayoutData( formData );
// reset button
Messages.setLanguageText(btnReset,"Button.reset");
formData = new FormData();
formData.right = new FormAttachment(btnOk);
formData.bottom = new FormAttachment(100,0);
formData.width = 70;
btnReset.setLayoutData(formData);
btnReset.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event e) {
azureus_core.getIpFilterManager().getIPFilter().clearBannedIps();
azureus_core.getIpFilterManager().getBadIps().clearBadIps();
textBanned.setText( "" );
}
});
// ok button
Messages.setLanguageText(btnOk,"Button.ok");