|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.rss.FeedReader
public class FeedReader
The main component for FeedReader
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
EVENT_LOGGER_NAME
The logger name for the logger used by FeedReader to log FeedEvent s. |
protected EventListenerList |
listenerList
A list of event listeners for this component. |
static String |
LOGGER_NAME
The logger name for the logger used by FeedReader . |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
FeedReader()
Creates a FeedReader using the default FeedDatabasePersistenceLayer. |
|
FeedReader(PersistenceManagerIF layer,
FeedPreference preference,
boolean allowGroup,
String localFolder,
String[] defaultChannels)
|
|
FeedReader(PersistenceManagerIF layer,
FeedPreference preference,
boolean allowGroup,
String localFolder,
String[] defaultChannels,
String defaultSelectedChannel)
|
|
FeedReader(String localFolder)
|
|
FeedReader(String[] defaultChannels)
Creates a FeedReader using the default FeedDatabasePersistenceLayer with an array of default
channels. |
|
FeedReader(String[] defaultChannels,
boolean allowGroup)
|
|
FeedReader(String[] defaultChannels,
String defaultSelectedChannel)
|
|
FeedReader(String[] defaultChannels,
String localFolder,
boolean allowGroup)
|
|
FeedReader(String localFolder,
String[] defaultChannels)
|
|
FeedReader(String localFolder,
String[] defaultChannels,
String defaultSelectedChannel)
|
Method Summary | |
---|---|
void |
addChannel(String url)
|
void |
addChannelGroup(String groupName)
|
void |
addFeedEventListener(FeedEventListener eventListener)
Adds FeedEventListener to listen to FeedEvent . |
protected void |
clearHtmlBrowser()
Clears the html browser. |
void |
clearSelectedChannelHistory()
|
protected JPopupMenu |
createChannelPopupMenu()
Creates the popup menu when user right clicks on a channel. |
protected JTree |
createChannelTree(TreeModel model)
Creates a JTree for the channel tree. |
protected Component |
createEditorLinkLabel()
Creates the link label appears below the html browser. |
protected Component |
createEditorTitleLabel()
Creates the title label appears above the html browser. |
protected FeedPreference |
createFeedPreference()
Creates the FeedPreference . |
protected Component |
createHtmlBrowser()
Creates the html browser. |
protected JPopupMenu |
createItemPopupMenu()
Creates the popup menu when user right clicks on a feed item. |
protected JComponent |
createScrollPaneForHtmlBrowser(Component browser)
|
protected AbstractButton |
createToolBarButton(AbstractAction action)
Creates the button that will be used on the toolbar. |
protected JComponent |
createToolBarComponent()
Creates the tool bar component. |
protected void |
customizeChannelTree(JTree tree)
Customizes the tree used for the channels. |
protected void |
displayHtmlBrowser(String content,
ItemIF item)
Displays the content in the html browser. |
void |
dispose()
Dispose the component especially the persistence layer. |
void |
enableChannelActionMenu()
|
void |
enableDefaultActionMenu()
|
void |
enableGroupActionMenu()
|
void |
eventHappened(FeedEvent e)
Indicates a FeedEvent happened. |
void |
fireChannelEvent(int id,
ChannelIF channel)
Fires channel event. |
void |
fireChannelItemEvent(int id,
ItemIF item)
Fires a feed event that the item read status changed. |
void |
fireChannelMovedEvent(ChannelIF channel,
ChannelGroupIF channelGroup)
Fires CHANNEL_MOVED event. |
void |
fireFeedEvent(FeedEvent event)
Fires a generic feed event. |
void |
fireGroupEvent(int id,
ChannelGroupIF group)
Fires channel event. |
void |
firePreferenceChangedEvent(FeedPreference preference)
Fires a feed event that the preference is changed. |
void |
fireStatusChangedEvent(String message)
Fires status changed event. |
ImageIcon |
getChannelIcon(ChannelIF channel)
|
JPopupMenu |
getChannelPopupMenu()
Gets the popup menu for the channel. |
String[] |
getDefaultChannels()
Gets the default channels. |
String |
getDefaultSelectedChannel()
Gets the default channel that is selected when FeedReader created. |
Component |
getEditor()
|
Component |
getEditorLinkLabel()
|
Component |
getEditorTitleLabel()
|
FeedEventListener[] |
getFeedEventListeners()
Gets the registered FeedEventListener s. |
PersistenceManagerIF |
getFeedPersistenceManager()
Gets the FeedPersistenceLayer . |
FeedPreference |
getFeedPreference()
|
JTable |
getFeedTable()
Gets the table that contains the feeds from a channel. |
JTree |
getFeedTree()
Gets the tree containing the channels. |
JPopupMenu |
getGroupPopupMenu()
|
Component |
getHtmlBrowser()
|
protected ImageIcon |
getImageIcon(String name)
Gets the image icon. |
JPopupMenu |
getItemPopupMenu()
Gets the popup menu for the feed item. |
static Logger |
getLogger()
Gets the logger used by FeedReader to log the error and warning message. |
int |
getMaxCacheItems()
|
ResourceBundle |
getResourceBundle()
Gets the resource bundle used by this component. |
protected String |
getResourceString(String key)
Gets the localized string from resource bundle. |
String |
getTitle()
Gets the title of the component. |
int |
getUnReadItemCountForAllChannels()
Gets the total # of unread items. |
String |
getUserDataPath()
|
String |
getUserIconPath()
|
void |
initialize()
|
boolean |
isAllowGroup()
|
protected JComponent |
layoutComponents(Component toolBar,
Component channelPane,
Component itemPane,
Component browserPane)
Layout the major panels. |
void |
loadChannelInTable(ChannelIF channel)
Reloads the specified channel in the feed table. |
void |
makeSelectedChannelRead(boolean read)
Makes the selected channel all items as read or unread. |
void |
moveChannel(ChannelIF channel,
ChannelGroupIF destGroup)
Moves the channel to another group. |
void |
moveSelectedChannel(ChannelGroupIF destGroup)
Moves the selected channel to another group. |
void |
openChannelInBrowser()
Opens the channel in external web browser. |
void |
openInBrowser(String url)
Opens the URL in the web browser configured in the FeedPreference. |
void |
openItemInBrowser()
Opens the feed item in external web browser. |
void |
openSelectedChannel()
Opens the selected channel. |
void |
openSelectedItem()
Opens the selected feed item in content preview panel. |
void |
reloadAllChannels()
Reloads all channels. |
ChannelIF |
reloadChannel(ChannelIF channel)
Reloads the channel. |
void |
reloadSelectedChannel()
Reloads the selected channel. |
void |
removeFeedEventListener(FeedEventListener eventListener)
Removes the FeedEventListener that was added before. |
void |
removeSelectedChannel()
Removes the selected channel. |
void |
removeSelectedGroup()
Removes the selected group. |
void |
setFeedPersistenceManager(PersistenceManagerIF layer)
Sets the FeedPersistenceLayer . |
void |
setMaxCacheItems(int maxItems)
|
void |
setRefreshDelay(int delay)
Sets the delay in ms between each refresh event. |
void |
toggleSelectedItemReadStatus()
Toggles the selected feed item read status. |
void |
updateSelectedChannel()
Uses a dialog to edit the channel property. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static String LOGGER_NAME
FeedReader
.
public static String EVENT_LOGGER_NAME
FeedReader
to log FeedEvent
s.
protected EventListenerList listenerList
Constructor Detail |
---|
public FeedReader()
FeedReader
using the default FeedDatabasePersistenceLayer.
public FeedReader(String localFolder)
public FeedReader(String[] defaultChannels)
FeedReader
using the default FeedDatabasePersistenceLayer with an array of default
channels.
defaultChannels
- the default channels. Those channels will be there when user runs for the first time.public FeedReader(String[] defaultChannels, String defaultSelectedChannel)
defaultChannels
- the default channels. Those channels will be there when user runs for the first
time.defaultSelectedChannel
- the default selected channel when FeedReader is created.public FeedReader(String[] defaultChannels, boolean allowGroup)
public FeedReader(String localFolder, String[] defaultChannels)
public FeedReader(String localFolder, String[] defaultChannels, String defaultSelectedChannel)
public FeedReader(String[] defaultChannels, String localFolder, boolean allowGroup)
public FeedReader(PersistenceManagerIF layer, FeedPreference preference, boolean allowGroup, String localFolder, String[] defaultChannels)
public FeedReader(PersistenceManagerIF layer, FeedPreference preference, boolean allowGroup, String localFolder, String[] defaultChannels, String defaultSelectedChannel)
Method Detail |
---|
protected FeedPreference createFeedPreference()
FeedPreference
. By default, we will create DefaultFeedPreference
which uses
java.utils.pref to save the data.
public String getTitle()
public void initialize()
protected JComponent layoutComponents(Component toolBar, Component channelPane, Component itemPane, Component browserPane)
toolBar
- the tool bar componentchannelPane
- the channel list componentitemPane
- the item table componentbrowserPane
- the browser component
public void dispose()
public String getDefaultSelectedChannel()
public void eventHappened(FeedEvent e)
FeedEventListener
FeedEvent
happened.
eventHappened
in interface FeedEventListener
e
- the FeedEvent.protected Component createEditorLinkLabel()
protected Component createEditorTitleLabel()
protected JComponent createScrollPaneForHtmlBrowser(Component browser)
protected Component createHtmlBrowser()
clearHtmlBrowser()
and displayHtmlBrowser(String,ItemIF)
to clear and display the
html browser respectively.
protected void clearHtmlBrowser()
createHtmlBrowser()
, you should also
override this method to clear the content. You can call getEditor()
,getEditorTitleLabel()
,getEditorLinkLabel()
to get the three components which display the content, the
title and the link respectively.
public Component getHtmlBrowser()
protected void displayHtmlBrowser(String content, ItemIF item)
createHtmlBrowser()
, you should also override this method to display the content. You can call getEditor()
,getEditorTitleLabel()
,getEditorLinkLabel()
to get the three components which
display the content, the title and the link respectively.
content
- the html content.item
- the feed itemprotected void customizeChannelTree(JTree tree)
tree
- the channel tree.protected JTree createChannelTree(TreeModel model)
model
- TreeModel.
protected JComponent createToolBarComponent()
protected AbstractButton createToolBarButton(AbstractAction action)
action
- the action for the button.
protected JPopupMenu createItemPopupMenu()
protected JPopupMenu createChannelPopupMenu()
public JTree getFeedTree()
public JPopupMenu getChannelPopupMenu()
public JPopupMenu getItemPopupMenu()
public JTable getFeedTable()
public Component getEditor()
public Component getEditorLinkLabel()
public Component getEditorTitleLabel()
protected ImageIcon getImageIcon(String name)
FeedIconsFactory
. Subclass can override
this method to provide your own icons.
name
- the icon name.
protected String getResourceString(String key)
key
- the resource key.
public ResourceBundle getResourceBundle()
public void setFeedPersistenceManager(PersistenceManagerIF layer)
FeedPersistenceLayer
.
layer
- the FeedPersistenceLayer
.public PersistenceManagerIF getFeedPersistenceManager()
FeedPersistenceLayer
.
FeedPersistenceLayer
.public void addFeedEventListener(FeedEventListener eventListener)
FeedEventListener
to listen to FeedEvent
.
eventListener
- the FeedEventListener
to be added.public void removeFeedEventListener(FeedEventListener eventListener)
FeedEventListener
that was added before.
eventListener
- the FeedEventListener
.public FeedEventListener[] getFeedEventListeners()
FeedEventListener
s.
FeedEventListener
s.public void fireStatusChangedEvent(String message)
message
- the message.public void fireChannelEvent(int id, ChannelIF channel)
id
- the event id.channel
- the channelpublic void fireChannelMovedEvent(ChannelIF channel, ChannelGroupIF channelGroup)
channel
- the channel is movedchannelGroup
- the group where the channel is moved.public void fireGroupEvent(int id, ChannelGroupIF group)
id
- the event id.group
- the grouppublic void firePreferenceChangedEvent(FeedPreference preference)
preference
- the FeedPreference
.public void fireChannelItemEvent(int id, ItemIF item)
id
- the vent id.item
- the feed item.public void fireFeedEvent(FeedEvent event)
event
- the feed event.public void makeSelectedChannelRead(boolean read)
read
- true to make all items read. False to make unread.public void toggleSelectedItemReadStatus()
public void openItemInBrowser()
public void openInBrowser(String url)
url
- the URL.public void openChannelInBrowser()
public void removeSelectedChannel()
public void openSelectedChannel()
public void openSelectedItem()
public void clearSelectedChannelHistory()
public void reloadSelectedChannel()
public ChannelIF reloadChannel(ChannelIF channel)
channel
- the channel to be reloaded
public void addChannelGroup(String groupName)
public void loadChannelInTable(ChannelIF channel)
channel
- the channel to be reloaded.public void updateSelectedChannel()
public void removeSelectedGroup()
public void moveSelectedChannel(ChannelGroupIF destGroup)
destGroup
- the destination group.public void moveChannel(ChannelIF channel, ChannelGroupIF destGroup)
channel
- the channel to be moved.destGroup
- the destination channel group.public void setRefreshDelay(int delay)
delay
- the delay in ms.public void reloadAllChannels()
public int getUnReadItemCountForAllChannels()
public String[] getDefaultChannels()
public static Logger getLogger()
public FeedPreference getFeedPreference()
public boolean isAllowGroup()
public String getUserDataPath()
public String getUserIconPath()
public void enableGroupActionMenu()
public void enableChannelActionMenu()
public void enableDefaultActionMenu()
public JPopupMenu getGroupPopupMenu()
public ImageIcon getChannelIcon(ChannelIF channel)
public void addChannel(String url)
public void setMaxCacheItems(int maxItems)
public int getMaxCacheItems()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |