org.gudy.azureus2.ui.swt.views
Class MyTorrentsView

java.lang.Object
  extended by org.gudy.azureus2.ui.swt.views.table.impl.TableViewTab<DownloadManager>
      extended by org.gudy.azureus2.ui.swt.views.MyTorrentsView
All Implemented Interfaces:
TagListener, TagTypeListener, TableCountChangeListener, TableExpansionChangeListener, TableLifeCycleListener, TableRefreshListener, TableSelectionListener, TableViewCreator, TableViewFilterCheck<DownloadManager>, TableViewFilterCheck.TableViewFilterCheckEx<DownloadManager>, java.util.EventListener, org.eclipse.swt.events.KeyListener, org.eclipse.swt.internal.SWTEventListener, ParameterListener, DownloadManagerListener, GlobalManagerListener, AEDiagnosticsEvidenceGenerator, TableRowRefreshListener, UIToolBarActivationListener, UIToolBarEnablerBase, UIPluginViewToolBarListener, ObfusticateImage, UISWTViewEventListener, UISWTViewCoreEventListener, TableViewSWTMenuFillListener, TableViewSWTPanelCreator
Direct Known Subclasses:
MyTorrentsSubView, MyTorrentsView_Big

public class MyTorrentsView
extends TableViewTab<DownloadManager>
implements GlobalManagerListener, ParameterListener, DownloadManagerListener, TagTypeListener, TagListener, org.eclipse.swt.events.KeyListener, TableLifeCycleListener, TableViewSWTPanelCreator, TableSelectionListener, TableViewSWTMenuFillListener, TableRefreshListener, TableViewFilterCheck.TableViewFilterCheckEx<DownloadManager>, TableRowRefreshListener, TableCountChangeListener, TableExpansionChangeListener, UIPluginViewToolBarListener

Displays a list of torrents in a table view.

Author:
Olivier, TuxPaper 2004/Apr/18: Use TableRowImpl instead of PeerRow 2004/Apr/20: Remove need for tableItemToObject 2004/Apr/21: extends TableView instead of IAbstractView 2005/Oct/01: Column moving in SWT >= 3.1

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.aelitis.azureus.core.tag.TagTypeListener
TagTypeListener.TagEvent
 
Nested classes/interfaces inherited from interface com.aelitis.azureus.ui.common.table.TableViewFilterCheck
TableViewFilterCheck.TableViewFilterCheckEx<DATASOURCETYPE>
 
Field Summary
protected  org.eclipse.swt.widgets.Composite cCategoriesAndTags
           
static boolean eta_absolute
           
protected  boolean isEmptyListOnNullDS
           
protected  boolean neverShowCatOrTagButtons
           
static java.util.Set<java.lang.String> preferred_tracker_names
           
static boolean progress_eta_absolute
           
protected  org.eclipse.swt.widgets.Text txtFilter
           
protected  boolean viewActive
           
 
Fields inherited from interface com.aelitis.azureus.ui.common.table.TableLifeCycleListener
EVENT_DESTROYED, EVENT_INITIALIZED
 
Fields inherited from interface org.gudy.azureus2.plugins.ui.toolbar.UIToolBarActivationListener
ACTIVATIONTYPE_HELD, ACTIVATIONTYPE_NORMAL, ACTIVATIONTYPE_RIGHTCLICK
 
Constructor Summary
MyTorrentsView(AzureusCore _azureus_core, java.lang.String tableID, boolean isSeedingView, TableColumnCore[] basicItems, org.eclipse.swt.widgets.Text txtFilter, org.eclipse.swt.widgets.Composite cCatsAndTags, boolean supportsTabs)
          Initialize
MyTorrentsView(boolean supportsTabs)
           
MyTorrentsView(java.lang.String propertiesPrefix, boolean supportsTabs)
           
 
Method Summary
 void addThisColumnSubMenu(java.lang.String sColumnName, org.eclipse.swt.widgets.Menu menuThisColumn)
          Create a SubMenu for column specific tasks.
 void completionChanged(DownloadManager manager, boolean bCompleted)
          Notification that the completion state has changed.
protected  TableViewSWT<DownloadManager> createTableView(java.lang.Class<?> forDataSourceType, java.lang.String tableID, TableColumnCore[] basicItems)
           
 org.eclipse.swt.widgets.Composite createTableViewPanel(org.eclipse.swt.widgets.Composite composite)
           
 void defaultSelected(TableRowCore[] rows, int keyMask)
           
 void deselected(TableRowCore[] rows)
           
 void destroyed()
           
 void destroyInitiated()
           
 void downloadComplete(DownloadManager manager)
          Notification that we were downloading and the download has completed
 void downloadManagerAdded(DownloadManager dm)
           
 void downloadManagerRemoved(DownloadManager dm)
           
 boolean eventOccurred(UISWTViewEvent event)
          Triggers when an even listed in UISWTViewEvent occurs
 void filePriorityChanged(DownloadManager download, DiskManagerFileInfo file)
           
 void fillMenu(java.lang.String sColumnName, org.eclipse.swt.widgets.Menu menu)
           
 boolean filterCheck(DownloadManager dm, java.lang.String sLastSearch, boolean bRegexSearch)
           
 void filterSet(java.lang.String filter)
           
 void focusChanged(TableRowCore focus)
           
 Tag[] getCurrentTags()
           
protected  java.lang.Class<?> getForDataSourceType()
           
protected  int getRowDefaultHeight()
          Returns the default row height for the table Subclasses my override to return a different height if needed; a height of -1 means use default
 DownloadManager[] getSelectedDownloads()
           
 void init(AzureusCore _azureus_core, java.lang.String tableID, java.lang.Class<?> forDataSourceType, TableColumnCore[] basicItems)
           
 TableViewSWT<DownloadManager> initYourTableView()
           
 boolean isCurrentTagsAny()
           
 boolean isInCurrentTag(DownloadManager manager)
           
 boolean isOurDownloadManager(DownloadManager dm)
           
 boolean isTableFocus()
           
 void keyPressed(org.eclipse.swt.events.KeyEvent e)
           
 void keyReleased(org.eclipse.swt.events.KeyEvent e)
           
 void mouseEnter(TableRowCore row)
           
 void mouseExit(TableRowCore row)
           
 org.eclipse.swt.graphics.Image obfusticatedImage(org.eclipse.swt.graphics.Image image)
           
 void overrideDefaultSelected(TableSelectionListener defaultSelectedListener)
           
 void parameterChanged(java.lang.String parameterName)
          Called, when a parameter has changed.
 void positionChanged(DownloadManager download, int oldPosition, int newPosition)
           
 void refreshToolBarItems(java.util.Map<java.lang.String,java.lang.Long> list)
          Fill in list with the toolbar ids and states you wish to set
static void registerPluginViews(UISWTInstance pluginUI)
           
 void rowAdded(TableRowCore row)
           
 void rowCollapsed(TableRowCore row)
           
 void rowExpanded(TableRowCore row)
           
 void rowRefresh(TableRow row)
           
 void rowRemoved(TableRowCore row)
           
 void seedingStatusChanged(boolean seeding_only_mode, boolean b)
          Notification of global seeding status changes.
 void selected(TableRowCore[] rows)
           
protected  void setCurrentTags(Tag[] tags)
           
 void setCurrentTagsAny(boolean currentTagsAny)
           
 void setRebuildListOnFocusGain(boolean rebuildListOnFocusGain)
           
protected  boolean showMyOwnMenu(org.eclipse.swt.events.MenuEvent e)
           
 void stateChanged(DownloadManager manager, int state)
           
 void tableRefresh()
           
 void tableViewDestroyed()
           
 void tableViewInitialized()
           
 void tableViewTabInitComplete()
           
 void tagAdded(Tag tag)
           
 void tagChanged(Tag tag)
           
 void tagEventOccurred(TagTypeListener.TagEvent event)
           
 void taggableAdded(Tag tag, Taggable tagged)
           
 void taggableRemoved(Tag tag, Taggable tagged)
           
 void taggableSync(Tag tag)
           
 void tagRemoved(Tag tag)
           
 void tagTypeChanged(TagType tag_type)
          General change not specific to one tag
 boolean toolBarItemActivated(ToolBarItem item, long activationType, java.lang.Object datasource)
          XXX Should have been UIToolBarItem
 void updateLanguage()
           
 void updateSelectedContent()
           
 void updateSelectedContent(boolean force)
           
 void viewChanged(TableView<DownloadManager> view)
           
 
Methods inherited from class org.gudy.azureus2.ui.swt.views.table.impl.TableViewTab
dataSourceChanged, delete, enableFilterCheck, generate, getComposite, getFullTitle, getPrivateMenu, getPropertiesPrefix, getSWTView, getTableView, initComposite, initialize, refresh, viewActivated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preferred_tracker_names

public static volatile java.util.Set<java.lang.String> preferred_tracker_names

eta_absolute

public static volatile boolean eta_absolute

progress_eta_absolute

public static volatile boolean progress_eta_absolute

cCategoriesAndTags

protected org.eclipse.swt.widgets.Composite cCategoriesAndTags

txtFilter

protected org.eclipse.swt.widgets.Text txtFilter

viewActive

protected boolean viewActive

neverShowCatOrTagButtons

protected boolean neverShowCatOrTagButtons

isEmptyListOnNullDS

protected boolean isEmptyListOnNullDS
Constructor Detail

MyTorrentsView

public MyTorrentsView(boolean supportsTabs)

MyTorrentsView

public MyTorrentsView(java.lang.String propertiesPrefix,
                      boolean supportsTabs)

MyTorrentsView

public MyTorrentsView(AzureusCore _azureus_core,
                      java.lang.String tableID,
                      boolean isSeedingView,
                      TableColumnCore[] basicItems,
                      org.eclipse.swt.widgets.Text txtFilter,
                      org.eclipse.swt.widgets.Composite cCatsAndTags,
                      boolean supportsTabs)
Initialize

Parameters:
_azureus_core -
isSeedingView -
basicItems -
cCats -
Method Detail

initYourTableView

public TableViewSWT<DownloadManager> initYourTableView()
Specified by:
initYourTableView in class TableViewTab<DownloadManager>

tableViewTabInitComplete

public void tableViewTabInitComplete()
Overrides:
tableViewTabInitComplete in class TableViewTab<DownloadManager>

showMyOwnMenu

protected boolean showMyOwnMenu(org.eclipse.swt.events.MenuEvent e)

init

public void init(AzureusCore _azureus_core,
                 java.lang.String tableID,
                 java.lang.Class<?> forDataSourceType,
                 TableColumnCore[] basicItems)

tableViewInitialized

public void tableViewInitialized()
Specified by:
tableViewInitialized in interface TableLifeCycleListener

tableViewDestroyed

public void tableViewDestroyed()
Specified by:
tableViewDestroyed in interface TableLifeCycleListener

createTableViewPanel

public org.eclipse.swt.widgets.Composite createTableViewPanel(org.eclipse.swt.widgets.Composite composite)
Specified by:
createTableViewPanel in interface TableViewSWTPanelCreator

isOurDownloadManager

public boolean isOurDownloadManager(DownloadManager dm)

filterCheck

public boolean filterCheck(DownloadManager dm,
                           java.lang.String sLastSearch,
                           boolean bRegexSearch)
Specified by:
filterCheck in interface TableViewFilterCheck<DownloadManager>

filterSet

public void filterSet(java.lang.String filter)
Specified by:
filterSet in interface TableViewFilterCheck<DownloadManager>

viewChanged

public void viewChanged(TableView<DownloadManager> view)
Specified by:
viewChanged in interface TableViewFilterCheck.TableViewFilterCheckEx<DownloadManager>

selected

public void selected(TableRowCore[] rows)
Specified by:
selected in interface TableSelectionListener

deselected

public void deselected(TableRowCore[] rows)
Specified by:
deselected in interface TableSelectionListener

focusChanged

public void focusChanged(TableRowCore focus)
Specified by:
focusChanged in interface TableSelectionListener

mouseEnter

public void mouseEnter(TableRowCore row)
Specified by:
mouseEnter in interface TableSelectionListener

mouseExit

public void mouseExit(TableRowCore row)
Specified by:
mouseExit in interface TableSelectionListener

updateSelectedContent

public void updateSelectedContent()

updateSelectedContent

public void updateSelectedContent(boolean force)

getSelectedDownloads

public DownloadManager[] getSelectedDownloads()

defaultSelected

public void defaultSelected(TableRowCore[] rows,
                            int keyMask)
Specified by:
defaultSelected in interface TableSelectionListener

overrideDefaultSelected

public void overrideDefaultSelected(TableSelectionListener defaultSelectedListener)

addThisColumnSubMenu

public void addThisColumnSubMenu(java.lang.String sColumnName,
                                 org.eclipse.swt.widgets.Menu menuThisColumn)
Description copied from interface: TableViewSWTMenuFillListener
Create a SubMenu for column specific tasks. Everytime the user opens the context menu, the "This Column" submenu is cleared, and this function is called to refill it.

Specified by:
addThisColumnSubMenu in interface TableViewSWTMenuFillListener
Parameters:
sColumnName - The name of the column the user clicked on
menuThisColumn - the menu to fill with MenuItems

fillMenu

public void fillMenu(java.lang.String sColumnName,
                     org.eclipse.swt.widgets.Menu menu)
Specified by:
fillMenu in interface TableViewSWTMenuFillListener

tableRefresh

public void tableRefresh()
Specified by:
tableRefresh in interface TableRefreshListener

keyPressed

public void keyPressed(org.eclipse.swt.events.KeyEvent e)
Specified by:
keyPressed in interface org.eclipse.swt.events.KeyListener

keyReleased

public void keyReleased(org.eclipse.swt.events.KeyEvent e)
Specified by:
keyReleased in interface org.eclipse.swt.events.KeyListener

parameterChanged

public void parameterChanged(java.lang.String parameterName)
Description copied from interface: ParameterListener
Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.

Specified by:
parameterChanged in interface ParameterListener
Parameters:
parameterName - the name of the parameter that has changed
See Also:
ParameterListener.parameterChanged(java.lang.String)

refreshToolBarItems

public void refreshToolBarItems(java.util.Map<java.lang.String,java.lang.Long> list)
Description copied from interface: UIPluginViewToolBarListener
Fill in list with the toolbar ids and states you wish to set

Specified by:
refreshToolBarItems in interface UIPluginViewToolBarListener

toolBarItemActivated

public boolean toolBarItemActivated(ToolBarItem item,
                                    long activationType,
                                    java.lang.Object datasource)
Description copied from interface: UIToolBarActivationListener
XXX Should have been UIToolBarItem

Specified by:
toolBarItemActivated in interface UIToolBarActivationListener

stateChanged

public void stateChanged(DownloadManager manager,
                         int state)
Specified by:
stateChanged in interface DownloadManagerListener

positionChanged

public void positionChanged(DownloadManager download,
                            int oldPosition,
                            int newPosition)
Specified by:
positionChanged in interface DownloadManagerListener

filePriorityChanged

public void filePriorityChanged(DownloadManager download,
                                DiskManagerFileInfo file)
Specified by:
filePriorityChanged in interface DownloadManagerListener

completionChanged

public void completionChanged(DownloadManager manager,
                              boolean bCompleted)
Description copied from interface: DownloadManagerListener
Notification that the completion state has changed. Tells you when we switched from Completed to Incompleted (or visa versa) Does not get called when diskManager goes into CHECKING, but does when it goes out of CHECKING, to avoid torrents jumping momentarily from Completed to Incompleted to Completed again.

Specified by:
completionChanged in interface DownloadManagerListener

downloadComplete

public void downloadComplete(DownloadManager manager)
Description copied from interface: DownloadManagerListener
Notification that we were downloading and the download has completed

Specified by:
downloadComplete in interface DownloadManagerListener

tagEventOccurred

public void tagEventOccurred(TagTypeListener.TagEvent event)
Specified by:
tagEventOccurred in interface TagTypeListener

tagTypeChanged

public void tagTypeChanged(TagType tag_type)
Description copied from interface: TagTypeListener
General change not specific to one tag

Specified by:
tagTypeChanged in interface TagTypeListener

tagAdded

public void tagAdded(Tag tag)

tagChanged

public void tagChanged(Tag tag)

tagRemoved

public void tagRemoved(Tag tag)

getCurrentTags

public Tag[] getCurrentTags()

setCurrentTags

protected void setCurrentTags(Tag[] tags)

isInCurrentTag

public boolean isInCurrentTag(DownloadManager manager)

taggableAdded

public void taggableAdded(Tag tag,
                          Taggable tagged)
Specified by:
taggableAdded in interface TagListener

taggableSync

public void taggableSync(Tag tag)
Specified by:
taggableSync in interface TagListener

taggableRemoved

public void taggableRemoved(Tag tag,
                            Taggable tagged)
Specified by:
taggableRemoved in interface TagListener

downloadManagerAdded

public void downloadManagerAdded(DownloadManager dm)
Specified by:
downloadManagerAdded in interface GlobalManagerListener

downloadManagerRemoved

public void downloadManagerRemoved(DownloadManager dm)
Specified by:
downloadManagerRemoved in interface GlobalManagerListener

destroyInitiated

public void destroyInitiated()
Specified by:
destroyInitiated in interface GlobalManagerListener

destroyed

public void destroyed()
Specified by:
destroyed in interface GlobalManagerListener

seedingStatusChanged

public void seedingStatusChanged(boolean seeding_only_mode,
                                 boolean b)
Description copied from interface: GlobalManagerListener
Notification of global seeding status changes.

Specified by:
seedingStatusChanged in interface GlobalManagerListener
Parameters:
seeding_only_mode - true if only seeding torrents (no downloads), false otherwise
b - - as above but true if queued seeds

updateLanguage

public void updateLanguage()
Overrides:
updateLanguage in class TableViewTab<DownloadManager>

isTableFocus

public boolean isTableFocus()

obfusticatedImage

public org.eclipse.swt.graphics.Image obfusticatedImage(org.eclipse.swt.graphics.Image image)
Specified by:
obfusticatedImage in interface ObfusticateImage
Overrides:
obfusticatedImage in class TableViewTab<DownloadManager>

createTableView

protected TableViewSWT<DownloadManager> createTableView(java.lang.Class<?> forDataSourceType,
                                                        java.lang.String tableID,
                                                        TableColumnCore[] basicItems)

registerPluginViews

public static void registerPluginViews(UISWTInstance pluginUI)

getRowDefaultHeight

protected int getRowDefaultHeight()
Returns the default row height for the table Subclasses my override to return a different height if needed; a height of -1 means use default

Returns:

rowRefresh

public void rowRefresh(TableRow row)
Specified by:
rowRefresh in interface TableRowRefreshListener

eventOccurred

public boolean eventOccurred(UISWTViewEvent event)
Description copied from interface: UISWTViewEventListener
Triggers when an even listed in UISWTViewEvent occurs

Specified by:
eventOccurred in interface UISWTViewEventListener
Overrides:
eventOccurred in class TableViewTab<DownloadManager>
Parameters:
event - event that occurred
Returns:
meaning dependent upon event type

setRebuildListOnFocusGain

public void setRebuildListOnFocusGain(boolean rebuildListOnFocusGain)

rowAdded

public void rowAdded(TableRowCore row)
Specified by:
rowAdded in interface TableCountChangeListener

rowRemoved

public void rowRemoved(TableRowCore row)
Specified by:
rowRemoved in interface TableCountChangeListener

rowExpanded

public void rowExpanded(TableRowCore row)
Specified by:
rowExpanded in interface TableExpansionChangeListener

rowCollapsed

public void rowCollapsed(TableRowCore row)
Specified by:
rowCollapsed in interface TableExpansionChangeListener

getForDataSourceType

protected java.lang.Class<?> getForDataSourceType()

isCurrentTagsAny

public boolean isCurrentTagsAny()

setCurrentTagsAny

public void setCurrentTagsAny(boolean currentTagsAny)