|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.rssowl.controller.dnd.FavoritesTreeDND
Basic Drag and Drop support for the tree holding favorites in RSSOwl.
Currently favorites, categories and blogrolls may be dragged and dropped into
other categories.
The tree is also the drop target for tabs that are dragged to create a new
favorite
Field Summary | |
(package private) org.eclipse.swt.widgets.Item |
dragSourceItem
|
(package private) FavoritesTree |
rssOwlFavoritesTree
|
private org.eclipse.swt.dnd.DragSource |
source
|
(package private) boolean |
sourceIsCategory
|
private org.eclipse.swt.dnd.DropTarget |
target
|
(package private) org.eclipse.swt.widgets.Tree |
tree
|
private static org.eclipse.swt.dnd.Transfer[] |
types
Array of transfer types |
Constructor Summary | |
FavoritesTreeDND(FavoritesTree rssOwlFavoritesTree)
Instantiate a new FavoritesTreeDND |
Method Summary | |
private void |
createDragSource()
Create the Drag Source on the Tree. |
private void |
createDropTarget()
Create the drop target. |
(package private) void |
createFavorite(Favorite rssOwlFavorite,
org.eclipse.swt.widgets.TreeItem parent)
Create a new favorite in the selected category |
void |
dispose()
Dispose DragSource and DragTarget |
org.eclipse.swt.widgets.Item |
getDragSourceItem()
Get the item that is currently being dragged. |
(package private) org.eclipse.swt.widgets.TreeItem |
getValidDragSourceTreeItem()
This method will return the selected treeitem if its a favorite, category or root blogroll. |
private void |
initDragAndDrop()
Init Drag and Drop on the tree widget |
(package private) boolean |
isValidTargetForCategory(org.eclipse.swt.widgets.TreeItem source,
org.eclipse.swt.widgets.TreeItem target,
org.eclipse.swt.dnd.DropTargetEvent event)
Check wether the dragged category is dragged over a valid target category. |
(package private) boolean |
isValidTargetForFavorite(org.eclipse.swt.widgets.TreeItem source,
org.eclipse.swt.widgets.TreeItem target)
Check wether the dragged favorite is dragged over a valid target. |
(package private) void |
moveCategory(String catPath,
org.eclipse.swt.widgets.TreeItem parent)
Move the category specified by the catPath into the treeitem |
(package private) void |
moveCategoryToRoot(String catPath)
Move the category specified by the catPath to the Root of the Tree. |
(package private) void |
moveFavorite(String favoriteTitle,
org.eclipse.swt.widgets.TreeItem parent)
Move the favorite represented by its name into the treeitem which is a category. |
void |
setDragSourceItem(org.eclipse.swt.widgets.Item dragSourceItem)
Set the item that is currently being dragged. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final org.eclipse.swt.dnd.Transfer[] types
private org.eclipse.swt.dnd.DragSource source
private org.eclipse.swt.dnd.DropTarget target
org.eclipse.swt.widgets.Item dragSourceItem
FavoritesTree rssOwlFavoritesTree
boolean sourceIsCategory
org.eclipse.swt.widgets.Tree tree
Constructor Detail |
public FavoritesTreeDND(FavoritesTree rssOwlFavoritesTree)
rssOwlFavoritesTree
- The favorites tree to apply basic drag and drop
supportMethod Detail |
public void dispose()
public org.eclipse.swt.widgets.Item getDragSourceItem()
public void setDragSourceItem(org.eclipse.swt.widgets.Item dragSourceItem)
dragSourceItem
- The dragged itemprivate void createDragSource()
private void createDropTarget()
private void initDragAndDrop()
void createFavorite(Favorite rssOwlFavorite, org.eclipse.swt.widgets.TreeItem parent)
rssOwlFavorite
- The new favorite to createparent
- The category to add the favoriteorg.eclipse.swt.widgets.TreeItem getValidDragSourceTreeItem()
boolean isValidTargetForCategory(org.eclipse.swt.widgets.TreeItem source, org.eclipse.swt.widgets.TreeItem target, org.eclipse.swt.dnd.DropTargetEvent event)
source
- The source treeitemtarget
- The target treeitemevent
- The DropTargetEvent carrying some additional Information
boolean isValidTargetForFavorite(org.eclipse.swt.widgets.TreeItem source, org.eclipse.swt.widgets.TreeItem target)
source
- The source treeitemtarget
- The target treeitem
void moveCategory(String catPath, org.eclipse.swt.widgets.TreeItem parent)
catPath
- Qualified path to the moved categoryparent
- The treeitem to add the category intovoid moveCategoryToRoot(String catPath)
catPath
- Qualified path to the moved categoryvoid moveFavorite(String favoriteTitle, org.eclipse.swt.widgets.TreeItem parent)
favoriteTitle
- The title of the favoriteparent
- The category to move the favorite into
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |