net.sourceforge.java.feednread.frontend.event.action
Class TreeElementPropertiesAction

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.action.AbstractAction
          extended byorg.eclipse.jface.action.Action
              extended bynet.sourceforge.java.feednread.frontend.event.action.TreeElementPropertiesAction
All Implemented Interfaces:
IAction

public class TreeElementPropertiesAction
extends Action

This Action is used if the user edits the properties of a ITreeElement in either the NewsFeedFavoritesTree or NewsFeedWatchesTree component.

Author:
Sebastian Machhausen

Field Summary
private  MainApplicationWindow mainWindow
           The Feed'n Read main window
 
Fields inherited from class org.eclipse.jface.action.Action
 
Fields inherited from class org.eclipse.core.commands.common.EventManager
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
TreeElementPropertiesAction(MainApplicationWindow mainWindow)
           Creates a new TreeElementPropertiesAction instance.
 
Method Summary
 void run()
           Executes the action: Evaluates the selection in the favorites tree Depending on the selection type which can either be a Category or a Favorite a CategoryInputDialog or FavoriteInputDialog is created Displays the dialog and lets the user edit the properties of the selected element Updates the properties of the selected element and notifies the favorites tree of the update
private  void updateProperties(Category selectedCategory)
           Updates the properties of the specified Category.
private  void updateProperties(Favorite selectedFavorite)
           Updates the properties of the specified Favorite.
private  void updateProperties(Watch selectedWatch)
           Updates the properties of the specified Watch.
private  void updateProperties(WatchFolder selectedFolder)
           Updates the properties of the specified WatchFolder.
private  void updateRefreshInterval(Category category, JobExecutionInterval interval, boolean recursive)
           Updates the refresh interval of all ITreeElements, i.e.
private  void updateScheduler(Favorite favorite)
           Updates the JobManager scheduler for the specified Favorite.
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

mainWindow

private MainApplicationWindow mainWindow

The Feed'n Read main window

Constructor Detail

TreeElementPropertiesAction

public TreeElementPropertiesAction(MainApplicationWindow mainWindow)

Creates a new TreeElementPropertiesAction instance. This Action is used if the user edits the properties of a ITreeElement in either the NewsFeedFavoritesTree or NewsFeedWatchesTree component.

Parameters:
mainWindow - the Feed'n Read main window
Method Detail

run

public void run()

Executes the action:


updateProperties

private void updateProperties(Favorite selectedFavorite)

Updates the properties of the specified Favorite.

Parameters:
selectedFavorite - the Favorite selected by the end-user

updateProperties

private void updateProperties(Category selectedCategory)

Updates the properties of the specified Category.

Parameters:
selectedCategory - the Category selected by the end-user

updateProperties

private void updateProperties(WatchFolder selectedFolder)

Updates the properties of the specified WatchFolder.

Parameters:
selectedFolder - the WatchFolder selected by the end-user

updateProperties

private void updateProperties(Watch selectedWatch)

Updates the properties of the specified Watch.

Parameters:
selectedWatch - the Watch selected by the end-user

updateRefreshInterval

private void updateRefreshInterval(Category category,
                                   JobExecutionInterval interval,
                                   boolean recursive)

Updates the refresh interval of all ITreeElements, i.e. Favorites and Categorys in the specified Category to the specified JobExceutionInterval.

Parameters:
category - the Category to update the JobExecutionInterval for
interval - the updated JobExceutionInterval
recursive - true to update the refresh interval recursively within the specified Category; false otherwise which means that only all Favorites directly one level beneath the specified Category are updated (non recursive)

updateScheduler

private void updateScheduler(Favorite favorite)

Updates the JobManager scheduler for the specified Favorite. If the update interval for the specified Favorite has been modified, the corresponding SchedulerJob is canceled, recreated and restarted.

Parameters:
favorite - the Favorite to update the schedule for