|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.rssowl.controller.FavoritesTree
This is the Tree that holds the categorys and its RSS favorites.
Field Summary | |
private org.eclipse.swt.widgets.ToolItem |
aggregateAll
|
private org.eclipse.swt.widgets.ToolItem |
closeControllsToolItem
|
private org.eclipse.swt.widgets.MenuItem |
closeMenuItem
|
(package private) org.eclipse.swt.custom.SashForm |
contentPane
|
private boolean |
deletionInProgress
|
private org.eclipse.swt.widgets.Display |
display
|
(package private) EventManager |
eventManager
|
(package private) org.eclipse.swt.widgets.Tree |
favoritesTree
|
private org.eclipse.swt.widgets.Composite |
favoritesTreeHolder
|
private org.eclipse.swt.widgets.ToolItem |
markAllRead
|
private org.eclipse.swt.widgets.ToolItem |
reloadAll
|
(package private) org.eclipse.swt.widgets.Composite |
renameEditorContainer
|
private FavoritesTreeDND |
rssOwlFavoritesTreeDND
|
(package private) GUI |
rssOwlGui
|
private FavoritesTreePopup |
rssOwlPopUpMenu
|
private org.eclipse.swt.widgets.ToolItem |
searchAll
|
(package private) org.eclipse.swt.widgets.Shell |
shell
|
(package private) org.eclipse.swt.widgets.MenuItem |
toggleToolBarMenuItem
|
private org.eclipse.swt.widgets.Menu |
topToolBarMenu
|
(package private) org.eclipse.swt.custom.TreeEditor |
treeEditor
|
private ViewForm |
treeViewForm
|
private org.eclipse.swt.widgets.Composite |
treeViewFormCenterHeader
|
private org.eclipse.swt.widgets.Label |
treeViewFormHeaderLabel
|
private org.eclipse.swt.widgets.Composite |
treeViewFormLeftHeader
|
Constructor Summary | |
FavoritesTree(org.eclipse.swt.widgets.Display display,
org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.custom.SashForm contentPane,
GUI rssOwlGui,
EventManager eventManager)
Instantiate a new FavoritesTree |
Method Summary | |
void |
addCategory(String name,
Category parentCat)
Add a new category to the Tree |
private void |
addCategoryOrFavorite(Hashtable favoritOrCategory,
TreeSet sortedTitles,
org.eclipse.swt.widgets.Widget parent,
Category rssOwlCategory)
Recursivly add Favorites and Categorys to the URL Tree. |
void |
addFavorite(Category selectedCat,
String link,
String title,
Favorite oldFavorite)
Add a new Favorite to the Tree |
void |
addFavorite(String catPath,
String link,
String title,
Favorite oldFavorite)
Add a new Favorite to the Tree |
private org.eclipse.swt.widgets.TreeItem |
addTreeItem(String name,
org.eclipse.swt.graphics.Image icon,
String catName,
org.eclipse.swt.widgets.Widget parent,
boolean isBlogroll,
int unreadNewsCount)
Insert a new item into the favorites tree. |
void |
appendUnreadCount(org.eclipse.swt.widgets.TreeItem treeItem,
String name,
int unreadCount)
This Method will append the given unread-count to the TreeItem's name. |
void |
buildFavoritesTree()
Build the complete favorites Tree from the RSSOwlFavTree. |
void |
createAmphetaRateFeed()
Creates or updates the AmphetaRate feed |
(package private) void |
createPopUpMenu()
Create a new popup menuStructure |
org.eclipse.swt.widgets.Tree |
getFavoritesTree()
Let other objects access this controll (for example to focus on it) |
FavoritesTreeDND |
getRSSOwlFavoritesTreeDND()
Get the DND class that allows drag and drop on this favorites tree |
Category |
getSelectedCat()
Get the selected category |
Category |
getSelectedCat(String path)
Get the selected category from the given path |
Favorite |
getSelectedFav()
Get the selected favorite |
(package private) TreeItemData |
getSelectedTreeItemData()
Get the current selected TreeItem's data. |
boolean |
getTreeHasUnreadFavs()
Check if RSSOwl contains favorites with unread news |
String |
getTreePath(boolean skipFavorite)
Return the TreePath of the selected TreeItem |
String |
getTreePath(org.eclipse.swt.widgets.TreeItem selectedTree,
boolean skipFavorite)
Return the TreePath of the selected TreeItem |
void |
handleTreeItemSelect(boolean isSingleClick)
Open the newsfeed if the user has clicked on a favorite. |
private void |
initComponents()
Init all components |
private void |
initTopContextMenu(org.eclipse.swt.widgets.Control parent)
Initialize the Context Menu that toggles visibility of the Favorites Tree ToolBar and allows to Close the Favorites Tree. |
(package private) void |
onKeyPressed(org.eclipse.swt.events.KeyEvent e)
Called whenever a Key is pressed on the Tree |
(package private) void |
onMouseDoubleClick(org.eclipse.swt.widgets.Event event)
The tree was doubleclicked with the mouse |
(package private) void |
onMouseUp(org.eclipse.swt.events.MouseEvent event)
The favorites tree was selected with the Mouse |
(package private) void |
onSelection()
The tree was selected |
(package private) void |
onTreeEvent(org.eclipse.swt.events.TreeEvent e,
boolean expanded)
Called whenever a TreeItem is expanded |
(package private) void |
performDeletion()
Delete selected cat or fav or sub |
private void |
rename(org.eclipse.swt.widgets.TreeItem item)
Open an in-place Text editor field to rename the given TreeItem. |
(package private) void |
renameCategory(Category category,
String newTitle)
Rename the given Category using the new title |
(package private) void |
renameFavorite(Favorite favorite,
String newTitle)
Rename the given Favorite using the new title |
(package private) void |
renameSelectedItem()
Rename the selected TreeItem (in place) |
private void |
restoreExpanded(org.eclipse.swt.widgets.TreeItem[] items,
Category rssOwlCategory)
Recursivly restore expanded status for the TreeItems |
private void |
restoreSelection(String path)
Restore selection of given treepath |
void |
setShowToolBar(boolean show)
Toggles the visibility of the Tree ToolBar. |
void |
stopRenaming()
Disposes the Container for the Text Control that is used when the user is going to Rename an Item of the Tree in place. |
void |
updateFonts()
All implementing classes must provide a method to update the fonts of all GUI elements that provide a setFont() Method. |
void |
updateI18N()
Update all controlls text with i18n |
void |
updateTreeItemIcon(org.eclipse.swt.widgets.TreeItem treeItem)
Update the icon on a TreeItem in dependance of the "isError" flag. |
void |
updateTreeReadStatus(org.eclipse.swt.widgets.TreeItem treeItem)
Recursivly update all parent categories of the given TreeItem to set / unset the unread status, which is indicated by a slightly different category icon. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.eclipse.swt.widgets.ToolItem aggregateAll
private org.eclipse.swt.widgets.ToolItem closeControllsToolItem
private org.eclipse.swt.widgets.MenuItem closeMenuItem
private boolean deletionInProgress
private org.eclipse.swt.widgets.Display display
private org.eclipse.swt.widgets.Composite favoritesTreeHolder
private org.eclipse.swt.widgets.ToolItem markAllRead
private org.eclipse.swt.widgets.ToolItem reloadAll
private FavoritesTreeDND rssOwlFavoritesTreeDND
private FavoritesTreePopup rssOwlPopUpMenu
private org.eclipse.swt.widgets.ToolItem searchAll
private org.eclipse.swt.widgets.Menu topToolBarMenu
private ViewForm treeViewForm
private org.eclipse.swt.widgets.Composite treeViewFormCenterHeader
private org.eclipse.swt.widgets.Label treeViewFormHeaderLabel
private org.eclipse.swt.widgets.Composite treeViewFormLeftHeader
org.eclipse.swt.custom.SashForm contentPane
EventManager eventManager
org.eclipse.swt.widgets.Tree favoritesTree
org.eclipse.swt.widgets.Composite renameEditorContainer
GUI rssOwlGui
org.eclipse.swt.widgets.Shell shell
org.eclipse.swt.widgets.MenuItem toggleToolBarMenuItem
org.eclipse.swt.custom.TreeEditor treeEditor
Constructor Detail |
public FavoritesTree(org.eclipse.swt.widgets.Display display, org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.custom.SashForm contentPane, GUI rssOwlGui, EventManager eventManager)
display
- The displayshell
- The shellcontentPane
- The Sashform where to add the URL-TreerssOwlGui
- Access some methods of the main controllereventManager
- The event managerMethod Detail |
public void addCategory(String name, Category parentCat)
name
- Name of the categoryparentCat
- The Parent categorypublic void addFavorite(Category selectedCat, String link, String title, Favorite oldFavorite)
selectedCat
- The category to add this favorite intolink
- Link to the XMLtitle
- Desired Title of the FavoriteoldFavorite
- If this field is not NULL the oldFavorite is being
updated and given as parameter to clone its settingspublic void addFavorite(String catPath, String link, String title, Favorite oldFavorite)
catPath
- Name of the Categorylink
- Link to the XMLtitle
- Desired Title of the FavoriteoldFavorite
- If this field is not NULL the oldFavorite is being
updated and given as parameter to clone its settingspublic void appendUnreadCount(org.eclipse.swt.widgets.TreeItem treeItem, String name, int unreadCount)
treeItem
- The TreeItem that is to be changed.name
- The Name of the TreeItem.unreadCount
- The Number to append to the Name.public void buildFavoritesTree()
public void createAmphetaRateFeed()
public org.eclipse.swt.widgets.Tree getFavoritesTree()
public FavoritesTreeDND getRSSOwlFavoritesTreeDND()
public Category getSelectedCat()
public Category getSelectedCat(String path)
path
- Path to the category (e.g. "Test > Sub1 > Sub2")
public Favorite getSelectedFav()
public boolean getTreeHasUnreadFavs()
public String getTreePath(boolean skipFavorite)
skipFavorite
- TRUE if a favorite does not count as selection in the
path
public String getTreePath(org.eclipse.swt.widgets.TreeItem selectedTree, boolean skipFavorite)
selectedTree
- The selected TreeItemskipFavorite
- TRUE if a favorite does not count as selection in the
path
public void handleTreeItemSelect(boolean isSingleClick)
isSingleClick
- if TRUE, the selection was made with a single clickpublic void setShowToolBar(boolean show)
show
- If TRUE, show the Tree ToolBar.public void stopRenaming()
public void updateFonts()
IFontChangeable
updateFonts
in interface IFontChangeable
IFontChangeable.updateFonts()
public void updateI18N()
updateI18N
in interface ITranslatable
public void updateTreeItemIcon(org.eclipse.swt.widgets.TreeItem treeItem)
treeItem
- The TreeItem to updatepublic void updateTreeReadStatus(org.eclipse.swt.widgets.TreeItem treeItem)
treeItem
- The starting point TreeItemprivate void addCategoryOrFavorite(Hashtable favoritOrCategory, TreeSet sortedTitles, org.eclipse.swt.widgets.Widget parent, Category rssOwlCategory)
favoritOrCategory
- contains favorites or categoryssortedTitles
- Sorted Titles of favorits or categorysparent
- The parent Widget of the new treeitemsrssOwlCategory
- Current categoryprivate org.eclipse.swt.widgets.TreeItem addTreeItem(String name, org.eclipse.swt.graphics.Image icon, String catName, org.eclipse.swt.widgets.Widget parent, boolean isBlogroll, int unreadNewsCount)
name
- Name of the Itemicon
- Icon (for example folder)catName
- Name of the categoryparent
- The parent of the new treeitemisBlogroll
- TRUE if favorite is from a blogrollunreadNewsCount
- The Number of unread News, or 0 if none.
private void initComponents()
private void initTopContextMenu(org.eclipse.swt.widgets.Control parent)
parent
- The Parent Control to create the Menu.private void rename(org.eclipse.swt.widgets.TreeItem item)
item
- The TreeItem to renameprivate void restoreExpanded(org.eclipse.swt.widgets.TreeItem[] items, Category rssOwlCategory)
items
- The TreeItemsrssOwlCategory
- Current working categoryprivate void restoreSelection(String path)
path
- The path to the selected itemvoid createPopUpMenu()
TreeItemData getSelectedTreeItemData()
void onKeyPressed(org.eclipse.swt.events.KeyEvent e)
e
- The occuring KeyEventvoid onMouseDoubleClick(org.eclipse.swt.widgets.Event event)
event
- The occured eventvoid onMouseUp(org.eclipse.swt.events.MouseEvent event)
event
- The occured mouse eventvoid onSelection()
void onTreeEvent(org.eclipse.swt.events.TreeEvent e, boolean expanded)
e
- The occuring TreeEventexpanded
- If TRUE the TreeItem was expandedvoid performDeletion()
void renameCategory(Category category, String newTitle)
category
- The category to renamenewTitle
- The new title of the categoryvoid renameFavorite(Favorite favorite, String newTitle)
favorite
- The favorite to renamenewTitle
- The new title of the favoritevoid renameSelectedItem()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |