Package com.biglybt.ui.swt.views
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
,org.eclipse.swt.internal.SWTEventListener
- 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 com.biglybt.core.tag.TagTypeListener
TagTypeListener.TagEvent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Tag[]
private boolean
private TagCanvas.TagButtonTrigger
private Core
private boolean
private final Object
private org.eclipse.swt.widgets.Composite
private org.eclipse.swt.widgets.Composite
protected org.eclipse.swt.widgets.Composite
private boolean
private Object
private TableSelectionListener
private static final AsyncDispatcher
private int
private AtomicInteger
private int[]
private long
private TableRowCore[]
protected BubbleTextBox
private org.eclipse.swt.graphics.Font
private Class
<?> private GlobalManager
private GlobalManagerEventListener
private boolean
protected boolean
private boolean
private static final Object
private TagConstraint
private String
private final Set
<TableRowCore> private static final LogIDs
protected boolean
protected boolean
private org.eclipse.swt.widgets.Menu
private DownloadManager
private boolean
private FrequencyLimitedDispatcher
private Runnable
private boolean
private boolean
private boolean
private boolean
private static final TagManager
private TableViewSWT
<DownloadManager> private TimerEventPeriodic
protected boolean
private ViewUtils.ViewTitleExtraInfo
Fields inherited from interface com.biglybt.ui.common.table.TableLifeCycleListener
EVENT_TABLELIFECYCLE_DESTROYED, EVENT_TABLELIFECYCLE_INITIALIZED, EVENT_TABLELIFECYCLE_SHUTDOWN
Fields inherited from interface com.biglybt.pif.ui.toolbar.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 TypeMethodDescriptionvoid
addThisColumnSubMenu
(String sColumnName, org.eclipse.swt.widgets.Menu menuThisColumn) Create a SubMenu for column specific tasks.private void
buildCatAndTag
(List<Tag> tags) private void
void
private void
void
completionChanged
(DownloadManager manager, boolean bCompleted) Notification that the completion state has changed.private void
protected TableViewSWT
<DownloadManager> createTableView
(Class<?> forDataSourceType, String tableID, TableColumnCore[] basicItems) Creates and return anTableViewSWT
Subclasses my override to return a different TableViewSWT if neededorg.eclipse.swt.widgets.Composite
createTableViewPanel
(org.eclipse.swt.widgets.Composite composite) private void
void
void
defaultSelected
(TableRowCore[] rows, int keyMask, int origin) void
deselected
(TableRowCore[] rows) void
void
private void
void
downloadComplete
(DownloadManager manager) Notification that we were downloading and the download has completedvoid
void
boolean
eventOccurred
(UISWTViewEvent event) Triggers when an even listed in UISWTViewEvent occursvoid
filePriorityChanged
(DownloadManager download, DiskManagerFileInfo file) void
boolean
filterCheck
(DownloadManager dm, String sLastSearch, boolean bRegexSearch, boolean confusable) void
void
focusChanged
(TableRowCore focus) void
private MdiEntrySWT
Tag[]
protected Class
<?> private org.eclipse.swt.widgets.Menu
protected int
Returns the default row height for the table Subclasses my override to return a different height if needed; a height of -1 means use defaultprivate long
private DiskManagerFileInfo[]
init
(Core _core, String tableID, Class<?> _forDataSourceType, TableColumnCore[] basicItems) private boolean
boolean
boolean
isInCurrentTag
(DownloadManager manager) private boolean
isInCurrentTags
(DownloadManager manager) boolean
boolean
void
keyPressed
(org.eclipse.swt.events.KeyEvent e) void
keyReleased
(org.eclipse.swt.events.KeyEvent e) void
mouseEnter
(TableRowCore row) void
mouseExit
(TableRowCore row) private void
moveRowsTo
(TableRowCore[] rows, int iNewPos) private void
moveSelectedTorrents
(int by) private void
private void
private void
private void
moveSelectedTorrentsTopOrEnd
(boolean moveToTop) private void
org.eclipse.swt.graphics.Image
obfuscatedImage
(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
potentialDeletionChanged
(DownloadManager[] old_dms, DownloadManager[] new_dms) void
refreshToolBarItems
(Map<String, Long> list) Fill in list with the toolbar ids and states you wish to setprivate void
static void
private Object[]
removeFromArray
(Object[] array, Object o) private void
removeTagFromCurrent
(Tag tag) void
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
selectionChanged
(TableRowCore[] selected_rows, TableRowCore[] deselected_rows) Use this instead of selected/deselected if it makes more senseprivate void
protected void
setCurrentTags
(Tag... tags) void
setCurrentTagsAny
(boolean currentTagsAny) void
setRebuildListOnFocusGain
(boolean rebuildListOnFocusGain) protected boolean
showMyOwnMenu
(org.eclipse.swt.events.MenuEvent e, boolean isMouseEvent) private void
void
stateChanged
(DownloadManager manager, int state) private void
private void
void
tableLifeCycleEventOccurred
(TableView tv, int eventType, Map<String, Object> data) void
protected void
protected void
void
void
void
tagChanged
(Tag tag) void
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 tagboolean
toolBarItemActivated
(ToolBarItem item, long activationType, Object datasource) XXX Should have been UIToolBarItemvoid
void
void
updateSelectedContent
(boolean force) private void
private void
void
viewChanged
(TableView<DownloadManager> view) Methods inherited from class com.biglybt.ui.swt.views.table.impl.TableViewTab
allowCreate, dataSourceChanged, delete, enableFilterCheck, generate, getComposite, getFullTitle, getSWTView, getTableView, getTextPrefixID, initComposite, initialize, parentDataSourceChanged, refresh, setEnableTabViews, viewActivated
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.download.DownloadManagerListener
fileLocationChanged
Methods inherited from interface com.biglybt.core.global.GlobalManagerListener
destroyInitiated
Methods inherited from interface com.biglybt.ui.common.table.TableSelectionListener
defaultSelected
Methods inherited from interface com.biglybt.ui.common.table.TableViewFilterCheck
filterCheck, filterSet, setRefilterCache
Methods inherited from interface com.biglybt.pif.ui.UIPluginViewToolBarListener
isActive
Methods inherited from interface com.biglybt.ui.swt.pif.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
-
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:
initYourTableView
in classTableViewTab<DownloadManager>
-
tableViewTabInitComplete
public void tableViewTabInitComplete()- Overrides:
tableViewTabInitComplete
in 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:
tableLifeCycleEventOccurred
in 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:
createTableViewPanel
in interfaceTableViewSWTPanelCreator
-
createTabs
private void createTabs() -
destroyTabs
private void destroyTabs() -
swt_createTabs
private void swt_createTabs() -
buildHeaderArea
private void buildHeaderArea() -
buildCatAndTag
- Since:
- 3.1.1.1
-
updateTagAlphas
private void updateTagAlphas() -
isOurDownloadManager
-
filterCheck
public boolean filterCheck(DownloadManager dm, String sLastSearch, boolean bRegexSearch, boolean confusable) - Specified by:
filterCheck
in interfaceTableViewFilterCheck<DownloadManager>
-
filterSet
- Specified by:
filterSet
in interfaceTableViewFilterCheck<DownloadManager>
-
viewChanged
- Specified by:
viewChanged
in interfaceTableViewFilterCheck<DownloadManager>
-
swt_viewChanged
-
selected
- Specified by:
selected
in interfaceTableSelectionListener
-
deselected
- Specified by:
deselected
in interfaceTableSelectionListener
-
selectionChanged
Description copied from interface:TableSelectionListener
Use this instead of selected/deselected if it makes more sense- Specified by:
selectionChanged
in interfaceTableSelectionListener
-
focusChanged
- Specified by:
focusChanged
in interfaceTableSelectionListener
-
focusRequested
public void focusRequested()- Specified by:
focusRequested
in interfaceTableSelectionListener
-
mouseEnter
- Specified by:
mouseEnter
in interfaceTableSelectionListener
-
mouseExit
- Specified by:
mouseExit
in interfaceTableSelectionListener
-
updateSelectedContentRateLimited
private void updateSelectedContentRateLimited() -
updateSelectedContent
public void updateSelectedContent() -
updateSelectedContent
public void updateSelectedContent(boolean force) -
refreshTorrentMenu
private void refreshTorrentMenu() -
getSelectedDownloads
-
defaultSelected
- Specified by:
defaultSelected
in interfaceTableSelectionListener
-
showSelectedDetails
private void showSelectedDetails() -
overrideDefaultSelected
-
addThisColumnSubMenu
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 interfaceTableViewSWTMenuFillListener
- Parameters:
sColumnName
- The name of the column the user clicked onmenuThisColumn
- the menu to fill with MenuItems
-
fillMenu
- Specified by:
fillMenu
in interfaceTableViewSWTMenuFillListener
-
createDragDrop
private void createDragDrop() -
getRowLocation
-
moveRowsTo
-
tableRefresh
public void tableRefresh()- Specified by:
tableRefresh
in interfaceTableRefreshListener
-
keyPressed
public void keyPressed(org.eclipse.swt.events.KeyEvent e) - Specified by:
keyPressed
in interfaceorg.eclipse.swt.events.KeyListener
-
keyReleased
public void keyReleased(org.eclipse.swt.events.KeyEvent e) - Specified by:
keyReleased
in interfaceorg.eclipse.swt.events.KeyListener
-
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: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 interfaceParameterListener
- Parameters:
parameterName
- the name of the parameter that has changed- See Also:
-
getActiveView
-
refreshToolBarItems
Description copied from interface:UIPluginViewToolBarListener
Fill in list with the toolbar ids and states you wish to set- Specified by:
refreshToolBarItems
in interfaceUIPluginViewToolBarListener
- Parameters:
list
-
-
toolBarItemActivated
Description copied from interface:UIToolBarActivationListener
XXX Should have been UIToolBarItem- Specified by:
toolBarItemActivated
in interfaceUIToolBarActivationListener
-
stateChanged
- Specified by:
stateChanged
in interfaceDownloadManagerListener
-
positionChanged
- Specified by:
positionChanged
in interfaceDownloadManagerListener
-
filePriorityChanged
- Specified by:
filePriorityChanged
in interfaceDownloadManagerListener
-
completionChanged
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 interfaceDownloadManagerListener
-
downloadComplete
Description copied from interface:DownloadManagerListener
Notification that we were downloading and the download has completed- Specified by:
downloadComplete
in interfaceDownloadManagerListener
-
tagEventOccurred
- Specified by:
tagEventOccurred
in interfaceTagTypeListener
-
tagTypeChanged
Description copied from interface:TagTypeListener
General change not specific to one tag- Specified by:
tagTypeChanged
in interfaceTagTypeListener
-
tagAdded
-
tagChanged
-
tagRemoved
-
removeTagFromCurrent
-
removeFromArray
-
getCurrentTags
-
setCurrentTagGroup
-
setCurrentTags
-
isInCurrentTags
-
isInCurrentTag
-
taggableAdded
- Specified by:
taggableAdded
in interfaceTagListener
-
taggableSync
- Specified by:
taggableSync
in interfaceTagListener
-
taggableRemoved
- Specified by:
taggableRemoved
in interfaceTagListener
-
potentialDeletionChanged
- Specified by:
potentialDeletionChanged
in interfaceTorrentUtils.PotentialTorrentDeletionListener
-
downloadManagerAdded
- Specified by:
downloadManagerAdded
in interfaceGlobalManagerListener
-
downloadManagerRemoved
- Specified by:
downloadManagerRemoved
in interfaceGlobalManagerListener
-
destroyInitiated
public void destroyInitiated()- Specified by:
destroyInitiated
in interfaceGlobalManagerListener
-
destroyed
public void destroyed()- Specified by:
destroyed
in interfaceGlobalManagerListener
-
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 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:
updateLanguage
in classTableViewTab<DownloadManager>
-
isTableFocus
public boolean isTableFocus() -
obfuscatedImage
public org.eclipse.swt.graphics.Image obfuscatedImage(org.eclipse.swt.graphics.Image image) - Specified by:
obfuscatedImage
in interfaceObfuscateImage
- Overrides:
obfuscatedImage
in classTableViewTab<DownloadManager>
-
createTableView
protected TableViewSWT<DownloadManager> createTableView(Class<?> forDataSourceType, String tableID, TableColumnCore[] basicItems) Creates and return anTableViewSWT
Subclasses 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:
rowRefresh
in interfaceTableRowRefreshListener
-
getVisibleFiles
-
eventOccurred
Description copied from interface:UISWTViewEventListener
Triggers when an even listed in UISWTViewEvent occurs- Specified by:
eventOccurred
in interfaceUISWTViewEventListener
- Overrides:
eventOccurred
in classTableViewTab<DownloadManager>
- Parameters:
event
- event that occurred- Returns:
- meaning dependent upon event type
-
setRebuildListOnFocusGain
public void setRebuildListOnFocusGain(boolean rebuildListOnFocusGain) -
rowAdded
- Specified by:
rowAdded
in interfaceTableCountChangeListener
-
rowRemoved
- Specified by:
rowRemoved
in interfaceTableCountChangeListener
-
rowExpanded
- Specified by:
rowExpanded
in interfaceTableExpansionChangeListener
-
rowCollapsed
- Specified by:
rowCollapsed
in interfaceTableExpansionChangeListener
-
collapseAll
public void collapseAll() -
getForDataSourceType
-
isCurrent
-
isCurrentTagsAny
public boolean isCurrentTagsAny() -
setCurrentTagsAny
public void setCurrentTagsAny(boolean currentTagsAny) -
debug
-