GridLayout layout = new GridLayout();
layout.numColumns = 1;
rootPanel.setLayout(layout);
Composite panel = new Composite(rootPanel, SWT.NULL);
GridData gridData = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
panel.setLayoutData(gridData);
layout = new GridLayout();
layout.numColumns = 3;
panel.setLayout(layout);
//Line :
// Multi-Tracker Configuration
final Label labelTitle = new Label(panel,SWT.NULL);
Messages.setLanguageText(labelTitle, "wizard.multitracker.configuration");
gridData = new GridData();
gridData.horizontalSpan = 3;
labelTitle.setLayoutData(gridData);
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("");
refreshDetails();
setEditDeleteEnable();
}
});
final Label labelSeparator = new Label(panel,SWT.SEPARATOR | SWT.HORIZONTAL);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 3;
labelSeparator.setLayoutData(gridData);
configDetails = new Tree(panel,SWT.BORDER);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.heightHint = 150;
gridData.horizontalSpan = 3;
configDetails.setLayoutData(gridData);
refreshList(((NewTorrentWizard)wizard).multiTrackerConfig);