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);