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, TableViewFilterCheck<DownloadManager>, TableViewFilterCheck.TableViewFilterCheckEx<DownloadManager>, EventListener, org.eclipse.swt.events.KeyListener, org.eclipse.swt.internal.SWTEventListener, CategoryListener, CategoryManagerListener, ParameterListener, DownloadManagerListener, GlobalManagerListener, AEDiagnosticsEvidenceGenerator, TableRowRefreshListener, UIToolBarActivationListener, UIToolBarEnablerBase, UIPluginViewToolBarListener, UISWTViewEventListener, UISWTViewCoreEventListener, TableViewSWTMenuFillListener, TableViewSWTPanelCreator
Direct Known Subclasses:
MyTorrentsView_Big

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

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.ui.common.table.TableViewFilterCheck
TableViewFilterCheck.TableViewFilterCheckEx<DATASOURCETYPE>
 
Field Summary
protected  org.eclipse.swt.widgets.Composite cCategoriesAndTags
           
static boolean eta_absolute
           
protected  boolean isSeedingView
           
static Set<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, String tableID, boolean isSeedingView, TableColumnCore[] basicItems, org.eclipse.swt.widgets.Text txtFilter, org.eclipse.swt.widgets.Composite cCatsAndTags, boolean supportsTabs)
          Initialize
MyTorrentsView(boolean supportsTabs)
           
 
Method Summary
 void addThisColumnSubMenu(String sColumnName, org.eclipse.swt.widgets.Menu menuThisColumn)
          Create a SubMenu for column specific tasks.
 void categoryAdded(Category category)
          A category has been added to the CategoryManager
 void categoryChanged(Category category)
           
 void categoryRemoved(Category category)
          A category has been removed from the CategoryManager
 void completionChanged(DownloadManager manager, boolean bCompleted)
          Notification that the completion state has changed.
protected  TableViewSWT<DownloadManager> createTableView(Class<?> forDataSourceType, 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(Category category, DownloadManager manager)
          A DownloadManager has been added to a Category
 void downloadManagerAdded(DownloadManager dm)
           
 void downloadManagerRemoved(Category category, DownloadManager removed)
          A DownloadManager has been removed from a Category
 void downloadManagerRemoved(DownloadManager dm)
           
 boolean eventOccurred(UISWTViewEvent event)
          Triggers when an even listed in UISWTViewEvent occurs
 void filePriorityChanged(DownloadManager download, DiskManagerFileInfo file)
           
 void fillMenu(String sColumnName, org.eclipse.swt.widgets.Menu menu)
           
 boolean filterCheck(DownloadManager dm, String sLastSearch, boolean bRegexSearch)
           
 void filterSet(String filter)
           
 void focusChanged(TableRowCore focus)
           
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, String tableID, boolean isSeedingView, Class<?> forDataSourceType, TableColumnCore[] basicItems)
           
 TableViewSWT<DownloadManager> initYourTableView()
           
 boolean isInCurrentCategory(DownloadManager manager)
           
 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(String parameterName)
          Called, when a parameter has changed.
 void positionChanged(DownloadManager download, int oldPosition, int newPosition)
           
 void refreshToolBarItems(Map<String,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)
           
 void setRebuildListOnFocusGain(boolean rebuildListOnFocusGain)
           
 void stateChanged(DownloadManager manager, int state)
           
 void tableRefresh()
           
 void tableViewDestroyed()
           
 void tableViewInitialized()
           
 void tagAdded(Tag tag)
           
 void tagChanged(Tag tag)
           
 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, Object datasource)
           
 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, generate, getComposite, getFullTitle, getPrivateMenu, getPropertiesPrefix, getSWTView, getTableView, initComposite, initialize, refresh, tableViewTabInitComplete, 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 Set<String> preferred_tracker_names

eta_absolute

public static volatile boolean eta_absolute

progress_eta_absolute

public static volatile boolean progress_eta_absolute

isSeedingView

protected boolean isSeedingView

cCategoriesAndTags

protected org.eclipse.swt.widgets.Composite cCategoriesAndTags

txtFilter

protected org.eclipse.swt.widgets.Text txtFilter

viewActive

protected boolean viewActive
Constructor Detail

MyTorrentsView

public MyTorrentsView(boolean supportsTabs)

MyTorrentsView

public MyTorrentsView(AzureusCore _azureus_core,
                      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>

init

public void init(AzureusCore _azureus_core,
                 String tableID,
                 boolean isSeedingView,
                 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,
                           String sLastSearch,
                           boolean bRegexSearch)
Specified by:
filterCheck in interface TableViewFilterCheck<DownloadManager>

filterSet

public void filterSet(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(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(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(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(Map<String,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
Overrides:
refreshToolBarItems in class TableViewTab<DownloadManager>

toolBarItemActivated

public boolean toolBarItemActivated(ToolBarItem item,
                                    long activationType,
                                    Object datasource)
Specified by:
toolBarItemActivated in interface UIToolBarActivationListener
Overrides:
toolBarItemActivated in class TableViewTab<DownloadManager>

downloadManagerAdded

public void downloadManagerAdded(Category category,
                                 DownloadManager manager)
Description copied from interface: CategoryListener
A DownloadManager has been added to a Category

Specified by:
downloadManagerAdded in interface CategoryListener
Parameters:
category - Category that the DownloadManager has been added to
manager - DownloadManager that was added

downloadManagerRemoved

public void downloadManagerRemoved(Category category,
                                   DownloadManager removed)
Description copied from interface: CategoryListener
A DownloadManager has been removed from a Category

Specified by:
downloadManagerRemoved in interface CategoryListener
Parameters:
category - Category that the DownloadManager was removed from
removed - The DownloadManager that was removed

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

isInCurrentCategory

public boolean isInCurrentCategory(DownloadManager manager)

categoryAdded

public void categoryAdded(Category category)
Description copied from interface: CategoryManagerListener
A category has been added to the CategoryManager

Specified by:
categoryAdded in interface CategoryManagerListener
Parameters:
category - the category that was added

categoryRemoved

public void categoryRemoved(Category category)
Description copied from interface: CategoryManagerListener
A category has been removed from the CategoryManager

Specified by:
categoryRemoved in interface CategoryManagerListener
Parameters:
category - Category that was removed

categoryChanged

public void categoryChanged(Category category)
Specified by:
categoryChanged in interface CategoryManagerListener

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)
Specified by:
tagAdded in interface TagTypeListener

tagChanged

public void tagChanged(Tag tag)
Specified by:
tagChanged in interface TagTypeListener

tagRemoved

public void tagRemoved(Tag tag)
Specified by:
tagRemoved in interface TagTypeListener

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)

createTableView

protected TableViewSWT<DownloadManager> createTableView(Class<?> forDataSourceType,
                                                        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