net.sourceforge.rssowl.controller
Class MenuManager

java.lang.Object
  extended by net.sourceforge.rssowl.controller.MenuManager

public class MenuManager
extends java.lang.Object

The MenuManager manages the disabled / enabled state of some MenuItems and ToolItems. For example, if no news is opened in the TabFolder, MenuItems like Export get disabled.

Version:
1.2.4
Author:
Benjamin Pasero

Field Summary
private static MenuItem addFavoriteMenu
           
private static MenuItem blogNews
           
private static MenuItem closeAllTabs
           
private static ToolItem closeAllTabsToolItem
           
private static MenuItem closeCurrentTab
           
private static ToolItem closeOtherTabsToolItem
           
private static ToolItem closeTabToolItem
           
private static MenuItem copy
           
private static MenuItem copyUrlItem
           
private static MenuItem cut
           
private static MenuItem delete
           
(package private) static int EMPTY_SEARCH_TAB
          A search did not brought any results
private static MenuItem exportHTML
           
private static MenuItem exportMenuItem
           
private static MenuItem exportPDF
           
private static MenuItem exportRTF
           
private static ToolItem exportToolItem
           
private static MenuItem gotoNextTab
           
private static ToolItem gotoNextTabToolItem
           
private static MenuItem gotoPreviousTab
           
private static ToolItem gotoPreviousTabToolItem
           
private static boolean isCloseAllTabsToolItemEnabled
           
private static boolean isCloseOtherTabsToolItemEnabled
           
private static boolean isCloseTabToolItemEnabled
           
private static boolean isExportToolItemEnabled
           
private static boolean isMarkAllReadToolItemEnabled
           
private static boolean isNewCategorySubMenuItemEnabled
           
private static boolean isNewsTipToolItemEnabled
           
private static boolean isNewSubCategorySubMenuItemEnabled
           
private static boolean isNextTabToolItemEnabled
           
private static boolean isPreviousTabToolItemEnabled
           
private static boolean isReloadToolItemEnabled
           
private static boolean isSearchToolItemEnabled
           
private static Text liveSearch
           
private static MenuItem mailLinkToFriend
           
private static MenuItem markAllReadItem
           
private static ToolItem markAllReadToolItem
           
private static MenuItem markUnreadItem
           
(package private) static int MORE_THAN_ONE_TAB_OPENED
          More than one tab
private static MenuItem newCategory
           
private static MenuItem newCategorySubMenuItem
           
(package private) static int NEWS_HEADER_SELECTED
          State: Tab is displaying news and a header is selected
(package private) static int NEWS_TEXT_EMPTY
          State: Newstext view is empty
(package private) static int NEWS_TEXT_FILLED
          State: Newstext view is filled with text
private static ToolItem newsTipToolItem
           
private static MenuItem newSubCategory
           
private static MenuItem newSubCategorySubMenuItem
           
(package private) static int ONE_ZERO_TAB_OPENED
          Only one tab or less opened
private static MenuItem paste
           
private static MenuItem print
           
private static MenuItem properties
           
private static MenuItem readNewsInHTML
           
private static MenuItem readNewsInPDF
           
private static MenuItem readNewsInRTF
           
private static MenuItem reload
           
private static ToolItem reloadToolItem
           
private static MenuItem saveRSS
           
private static MenuItem search
           
private static ToolItem searchToolItem
           
private static MenuItem selectAll
           
(package private) static int TAB_EMPTY
          State: Tab is not displaying any tab
(package private) static int TAB_ERROR
          State: Tab is not displaying an warning
(package private) static int TAB_FILLED_WITH_NEWS
          State: Tab is displaying a newsfeed
(package private) static int TAB_NO_NEWS
          State: Tab is not displaying a newsfeed
(package private) static int TREE_SELECTION_BLOGROLL_CAT
          State: Tree Selection is a Blogroll Category
(package private) static int TREE_SELECTION_BLOGROLL_FAV
          State: Tree Selection is a Blogroll Favorite
(package private) static int TREE_SELECTION_CATEGORY
          State: Tree Selection is a Category
(package private) static int TREE_SELECTION_EMPTY
          State: Tree Selection is Empty
(package private) static int TREE_SELECTION_FAVORITE
          State: Tree Selection is a Favorite
 
Constructor Summary
private MenuManager()
          This utility class constructor is hidden
 
Method Summary
private static void disableGeneralItems()
          These method disables general menuitems of the main menu in RSSOwl.
static void handleEditMenuState()
          Check the selected Control and enable / disable MenuItems from the edit menu in dependance of the selected Control.
static void initMnemonics(Menu menu)
          Init the mnemonics for the given Menu
(package private) static void initMnemonics(MenuItem[] items)
          Recursivly sets the mnemonic for each Menu and MenuItem.
(package private) static void notifyState(int state)
          Notify about a new State.
(package private) static void regiserBlogNews(MenuItem blogNews)
          Register a menuitem to the MenuManager
(package private) static void regiserLiveSearch(Text liveSearch)
          Register a Text input field to the MenuManager
(package private) static void regiserPrint(MenuItem print)
          Register a menuitem to the MenuManager
(package private) static void registerAddFavoriteMenu(MenuItem addFavoriteMenu)
          Register a menuitem to the MenuManager
(package private) static void registerCloseAllTabsToolItem(ToolItem closeAllTabsToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerCloseOtherTabsToolItem(ToolItem closeOtherTabsToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerCloseTab(MenuItem closeCurrentTab, MenuItem closeAllTabs)
          Register menuitems to the MenuManager
(package private) static void registerCloseTabToolItem(ToolItem closeTabToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerCopyLink(MenuItem copyUrlItem)
          Register a menuitem to the MenuManager
(package private) static void registerEditMenu(MenuItem copy, MenuItem paste, MenuItem cut, MenuItem selectAll, MenuItem delete, MenuItem properties)
          Register the "Edit" Menu to the MenuManager
(package private) static void registerExport(MenuItem exportPDF, MenuItem exportRTF, MenuItem exportHTML)
          Register menuitems to the MenuManager
(package private) static void registerExportMenuItem(MenuItem exportMenuItem)
          Register menuitems to the MenuManager
(package private) static void registerExportToolItem(ToolItem exportToolItem)
          Register toolitems to the MenuManager
(package private) static void registerGotoNextTabToolItem(ToolItem gotoNextTabToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerGotoPreviousTabToolItem(ToolItem gotoPreviousTabToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerGotoTab(MenuItem gotoPreviousTab, MenuItem gotoNextUnreadTab)
          Register menuitems to the MenuManager
(package private) static void registerMarkAllReadItem(MenuItem markAllReadItem)
          Register a menuitem to the MenuManager
(package private) static void registerMarkAllReadToolItem(ToolItem markAllReadToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerMarkUnreadItem(MenuItem markUnreadItem)
          Register a menuitem to the MenuManager
(package private) static void registerNewItems(MenuItem newCategory, MenuItem newSubCategory)
          Register menuitems to the MenuManager
(package private) static void registerNewsTipMail(MenuItem mailLinkToFriend)
          Register a menuitem to the MenuManager
(package private) static void registerNewsTipToolItem(ToolItem newsTipToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerNewSubMenuItems(MenuItem newCategorySubMenuItem, MenuItem newSubCategorySubMenuItem)
          Register menuitems to the MenuManager.
(package private) static void registerReadNewsInDocument(MenuItem readNewsInPDF, MenuItem readNewsInRTF, MenuItem readNewsInHTML)
          Register menuitems to the MenuManager
(package private) static void registerReload(MenuItem reload)
          Register a menuitem to the MenuManager
(package private) static void registerReloadToolItem(ToolItem reloadToolItem)
          Register a toolitem to the MenuManager
(package private) static void registerSaveRSS(MenuItem saveRSS)
          Register a menuitem to the MenuManager
(package private) static void registerSearch(MenuItem search)
          Register a menuitem to the MenuManager
(package private) static void registerSearchToolItem(ToolItem searchToolItem)
          Register a toolitem to the MenuManager
private static void setEditMenuDisabled()
          Disable all of the MenuItems in the Edit Menu
private static void setEditMenuEnabled(boolean cut, boolean copy, boolean delete, boolean paste, boolean selectAll, boolean properties)
          Set the state of the MenuItems in the Edit Menu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addFavoriteMenu

private static MenuItem addFavoriteMenu

blogNews

private static MenuItem blogNews

closeAllTabs

private static MenuItem closeAllTabs

closeAllTabsToolItem

private static ToolItem closeAllTabsToolItem

closeCurrentTab

private static MenuItem closeCurrentTab

closeOtherTabsToolItem

private static ToolItem closeOtherTabsToolItem

closeTabToolItem

private static ToolItem closeTabToolItem

copy

private static MenuItem copy

copyUrlItem

private static MenuItem copyUrlItem

cut

private static MenuItem cut

delete

private static MenuItem delete

exportHTML

private static MenuItem exportHTML

exportMenuItem

private static MenuItem exportMenuItem

exportPDF

private static MenuItem exportPDF

exportRTF

private static MenuItem exportRTF

exportToolItem

private static ToolItem exportToolItem

gotoNextTab

private static MenuItem gotoNextTab

gotoNextTabToolItem

private static ToolItem gotoNextTabToolItem

gotoPreviousTab

private static MenuItem gotoPreviousTab

gotoPreviousTabToolItem

private static ToolItem gotoPreviousTabToolItem

isCloseAllTabsToolItemEnabled

private static boolean isCloseAllTabsToolItemEnabled

isCloseOtherTabsToolItemEnabled

private static boolean isCloseOtherTabsToolItemEnabled

isCloseTabToolItemEnabled

private static boolean isCloseTabToolItemEnabled

isExportToolItemEnabled

private static boolean isExportToolItemEnabled

isMarkAllReadToolItemEnabled

private static boolean isMarkAllReadToolItemEnabled

isNewCategorySubMenuItemEnabled

private static boolean isNewCategorySubMenuItemEnabled

isNewsTipToolItemEnabled

private static boolean isNewsTipToolItemEnabled

isNewSubCategorySubMenuItemEnabled

private static boolean isNewSubCategorySubMenuItemEnabled

isNextTabToolItemEnabled

private static boolean isNextTabToolItemEnabled

isPreviousTabToolItemEnabled

private static boolean isPreviousTabToolItemEnabled

isReloadToolItemEnabled

private static boolean isReloadToolItemEnabled

isSearchToolItemEnabled

private static boolean isSearchToolItemEnabled

liveSearch

private static Text liveSearch

mailLinkToFriend

private static MenuItem mailLinkToFriend

markAllReadItem

private static MenuItem markAllReadItem

markAllReadToolItem

private static ToolItem markAllReadToolItem

markUnreadItem

private static MenuItem markUnreadItem

newCategory

private static MenuItem newCategory

newCategorySubMenuItem

private static MenuItem newCategorySubMenuItem

newsTipToolItem

private static ToolItem newsTipToolItem

newSubCategory

private static MenuItem newSubCategory

newSubCategorySubMenuItem

private static MenuItem newSubCategorySubMenuItem

paste

private static MenuItem paste

print

private static MenuItem print

properties

private static MenuItem properties

readNewsInHTML

private static MenuItem readNewsInHTML

readNewsInPDF

private static MenuItem readNewsInPDF

readNewsInRTF

private static MenuItem readNewsInRTF

reload

private static MenuItem reload

reloadToolItem

private static ToolItem reloadToolItem

saveRSS

private static MenuItem saveRSS

search

private static MenuItem search

searchToolItem

private static ToolItem searchToolItem

selectAll

private static MenuItem selectAll

EMPTY_SEARCH_TAB

static final int EMPTY_SEARCH_TAB
A search did not brought any results

See Also:
Constant Field Values

MORE_THAN_ONE_TAB_OPENED

static final int MORE_THAN_ONE_TAB_OPENED
More than one tab

See Also:
Constant Field Values

NEWS_HEADER_SELECTED

static final int NEWS_HEADER_SELECTED
State: Tab is displaying news and a header is selected

See Also:
Constant Field Values

NEWS_TEXT_EMPTY

static final int NEWS_TEXT_EMPTY
State: Newstext view is empty

See Also:
Constant Field Values

NEWS_TEXT_FILLED

static final int NEWS_TEXT_FILLED
State: Newstext view is filled with text

See Also:
Constant Field Values

ONE_ZERO_TAB_OPENED

static final int ONE_ZERO_TAB_OPENED
Only one tab or less opened

See Also:
Constant Field Values

TAB_EMPTY

static final int TAB_EMPTY
State: Tab is not displaying any tab

See Also:
Constant Field Values

TAB_ERROR

static final int TAB_ERROR
State: Tab is not displaying an warning

See Also:
Constant Field Values

TAB_FILLED_WITH_NEWS

static final int TAB_FILLED_WITH_NEWS
State: Tab is displaying a newsfeed

See Also:
Constant Field Values

TAB_NO_NEWS

static final int TAB_NO_NEWS
State: Tab is not displaying a newsfeed

See Also:
Constant Field Values

TREE_SELECTION_BLOGROLL_CAT

static final int TREE_SELECTION_BLOGROLL_CAT
State: Tree Selection is a Blogroll Category

See Also:
Constant Field Values

TREE_SELECTION_BLOGROLL_FAV

static final int TREE_SELECTION_BLOGROLL_FAV
State: Tree Selection is a Blogroll Favorite

See Also:
Constant Field Values

TREE_SELECTION_CATEGORY

static final int TREE_SELECTION_CATEGORY
State: Tree Selection is a Category

See Also:
Constant Field Values

TREE_SELECTION_EMPTY

static final int TREE_SELECTION_EMPTY
State: Tree Selection is Empty

See Also:
Constant Field Values

TREE_SELECTION_FAVORITE

static final int TREE_SELECTION_FAVORITE
State: Tree Selection is a Favorite

See Also:
Constant Field Values
Constructor Detail

MenuManager

private MenuManager()
This utility class constructor is hidden

Method Detail

initMnemonics

public static void initMnemonics(Menu menu)
Init the mnemonics for the given Menu

Parameters:
menu - The Menu to init the Mnemonics

disableGeneralItems

private static void disableGeneralItems()
These method disables general menuitems of the main menu in RSSOwl.


setEditMenuDisabled

private static void setEditMenuDisabled()
Disable all of the MenuItems in the Edit Menu


setEditMenuEnabled

private static void setEditMenuEnabled(boolean cut,
                                       boolean copy,
                                       boolean delete,
                                       boolean paste,
                                       boolean selectAll,
                                       boolean properties)
Set the state of the MenuItems in the Edit Menu

Parameters:
cut - Enabled if TRUE
copy - Enabled if TRUE
delete - Enabled if TRUE
paste - Enabled if TRUE
selectAll - Enabled if TRUE
properties - Enabled if TRUE

handleEditMenuState

public static void handleEditMenuState()
Check the selected Control and enable / disable MenuItems from the edit menu in dependance of the selected Control.


initMnemonics

static void initMnemonics(MenuItem[] items)
Recursivly sets the mnemonic for each Menu and MenuItem. The method trys to set a mnemonic that has not yet been set (trys all chars of the name).

Parameters:
items - The MenuItems

notifyState

static void notifyState(int state)
Notify about a new State.

Parameters:
state - One of the state constants

regiserBlogNews

static void regiserBlogNews(MenuItem blogNews)
Register a menuitem to the MenuManager

Parameters:
blogNews - The MenuItem "Blog News"

regiserLiveSearch

static void regiserLiveSearch(Text liveSearch)
Register a Text input field to the MenuManager

Parameters:
liveSearch - The live search Text field

regiserPrint

static void regiserPrint(MenuItem print)
Register a menuitem to the MenuManager

Parameters:
print - The MenuItem "Print"

registerAddFavoriteMenu

static void registerAddFavoriteMenu(MenuItem addFavoriteMenu)
Register a menuitem to the MenuManager

Parameters:
addFavoriteMenu - The MenuItem "Add to favorits"

registerCloseAllTabsToolItem

static void registerCloseAllTabsToolItem(ToolItem closeAllTabsToolItem)
Register a toolitem to the MenuManager

Parameters:
closeAllTabsToolItem - The ToolItem "Close All"

registerCloseOtherTabsToolItem

static void registerCloseOtherTabsToolItem(ToolItem closeOtherTabsToolItem)
Register a toolitem to the MenuManager

Parameters:
closeOtherTabsToolItem - The ToolItem "Close Others"

registerCloseTab

static void registerCloseTab(MenuItem closeCurrentTab,
                             MenuItem closeAllTabs)
Register menuitems to the MenuManager

Parameters:
closeCurrentTab - The MenuItem "Close"
closeAllTabs - The MenuItem "Close all"

registerCloseTabToolItem

static void registerCloseTabToolItem(ToolItem closeTabToolItem)
Register a toolitem to the MenuManager

Parameters:
closeTabToolItem - The ToolItem "Close"

registerCopyLink

static void registerCopyLink(MenuItem copyUrlItem)
Register a menuitem to the MenuManager

Parameters:
copyUrlItem - The MenuItem "Copy URL"

registerEditMenu

static void registerEditMenu(MenuItem copy,
                             MenuItem paste,
                             MenuItem cut,
                             MenuItem selectAll,
                             MenuItem delete,
                             MenuItem properties)
Register the "Edit" Menu to the MenuManager

Parameters:
copy - The MenuItem "Copy"
paste - The MenuItem "Paste"
cut - The MenuItem "Cut"
selectAll - The MenuItem "Select All"
delete - The MenuItem "Delete"
properties - The MenuItem "Properties"

registerExport

static void registerExport(MenuItem exportPDF,
                           MenuItem exportRTF,
                           MenuItem exportHTML)
Register menuitems to the MenuManager

Parameters:
exportPDF - The MenuItem "Export to PDF"
exportRTF - The MenuItem "Export to RTF"
exportHTML - The MenuItem "Export to HTML"

registerExportMenuItem

static void registerExportMenuItem(MenuItem exportMenuItem)
Register menuitems to the MenuManager

Parameters:
exportMenuItem - The MenuItem "Export"

registerExportToolItem

static void registerExportToolItem(ToolItem exportToolItem)
Register toolitems to the MenuManager

Parameters:
exportToolItem - The ToolItem "Export"

registerGotoNextTabToolItem

static void registerGotoNextTabToolItem(ToolItem gotoNextTabToolItem)
Register a toolitem to the MenuManager

Parameters:
gotoNextTabToolItem - The ToolItem "Next Tab"

registerGotoPreviousTabToolItem

static void registerGotoPreviousTabToolItem(ToolItem gotoPreviousTabToolItem)
Register a toolitem to the MenuManager

Parameters:
gotoPreviousTabToolItem - The ToolItem "Previous Tab"

registerGotoTab

static void registerGotoTab(MenuItem gotoPreviousTab,
                            MenuItem gotoNextUnreadTab)
Register menuitems to the MenuManager

Parameters:
gotoPreviousTab - The MenuItem "Previous tab"
gotoNextUnreadTab - The MenuItem "Next tab"

registerMarkAllReadItem

static void registerMarkAllReadItem(MenuItem markAllReadItem)
Register a menuitem to the MenuManager

Parameters:
markAllReadItem - The MenuItem "Mark All Read"

registerMarkAllReadToolItem

static void registerMarkAllReadToolItem(ToolItem markAllReadToolItem)
Register a toolitem to the MenuManager

Parameters:
markAllReadToolItem - The ToolItem "Mark All Read"

registerMarkUnreadItem

static void registerMarkUnreadItem(MenuItem markUnreadItem)
Register a menuitem to the MenuManager

Parameters:
markUnreadItem - The MenuItem "Mark unread"

registerNewItems

static void registerNewItems(MenuItem newCategory,
                             MenuItem newSubCategory)
Register menuitems to the MenuManager

Parameters:
newCategory - The MenuItem "New Category"
newSubCategory - The MenuItem "New Sub-Category"

registerNewsTipMail

static void registerNewsTipMail(MenuItem mailLinkToFriend)
Register a menuitem to the MenuManager

Parameters:
mailLinkToFriend - The MenuItem "Mail NewsTip"

registerNewsTipToolItem

static void registerNewsTipToolItem(ToolItem newsTipToolItem)
Register a toolitem to the MenuManager

Parameters:
newsTipToolItem - The ToolItem "Mail NewsTip"

registerNewSubMenuItems

static void registerNewSubMenuItems(MenuItem newCategorySubMenuItem,
                                    MenuItem newSubCategorySubMenuItem)
Register menuitems to the MenuManager. These come from the "New"-Dropdown of the ToolBar.

Parameters:
newCategorySubMenuItem - The Sub-Menu "New Category"
newSubCategorySubMenuItem - The Sub-Menu "New Sub-Category"

registerReadNewsInDocument

static void registerReadNewsInDocument(MenuItem readNewsInPDF,
                                       MenuItem readNewsInRTF,
                                       MenuItem readNewsInHTML)
Register menuitems to the MenuManager

Parameters:
readNewsInPDF - The MenuItem "Display Newsfeed in PDF"
readNewsInRTF - The MenuItem "Display Newsfeed in RTF"
readNewsInHTML - The MenuItem "Display Newsfeed in HTML"

registerReload

static void registerReload(MenuItem reload)
Register a menuitem to the MenuManager

Parameters:
reload - The MenuItem "Reload"

registerReloadToolItem

static void registerReloadToolItem(ToolItem reloadToolItem)
Register a toolitem to the MenuManager

Parameters:
reloadToolItem - The ToolItem "Reload"

registerSaveRSS

static void registerSaveRSS(MenuItem saveRSS)
Register a menuitem to the MenuManager

Parameters:
saveRSS - The MenuItem "Save RSS"

registerSearch

static void registerSearch(MenuItem search)
Register a menuitem to the MenuManager

Parameters:
search - The MenuItem "Search"

registerSearchToolItem

static void registerSearchToolItem(ToolItem searchToolItem)
Register a toolitem to the MenuManager

Parameters:
searchToolItem - The ToolItem "Search"


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo