Messages.setLanguageText(btnUnload, "ConfigView.pluginlist.unloadSelected");
btnUnload.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
final int[] items = table.getSelectionIndices();
new AEThread2( "unload" ){
public void
run()
{
for (int i = 0; i < items.length; i++) {
int index = items[i];
if (index >= 0 && index < pluginIFs.size()) {
PluginInterface pluginIF = (PluginInterface) pluginIFs.get(index);
if (pluginIF.getPluginState().isOperational()) {
if (pluginIF.getPluginState().isUnloadable()) {
try {
pluginIF.getPluginState().unload();
} catch (PluginException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
Utils.execSWTThread(
new Runnable()
{
public void
run()
{
pluginIFs = rebuildPluginIFs();
table.setItemCount(pluginIFs.size());
Collections.sort(pluginIFs, comparator);
table.clearAll();
}
});
}
}
}
}.start();
}
});
btnUnload.setEnabled( false );
final Button btnLoad = new Button(cButtons, SWT.PUSH);
btnUnload.setLayoutData(new GridData());
Messages.setLanguageText(btnLoad, "ConfigView.pluginlist.loadSelected");
btnLoad.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
final int[] items = table.getSelectionIndices();
new AEThread2( "load" ){
public void
run()
{
for (int i = 0; i < items.length; i++) {
int index = items[i];