net.sourceforge.rssowl.controller.dnd
Class NewsTabFolderDND

java.lang.Object
  extended by net.sourceforge.rssowl.controller.dnd.NewsTabFolderDND

public class NewsTabFolderDND
extends java.lang.Object

This class impements basic Drag and Drop support to the CTabFolder. It allows the user to drag a tabitem that displays a newsfeed and drop it in a category of the favorites tree. On success RSSOwl will create a favorite out of the URL and title of the dragged tabitem. It is also possible to move the CTabItem to a different position in the Tabfolder by dropping it over another CTabItem.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
private static int operations
          Support drag and drop operations
(package private)  FavoritesTreeDND rssOwlFavoritesTreeDND
           
private  DragSource source
           
(package private)  CTabFolder tabFolder
           
private  DropTarget target
           
private static Transfer[] types
          Array of transfer types
 
Constructor Summary
NewsTabFolderDND(CTabFolder tabFolder, FavoritesTreeDND rssOwlFavoritesTreeDND)
          Instantiate a new NewsTabFolderDND
 
Method Summary
private  void createDragSource()
          Create the Drag Source on the tabfolder
private  void createDropTarget()
          Create the Drop Target on the tabfolder
 void dispose()
          Dispose the DragSource object
(package private)  CTabItem getValidDragSourceTabItem()
          Valid source items to drag from the tabfolder are tabs that display a newsfeed
private  void initDragAndDrop()
          Init Drag and Drop on the tree widget.
(package private)  void move(CTabItem from, CTabItem to)
          Move the given CTabItem to the new position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operations

private static final int operations
Support drag and drop operations


types

private static final Transfer[] types
Array of transfer types


source

private DragSource source

target

private DropTarget target

rssOwlFavoritesTreeDND

FavoritesTreeDND rssOwlFavoritesTreeDND

tabFolder

CTabFolder tabFolder
Constructor Detail

NewsTabFolderDND

public NewsTabFolderDND(CTabFolder tabFolder,
                        FavoritesTreeDND rssOwlFavoritesTreeDND)
Instantiate a new NewsTabFolderDND

Parameters:
tabFolder - The CTabFolder to apply basic drag and drop support
rssOwlFavoritesTreeDND - A reference to the drag and drop class of the favorites tree. This is needed because the drop target will be the tree
Method Detail

dispose

public void dispose()
Dispose the DragSource object


createDragSource

private void createDragSource()
Create the Drag Source on the tabfolder


createDropTarget

private void createDropTarget()
Create the Drop Target on the tabfolder


initDragAndDrop

private void initDragAndDrop()
Init Drag and Drop on the tree widget. Note that the Drop target is created in the DND class of the favorites tree


getValidDragSourceTabItem

CTabItem getValidDragSourceTabItem()
Valid source items to drag from the tabfolder are tabs that display a newsfeed

Returns:
CTabItem The dragged tabitem or null if the tab is not valid to be dragged

move

void move(CTabItem from,
          CTabItem to)
Move the given CTabItem to the new position.

Parameters:
from - The CTabItem to move.
to - The new location of the CTabItem to move.


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo