JScrollPane pane = new JScrollPane(mTable);
pane.getViewport().setBackground(mTable.getBackground());
contentPanel.add(pane, cc.xyw(1,3,2));
ButtonBarBuilder2 builder = new ButtonBarBuilder2();
mInfo = new JButton(mLocalizer.msg("info","Info"), IconLoader.getInstance().getIconFromTheme("status", "dialog-information", 16));
mInfo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Object selection = getSelection();
if(selection instanceof PluginProxy) {
showInfoDialog((PluginProxy)selection);
}
else if (selection instanceof InternalPluginProxyIf) {
showInfoDialog((InternalPluginProxyIf)selection);
}
else if (selection instanceof TvDataServiceProxy) {
showInformation((TvDataServiceProxy)selection);
}
}
});
mConfigure = new JButton(mLocalizer.msg("configure", "Configure"), TVBrowserIcons.preferences(TVBrowserIcons.SIZE_SMALL));
mConfigure.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Object selection = getSelection();
if(selection instanceof PluginProxy) {
configurePlugin((PluginProxy)selection);
}
else if (selection instanceof InternalPluginProxyIf) {
mSettingsDialog.showSettingsTab(((InternalPluginProxyIf) selection)
.getSettingsId());
}
else if (selection instanceof TvDataServiceProxy) {
configureService((TvDataServiceProxy)selection);
}
}
});
builder.addButton(mInfo);
builder.addRelatedGap();
builder.addButton(mConfigure);
builder.addRelatedGap();
builder.addGlue();
builder.addRelatedGap();
mRemove = new JButton(Localizer.getLocalization(Localizer.I18N_DELETE),TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
mRemove.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(getSelection() instanceof PluginProxy) {
removePlugin((PluginProxy)getSelection());
}
else {
removeService((TvDataServiceProxy)getSelection());
}
}
});
builder.addButton(mRemove);
contentPanel.add(builder.getPanel(), cc.xyw(1,5,2));
mTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) {
updateBtns();
}