Class MyTorrentsView
java.lang.Object
com.biglybt.ui.swt.views.table.impl.TableViewTab<DownloadManager>
com.biglybt.ui.swt.views.MyTorrentsView
- All Implemented Interfaces:
ParameterListener, DownloadManagerListener, GlobalManagerListener, TagListener, TagTypeListener, AEDiagnosticsEvidenceGenerator, TorrentUtils.PotentialTorrentDeletionListener, TableRowRefreshListener, UIToolBarActivationListener, UIToolBarEnablerBase, UIPluginViewToolBarListener, TableCountChangeListener, TableExpansionChangeListener, TableLifeCycleListener, TableRefreshListener, TableSelectionListener, TableViewCreator, TableViewFilterCheck<DownloadManager>, ObfuscateImage, UISWTViewEventListener, UISWTViewCoreEventListener, TableViewSWTMenuFillListener, TableViewSWTPanelCreator, EventListener, org.eclipse.swt.events.KeyListener
- Direct Known Subclasses:
MyTorrentsSubView, MyTorrentsView_Big, MyTorrentsView_Small
public class MyTorrentsView
extends TableViewTab<DownloadManager>
implements GlobalManagerListener, ParameterListener, DownloadManagerListener, TagTypeListener, TagListener, org.eclipse.swt.events.KeyListener, TableLifeCycleListener, TableViewSWTPanelCreator, TableSelectionListener, TableViewSWTMenuFillListener, TableRefreshListener, TableViewFilterCheck<DownloadManager>, TableRowRefreshListener, TableCountChangeListener, TableExpansionChangeListener, UIPluginViewToolBarListener, TorrentUtils.PotentialTorrentDeletionListener
Displays a list of torrents in a table view.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface TagTypeListener
TagTypeListener.TagEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Tag[]private booleanprivate TagCanvas.TagButtonTriggerprivate Coreprivate booleanprivate final Objectprivate org.eclipse.swt.widgets.Compositeprivate org.eclipse.swt.widgets.Compositeprotected org.eclipse.swt.widgets.Compositeprivate booleanprivate Objectprivate TableSelectionListenerprivate static final AsyncDispatcherprivate intprivate AtomicIntegerprivate int[]private longprivate TableRowCore[]protected BubbleTextBoxprivate org.eclipse.swt.graphics.Fontprivate Class<?> private GlobalManagerprivate GlobalManagerEventListenerprivate booleanprotected booleanprivate booleanprivate static final Objectprivate TagConstraintprivate Stringprivate final Set<TableRowCore> private static final LogIDsprotected booleanprotected booleanprivate org.eclipse.swt.widgets.Menuprivate DownloadManagerprivate booleanprivate FrequencyLimitedDispatcher(package private) AsyncDispatcherprivate Runnableprivate booleanprivate booleanprivate booleanprivate booleanprivate static final TagManagerprivate TableViewSWT<DownloadManager> private TimerEventPeriodicprotected booleanprivate ViewUtils.ViewTitleExtraInfoFields inherited from interface TableLifeCycleListener
EVENT_TABLELIFECYCLE_DESTROYED, EVENT_TABLELIFECYCLE_INITIALIZED, EVENT_TABLELIFECYCLE_SHUTDOWNFields inherited from interface UIToolBarActivationListener
ACTIVATIONTYPE_HELD, ACTIVATIONTYPE_NORMAL, ACTIVATIONTYPE_RIGHTCLICK -
Constructor Summary
ConstructorsConstructorDescriptionMyTorrentsView(boolean supportsTabs) MyTorrentsView(Core core, String tableID, boolean isSeedingView, TableColumnCore[] basicItems, BubbleTextBox filterBox, boolean supportsTabs) InitializeMyTorrentsView(String textPrefixID, boolean supportsTabs) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddThisColumnSubMenu(String sColumnName, org.eclipse.swt.widgets.Menu menuThisColumn) Create a SubMenu for column specific tasks.private voidbuildCatAndTag(List<Tag> tags) private voidvoidprivate voidvoidcompletionChanged(DownloadManager manager, boolean bCompleted) Notification that the completion state has changed.private voidprotected TableViewSWT<DownloadManager> createTableView(Class<?> forDataSourceType, String tableID, TableColumnCore[] basicItems) Creates and return anTableViewSWTSubclasses my override to return a different TableViewSWT if neededorg.eclipse.swt.widgets.CompositecreateTableViewPanel(org.eclipse.swt.widgets.Composite composite) private voidvoidvoiddefaultSelected(TableRowCore[] rows, int keyMask, int origin) voiddeselected(TableRowCore[] rows) voidvoidprivate voidvoiddownloadComplete(DownloadManager manager) Notification that we were downloading and the download has completedvoidvoidbooleaneventOccurred(UISWTViewEvent event) Triggers when an even listed in UISWTViewEvent occursvoidfilePriorityChanged(DownloadManager download, DiskManagerFileInfo file) voidbooleanfilterCheck(DownloadManager dm, String sLastSearch, boolean bRegexSearch, boolean confusable) voidvoidfocusChanged(TableRowCore focus) voidprivate MdiEntrySWTTag[]protected Class<?> private org.eclipse.swt.widgets.Menuprotected intReturns the default row height for the table Subclasses my override to return a different height if needed; a height of -1 means use defaultprivate longprivate DiskManagerFileInfo[]init(Core _core, String tableID, Class<?> _forDataSourceType, TableColumnCore[] basicItems) private booleanbooleanbooleanisInCurrentTag(DownloadManager manager) private booleanisInCurrentTags(DownloadManager manager) booleanbooleanvoidkeyPressed(org.eclipse.swt.events.KeyEvent e) voidkeyReleased(org.eclipse.swt.events.KeyEvent e) voidmouseEnter(TableRowCore row) voidmouseExit(TableRowCore row) private voidmoveRowsTo(TableRowCore[] rows, int iNewPos) private voidmoveSelectedTorrents(int by) private voidprivate voidprivate voidprivate voidmoveSelectedTorrentsTopOrEnd(boolean moveToTop) private voidorg.eclipse.swt.graphics.ImageobfuscatedImage(org.eclipse.swt.graphics.Image image) voidoverrideDefaultSelected(TableSelectionListener defaultSelectedListener) voidparameterChanged(String parameterName) Called, when a parameter has changed.voidpositionChanged(DownloadManager download, int oldPosition, int newPosition) voidpotentialDeletionChanged(DownloadManager[] old_dms, DownloadManager[] new_dms) voidrefreshToolBarItems(Map<String, Long> list) Fill in list with the toolbar ids and states you wish to setprivate voidstatic voidprivate Object[]removeFromArray(Object[] array, Object o) private voidremoveTagFromCurrent(Tag tag) private voidvoidvoidrowAdded(TableRowCore row) voidrowCollapsed(TableRowCore row) voidrowExpanded(TableRowCore row) voidrowRefresh(TableRow row) voidrowRemoved(TableRowCore row) voidseedingStatusChanged(boolean seeding_only_mode, boolean b) Notification of global seeding status changes.voidselected(TableRowCore[] rows) voidselectionChanged(TableRowCore[] selected_rows, TableRowCore[] deselected_rows) Use this instead of selected/deselected if it makes more senseprivate voidprotected voidsetCurrentTags(Tag... tags) voidsetCurrentTagsAny(boolean currentTagsAny) voidsetRebuildListOnFocusGain(boolean rebuildListOnFocusGain) protected booleanshowMyOwnMenu(org.eclipse.swt.events.MenuEvent e, boolean isMouseEvent) private voidvoidstateChanged(DownloadManager manager, int state) private voidprivate voidvoidtableLifeCycleEventOccurred(TableView tv, int eventType, Map<String, Object> data) voidprotected voidprotected voidvoidvoidvoidtagChanged(Tag tag) voidvoidtaggableAdded(Tag tag, Taggable tagged) voidtaggableRemoved(Tag tag, Taggable tagged) voidtaggableSync(Tag tag) voidtagRemoved(Tag tag) voidtagTypeChanged(TagType tag_type) General change not specific to one tagbooleantoolBarItemActivated(ToolBarItem item, long activationType, Object datasource) XXX Should have been UIToolBarItemvoidvoidvoidupdateSelectedContent(boolean force) private voidprivate voidvoidviewChanged(TableView<DownloadManager> view) Methods inherited from class TableViewTab
allowCreate, dataSourceChanged, delete, enableFilterCheck, generate, getComposite, getFullTitle, getSWTView, getTableView, getTextPrefixID, initComposite, initialize, parentDataSourceChanged, refresh, setEnableTabViews, viewActivatedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DownloadManagerListener
fileLocationChangedMethods inherited from interface GlobalManagerListener
destroyInitiatedMethods inherited from interface TableSelectionListener
defaultSelectedMethods inherited from interface TableViewFilterCheck
filterCheck, filterSet, setRefilterCacheMethods inherited from interface UIPluginViewToolBarListener
isActiveMethods inherited from interface UISWTViewEventListener
builderNotRequired, informOfDuplicates
-
Field Details
-
LOGID
-
KEY_DM_REMOVED_FROM_COMPLETE_TABLE_TIME
-
dispatcher
-
tagManager
-
core
-
globalManager
-
gm_event_listener
-
supportsTabs
private boolean supportsTabs -
cTablePanel
private org.eclipse.swt.widgets.Composite cTablePanel -
fontButton
private org.eclipse.swt.graphics.Font fontButton -
cTitleCategoriesAndTags
protected org.eclipse.swt.widgets.Composite cTitleCategoriesAndTags -
filterBox
-
txtFilterUpdateEvent
-
lastSearchConstraintString
-
lastSearchConstraint
-
currentTagsLock
-
_currentTags
-
allTags
-
drag_drop_location_start
private long drag_drop_location_start -
drag_drop_rows
-
bDNDalwaysIncomplete
private boolean bDNDalwaysIncomplete -
tv
-
cTableParentPanel
private org.eclipse.swt.widgets.Composite cTableParentPanel -
viewActive
protected boolean viewActive -
defaultSelectedListener
-
vtxi
-
showTableTitle
private boolean showTableTitle -
neverShowTagButtons
protected boolean neverShowTagButtons -
neverShowCatButtons
protected boolean neverShowCatButtons -
showCatButtons
private boolean showCatButtons -
showTagButtons
private boolean showTagButtons -
rebuildListOnFocusGain
private boolean rebuildListOnFocusGain -
oldMenu
private org.eclipse.swt.widgets.Menu oldMenu -
isCompletedOnly
private boolean isCompletedOnly -
isIncompletedOnly
private boolean isIncompletedOnly -
forDataSourceType
-
buttonListener
-
isEmptyListOnNullDS
protected boolean isEmptyListOnNullDS -
removed_while_selected
-
rowRemovedRunnable
-
dmCounts
private volatile int[] dmCounts -
dmCountMutations
-
dmCountLast
private volatile int dmCountLast -
listRowsToRefresh
-
createdLock
-
created
private boolean created -
pendingAttention
-
refresh_limiter
-
reposition_disps
AsyncDispatcher reposition_disps -
pending_tag_changes
-
currentTagsAny
private boolean currentTagsAny
-
-
Constructor Details
-
MyTorrentsView
public MyTorrentsView(boolean supportsTabs) -
MyTorrentsView
-
MyTorrentsView
public MyTorrentsView(Core core, String tableID, boolean isSeedingView, TableColumnCore[] basicItems, BubbleTextBox filterBox, boolean supportsTabs) Initialize- Parameters:
core-isSeedingView-basicItems-
-
-
Method Details
-
initYourTableView
- Specified by:
initYourTableViewin classTableViewTab<DownloadManager>
-
tableViewTabInitComplete
public void tableViewTabInitComplete()- Overrides:
tableViewTabInitCompletein classTableViewTab<DownloadManager>
-
showMyOwnMenu
protected boolean showMyOwnMenu(org.eclipse.swt.events.MenuEvent e, boolean isMouseEvent) -
init
public TableViewSWT<DownloadManager> init(Core _core, String tableID, Class<?> _forDataSourceType, TableColumnCore[] basicItems) -
tableLifeCycleEventOccurred
- Specified by:
tableLifeCycleEventOccurredin interfaceTableLifeCycleListener
-
tableViewInitialized
protected void tableViewInitialized() -
getHeaderMenu
private org.eclipse.swt.widgets.Menu getHeaderMenu() -
tableViewDestroyed
protected void tableViewDestroyed() -
createTableViewPanel
public org.eclipse.swt.widgets.Composite createTableViewPanel(org.eclipse.swt.widgets.Composite composite) - Specified by:
createTableViewPanelin interfaceTableViewSWTPanelCreator
-
createTabs
private void createTabs() -
destroyTabs
private void destroyTabs() -
swt_createTabs
private void swt_createTabs() -
buildHeaderArea
private void buildHeaderArea() -
buildCatAndTag
-
updateTagAlphas
private void updateTagAlphas() -
isOurDownloadManager
-
filterCheck
public boolean filterCheck(DownloadManager dm, String sLastSearch, boolean bRegexSearch, boolean confusable) - Specified by:
filterCheckin interfaceTableViewFilterCheck<DownloadManager>
-
filterSet
- Specified by:
filterSetin interfaceTableViewFilterCheck<DownloadManager>
-
viewChanged
- Specified by:
viewChangedin interfaceTableViewFilterCheck<DownloadManager>
-
swt_viewChanged
-
selected
- Specified by:
selectedin interfaceTableSelectionListener
-
deselected
- Specified by:
deselectedin interfaceTableSelectionListener
-
selectionChanged
Description copied from interface:TableSelectionListenerUse this instead of selected/deselected if it makes more sense- Specified by:
selectionChangedin interfaceTableSelectionListener
-
focusChanged
- Specified by:
focusChangedin interfaceTableSelectionListener
-
focusRequested
public void focusRequested()- Specified by:
focusRequestedin interfaceTableSelectionListener
-
mouseEnter
- Specified by:
mouseEnterin interfaceTableSelectionListener
-
mouseExit
- Specified by:
mouseExitin interfaceTableSelectionListener
-
updateSelectedContentRateLimited
private void updateSelectedContentRateLimited() -
updateSelectedContent
public void updateSelectedContent() -
updateSelectedContent
public void updateSelectedContent(boolean force) -
refreshTorrentMenu
private void refreshTorrentMenu() -
getSelectedDownloads
-
defaultSelected
- Specified by:
defaultSelectedin interfaceTableSelectionListener
-
showSelectedDetails
private void showSelectedDetails() -
overrideDefaultSelected
-
addThisColumnSubMenu
Description copied from interface:TableViewSWTMenuFillListenerCreate 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:
addThisColumnSubMenuin interfaceTableViewSWTMenuFillListener- Parameters:
sColumnName- The name of the column the user clicked onmenuThisColumn- the menu to fill with MenuItems
-
fillMenu
- Specified by:
fillMenuin interfaceTableViewSWTMenuFillListener
-
createDragDrop
private void createDragDrop() -
getRowLocation
-
moveRowsTo
-
tableRefresh
public void tableRefresh()- Specified by:
tableRefreshin interfaceTableRefreshListener
-
keyPressed
public void keyPressed(org.eclipse.swt.events.KeyEvent e) - Specified by:
keyPressedin interfaceorg.eclipse.swt.events.KeyListener
-
keyReleased
public void keyReleased(org.eclipse.swt.events.KeyEvent e) - Specified by:
keyReleasedin interfaceorg.eclipse.swt.events.KeyListener
-
reposition
-
moveSelectedTorrentsDown
private void moveSelectedTorrentsDown() -
moveSelectedTorrentsUp
private void moveSelectedTorrentsUp() -
moveSelectedTorrents
private void moveSelectedTorrents(int by) -
columnInvalidateAfterMove
private void columnInvalidateAfterMove() -
moveSelectedTorrentsTop
private void moveSelectedTorrentsTop() -
moveSelectedTorrentsEnd
private void moveSelectedTorrentsEnd() -
moveSelectedTorrentsTopOrEnd
private void moveSelectedTorrentsTopOrEnd(boolean moveToTop) -
requestAttention
-
parameterChanged
Description copied from interface:ParameterListenerCalled, 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:
parameterChangedin interfaceParameterListener- Parameters:
parameterName- the name of the parameter that has changed- See Also:
-
getActiveView
-
refreshToolBarItems
Description copied from interface:UIPluginViewToolBarListenerFill in list with the toolbar ids and states you wish to set- Specified by:
refreshToolBarItemsin interfaceUIPluginViewToolBarListener- Parameters:
list-
-
toolBarItemActivated
Description copied from interface:UIToolBarActivationListenerXXX Should have been UIToolBarItem- Specified by:
toolBarItemActivatedin interfaceUIToolBarActivationListener
-
stateChanged
- Specified by:
stateChangedin interfaceDownloadManagerListener
-
positionChanged
- Specified by:
positionChangedin interfaceDownloadManagerListener
-
filePriorityChanged
- Specified by:
filePriorityChangedin interfaceDownloadManagerListener
-
completionChanged
Description copied from interface:DownloadManagerListenerNotification 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:
completionChangedin interfaceDownloadManagerListener
-
downloadComplete
Description copied from interface:DownloadManagerListenerNotification that we were downloading and the download has completed- Specified by:
downloadCompletein interfaceDownloadManagerListener
-
tagEventOccurred
- Specified by:
tagEventOccurredin interfaceTagTypeListener
-
tagTypeChanged
Description copied from interface:TagTypeListenerGeneral change not specific to one tag- Specified by:
tagTypeChangedin interfaceTagTypeListener
-
tagAdded
-
tagChanged
-
tagRemoved
-
removeTagFromCurrent
-
removeFromArray
-
getCurrentTags
-
setCurrentTagGroup
-
setCurrentTags
-
isInCurrentTags
-
isInCurrentTag
-
taggableAdded
- Specified by:
taggableAddedin interfaceTagListener
-
taggableSync
- Specified by:
taggableSyncin interfaceTagListener
-
taggableRemoved
- Specified by:
taggableRemovedin interfaceTagListener
-
potentialDeletionChanged
- Specified by:
potentialDeletionChangedin interfaceTorrentUtils.PotentialTorrentDeletionListener
-
downloadManagerAdded
- Specified by:
downloadManagerAddedin interfaceGlobalManagerListener
-
downloadManagerRemoved
- Specified by:
downloadManagerRemovedin interfaceGlobalManagerListener
-
destroyInitiated
public void destroyInitiated()- Specified by:
destroyInitiatedin interfaceGlobalManagerListener
-
destroyed
public void destroyed()- Specified by:
destroyedin interfaceGlobalManagerListener
-
seedingStatusChanged
public void seedingStatusChanged(boolean seeding_only_mode, boolean b) Description copied from interface:GlobalManagerListenerNotification of global seeding status changes.- Specified by:
seedingStatusChangedin interfaceGlobalManagerListener- Parameters:
seeding_only_mode- true if only seeding torrents (no downloads), false otherwiseb- - as above but true if queued seeds
-
updateLanguage
public void updateLanguage()- Overrides:
updateLanguagein classTableViewTab<DownloadManager>
-
isTableFocus
public boolean isTableFocus() -
obfuscatedImage
public org.eclipse.swt.graphics.Image obfuscatedImage(org.eclipse.swt.graphics.Image image) - Specified by:
obfuscatedImagein interfaceObfuscateImage- Overrides:
obfuscatedImagein classTableViewTab<DownloadManager>
-
createTableView
protected TableViewSWT<DownloadManager> createTableView(Class<?> forDataSourceType, String tableID, TableColumnCore[] basicItems) Creates and return anTableViewSWTSubclasses my override to return a different TableViewSWT if needed- Parameters:
basicItems-- Returns:
-
registerPluginViews
public static void registerPluginViews() -
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
- Specified by:
rowRefreshin interfaceTableRowRefreshListener
-
getVisibleFiles
-
eventOccurred
Description copied from interface:UISWTViewEventListenerTriggers when an even listed in UISWTViewEvent occurs- Specified by:
eventOccurredin interfaceUISWTViewEventListener- Overrides:
eventOccurredin classTableViewTab<DownloadManager>- Parameters:
event- event that occurred- Returns:
- meaning dependent upon event type
-
setRebuildListOnFocusGain
public void setRebuildListOnFocusGain(boolean rebuildListOnFocusGain) -
rowAdded
- Specified by:
rowAddedin interfaceTableCountChangeListener
-
rowRemoved
- Specified by:
rowRemovedin interfaceTableCountChangeListener
-
rowExpanded
- Specified by:
rowExpandedin interfaceTableExpansionChangeListener
-
rowCollapsed
- Specified by:
rowCollapsedin interfaceTableExpansionChangeListener
-
collapseAll
public void collapseAll() -
getForDataSourceType
-
isCurrent
-
isCurrentTagsAny
public boolean isCurrentTagsAny() -
setCurrentTagsAny
public void setCurrentTagsAny(boolean currentTagsAny) -
debug
-