}
});
*/
centerPn.add(listBoxPnLeft);
mRightButton = new JButton(TVBrowserIcons.right(TVBrowserIcons.SIZE_LARGE));
mRightButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
moveChannelsToRight();
}
});
mLeftButton = new JButton(TVBrowserIcons.left(TVBrowserIcons.SIZE_LARGE));
mLeftButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
moveChannelsToLeft();
}
});
JPanel btnPanel = createButtonPn(mRightButton, mLeftButton);
btnPanel.setBorder(BorderFactory.createEmptyBorder(0, Sizes
.dialogUnitXAsPixel(3, btnPanel), 0, Sizes.dialogUnitXAsPixel(3,
btnPanel)));
listBoxPnLeft.add(btnPanel, BorderLayout.EAST);
// right list box
JPanel listBoxPnRight = new JPanel(new BorderLayout());
SortableItemList channelList = new SortableItemList(new ChannelJList());
mSubscribedChannels = channelList.getList();
mFilter = new ChannelFilter();
mSubscribedChannels.setCellRenderer(new FilteredChannelListCellRenderer(mFilter));
// Register DnD on the lists.
mDnDHandler = new ListDragAndDropHandler(mAllChannels, mSubscribedChannels, this);
mDnDHandler.setPaintCueLine(false, true);
// Register the listener for DnD on the lists.
new DragAndDropMouseListener(mAllChannels, mSubscribedChannels, this,
mDnDHandler);
mSubscribedChannelListener = new DragAndDropMouseListener(
mSubscribedChannels, mAllChannels, this, mDnDHandler);
restoreForPopup();
listBoxPnRight.add(new JScrollPane(mSubscribedChannels),
BorderLayout.CENTER);
final JButton configureChannels = new JButton(mLocalizer.msg(
"configSelectedChannels", "Configure selected channels"));
configureChannels.setEnabled(false);
configureChannels.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
configChannels();
}
});
mSubscribedChannels.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
if (mSubscribedChannels.getSelectedValues().length > 0) {
configureChannels.setEnabled(true);
} else {
configureChannels.setEnabled(false);
}
}
});
// use INSERT key on left side to move selected channels to active channel
// list
mAllChannels.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_INSERT) {
moveChannelsToRight();
}
}
});
// use DELETE key on right side to remove selected channels
mSubscribedChannels.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DELETE) {
moveChannelsToLeft();
}
}
});
JPanel btnPanel2 = createButtonPn(channelList.getTopButton(), channelList
.getUpButton(), channelList.getDownButton(), channelList
.getBottomButton());
btnPanel2.setBorder(BorderFactory.createEmptyBorder(0, Sizes
.dialogUnitXAsPixel(3, btnPanel2), 0, 0));
listBoxPnRight.add(btnPanel2, BorderLayout.EAST);
centerPn.add(listBoxPnRight);
final JPanel result = new JPanel(new BorderLayout());
result.addComponentListener(new ComponentAdapter() {
@Override
public void componentHidden(ComponentEvent e) {
if (e.getComponent() == result) {
mRefreshListTimer = null;
}
}
});
result.add(createFilterPanel(), BorderLayout.NORTH);
result.add(panel, BorderLayout.CENTER);
LinkButton urlLabel = new LinkButton(
mLocalizer
.msg(
"addMoreChannels",
"You want to add your own channels? Click here!"),
mLocalizer.msg("addMoreChannelsUrl",
"http://enwiki.tvbrowser.org/index.php/Available_stations"));
JPanel buttonsPanel = new JPanel(new BorderLayout());
// buttonsPanel.add(pn2, BorderLayout.EAST);
buttonsPanel.add(urlLabel, BorderLayout.SOUTH);
result.add(buttonsPanel, BorderLayout.SOUTH);
JButton refreshList = new JButton(mLocalizer.msg("updateChannelList",
"Update channel list"), TVBrowserIcons.refresh(TVBrowserIcons.SIZE_SMALL));
refreshList.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
refreshChannelList();
}
});