configList = new Combo(panel,SWT.READ_ONLY);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 3;
configList.setLayoutData(gridData);
configList.addListener(SWT.Selection,new Listener() {
public void handleEvent(Event e) {
updateTrackers();
refreshDetails();
}
});
btnNew = new Button(panel, SWT.PUSH);
Messages.setLanguageText(btnNew, "wizard.multitracker.new");
gridData = new GridData();
gridData.widthHint = 100;
btnNew.setLayoutData(gridData);
btnNew.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
List group = new ArrayList();
List tracker = new ArrayList();
tracker.add(((NewTorrentWizard)wizard).trackerURL);
group.add(tracker);
new MultiTrackerEditor(null,group,MultiTrackerPanel.this);
}
});
btnEdit = new Button(panel, SWT.PUSH);
Messages.setLanguageText(btnEdit, "wizard.multitracker.edit");
gridData = new GridData();
gridData.widthHint = 100;
btnEdit.setLayoutData(gridData);
btnEdit.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
int selection = configList.getSelectionIndex();
String selected = configList.getItem(selection);
Map multiTrackers = TrackersUtil.getInstance().getMultiTrackers();
new MultiTrackerEditor(selected,(List)multiTrackers.get(selected),MultiTrackerPanel.this);
}
});
btnDelete = new Button(panel, SWT.PUSH);
Messages.setLanguageText(btnDelete, "wizard.multitracker.delete");
gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridData.widthHint = 100;
btnDelete.setLayoutData(gridData);
btnDelete.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
int selection = configList.getSelectionIndex();
String selected = configList.getItem(selection);
TrackersUtil.getInstance().removeMultiTracker(selected);
refreshList("");