*
* @param e action event details object.
*/
public void actionPerformed(ActionEvent e)
{
final IFeed feed = GlobalModel.SINGLETON.getSelectedFeed();
final IGuide guide = GlobalModel.SINGLETON.getSelectedGuide();
// Reorderings are allowed only for standard guides
if (!(guide instanceof StandardGuide)) return;
StandardGuide sguide = (StandardGuide)guide;
final GuideModel model = GlobalModel.SINGLETON.getGuideModel();
// Move channel up one step if it's not already top-most.
final int index = model.indexOf(feed);
if (feed != null && index > 0)
{
// Get real index
IFeed entry = (IFeed)model.getElementAt(index - 1);
int realIndex = guide.indexOf(entry);
// This selection clearing is mandatory. When we kill the last channel in the list
// by moving it up selection moves out of bounds. To prevent this error we
// need to disable selection prior to moving channel.