Package com.biglybt.ui.swt.views
Class FilesView
java.lang.Object
com.biglybt.ui.swt.views.table.impl.TableViewTab<DiskManagerFileInfo>
com.biglybt.ui.swt.views.FilesView
- All Implemented Interfaces:
ParameterListener
,DownloadManagerListener
,AEDiagnosticsEvidenceGenerator
,TableDataSourceChangedListener
,TableExpansionChangeListener
,TableLifeCycleListener
,TableRefreshListener
,TableSelectionListener
,TableViewFilterCheck<DiskManagerFileInfo>
,TableViewFilterCheck.TableViewFilterCheckEx<DiskManagerFileInfo>
,ViewTitleInfo
,ObfuscateImage
,UISWTViewEventListener
,UISWTViewCoreEventListener
,TableViewSWTMenuFillListener
,EventListener
,org.eclipse.swt.events.KeyListener
,org.eclipse.swt.internal.SWTEventListener
public class FilesView
extends TableViewTab<DiskManagerFileInfo>
implements TableDataSourceChangedListener, TableSelectionListener, TableViewSWTMenuFillListener, TableRefreshListener, TableExpansionChangeListener, DownloadManagerListener, TableLifeCycleListener, TableViewFilterCheck.TableViewFilterCheckEx<DiskManagerFileInfo>, org.eclipse.swt.events.KeyListener, ParameterListener, UISWTViewCoreEventListener, ViewTitleInfo
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
static interface
Nested classes/interfaces inherited from interface com.biglybt.ui.common.table.TableViewFilterCheck
TableViewFilterCheck.TableViewFilterCheckEx<DATASOURCETYPE>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static TableColumnCore[]
(package private) org.eclipse.swt.widgets.Button
(package private) org.eclipse.swt.widgets.Button
(package private) TableColumnFilterHelper
<DiskManagerFileInfo> private FilesView.FilesViewNodeInner
private Object
private boolean
private boolean
boolean
private static final Object
private static final Object
(package private) BufferedLabel
private DownloadManager[]
static final String
(package private) org.eclipse.swt.widgets.MenuItem
static final Class
<DiskManagerFileInfo> (package private) boolean
private long
private Map
<DownloadManager, Set<Integer>> private long
private long
private TagListener
private Tag[]
private static Comparator
<String> private Map
<TOTorrentFile, FilesView.FilesViewNodeLeaf> boolean
(package private) TableViewSWT
<DiskManagerFileInfo> private boolean
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.ui.common.viewtitleinfo.ViewTitleInfo
TITLE_ACTIVE_STATE, TITLE_EXPORTABLE_DATASOURCE, TITLE_IMAGE_TOOLTIP, TITLE_IMAGEID, TITLE_INDICATOR_COLOR, TITLE_INDICATOR_TEXT, TITLE_INDICATOR_TEXT_TOOLTIP, TITLE_TEXT, TITLE_TEXT_ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addManagerListeners
(DownloadManager[] managers) void
addThisColumnSubMenu
(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.private void
void
defaultSelected
(TableRowCore[] rows, int stateMask, int origin) void
deselected
(TableRowCore[] rows) private boolean
doAllExist
(DiskManagerFileInfo[] files) private boolean
doTreeAction
(List<FilesView.FilesViewNodeInner> nodes, int action, boolean test_only) private boolean
doTreeAction
(Map<FilesView.FilesViewNodeInner, TableRowCore> node_to_row_map, FilesView.FilesViewNodeInner node, int action, boolean recursive, boolean test_only) void
downloadComplete
(DownloadManager manager) Notification that we were downloading and the download has completedboolean
eventOccurred
(UISWTViewEvent event) Triggers when an even listed in UISWTViewEvent occursvoid
fileLocationChanged
(DownloadManager download, DiskManagerFileInfo file) void
filePriorityChanged
(DownloadManager download, DiskManagerFileInfo file) void
boolean
filterCheck
(DiskManagerFileInfo ds, String filter, boolean regex, boolean confusable) void
void
focusChanged
(TableRowCore focus) private List
<DiskManagerFileInfo> private TableRowCore
private String
getTitleInfoProperty
(int propertyID) org.eclipse.swt.widgets.Composite
initComposite
(org.eclipse.swt.widgets.Composite composite) void
keyPressed
(org.eclipse.swt.events.KeyEvent e) void
keyReleased
(org.eclipse.swt.events.KeyEvent e) void
mouseEnter
(TableRowCore row) void
mouseExit
(TableRowCore row) void
parameterChanged
(String parameterName) Called, when a parameter has changed.void
parentDataSourceChanged
(Object newParentDataSource) void
positionChanged
(DownloadManager download, int oldPosition, int newPosition) private void
private static void
private void
removeManagerListeners
(DownloadManager[] managers) void
rowCollapsed
(TableRowCore row) void
rowExpanded
(TableRowCore row) void
selected
(TableRowCore[] rows) void
selectionChanged
(TableRowCore[] selected_rows, TableRowCore[] deselected_rows) Use this instead of selected/deselected if it makes more sensevoid
setDisableWhenEmpty
(boolean b) void
stateChanged
(DownloadManager manager, int state) void
tableDataSourceChanged
(Object newDataSource) void
tableLifeCycleEventOccurred
(TableView tv, int eventType, Map<String, Object> data) void
void
private void
updateFlatView
(boolean sync) private void
void
private void
private void
updateTreeExpansionState
(TableRowCore row, boolean expanded) private void
updateTreeView
(boolean sync) void
Methods inherited from class com.biglybt.ui.swt.views.table.impl.TableViewTab
allowCreate, dataSourceChanged, delete, enableFilterCheck, generate, getComposite, getFullTitle, getSWTView, getTableView, getTextPrefixID, initialize, obfuscatedImage, refresh, setEnableTabViews, updateLanguage, 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.ui.common.table.TableSelectionListener
defaultSelected, focusRequested
Methods inherited from interface com.biglybt.ui.common.table.TableViewFilterCheck
filterCheck
Methods inherited from interface com.biglybt.ui.swt.pif.UISWTViewEventListener
informOfDuplicates
-
Field Details
-
KEY_DM_TREE_STATE
-
KEY_DM_SELECTION_STATE
-
ACTION_EXPAND
private static final int ACTION_EXPAND- See Also:
-
ACTION_COLLAPSE
private static final int ACTION_COLLAPSE- See Also:
-
PLUGIN_DS_TYPE
-
refreshing
boolean refreshing -
basicItems
-
MSGID_PREFIX
- See Also:
-
managers
-
hide_dnd_files
public boolean hide_dnd_files -
tree_view
public boolean tree_view -
viewActive
private boolean viewActive -
selection_size
private volatile long selection_size -
selection_size_with_dnd
private volatile long selection_size_with_dnd -
selection_done
private volatile long selection_done -
path_item
org.eclipse.swt.widgets.MenuItem path_item -
tv
-
col_filter_helper
TableColumnFilterHelper<DiskManagerFileInfo> col_filter_helper -
btnShowDND
org.eclipse.swt.widgets.Button btnShowDND -
btnTreeView
org.eclipse.swt.widgets.Button btnTreeView -
lblHeader
BufferedLabel lblHeader -
disableTableWhenEmpty
private boolean disableTableWhenEmpty -
datasource
-
tags
-
tag_listener
-
force_refresh
private boolean force_refresh -
selection_outstanding
-
current_root
-
tree_file_map
-
tree_comp
-
-
Constructor Details
-
FilesView
public FilesView()Initialize
-
-
Method Details
-
initYourTableView
- Specified by:
initYourTableView
in classTableViewTab<DiskManagerFileInfo>
-
registerPluginViews
private static void registerPluginViews() -
initComposite
public org.eclipse.swt.widgets.Composite initComposite(org.eclipse.swt.widgets.Composite composite) - Overrides:
initComposite
in classTableViewTab<DiskManagerFileInfo>
-
addManagerListeners
-
removeManagerListeners
-
tableDataSourceChanged
- Specified by:
tableDataSourceChanged
in interfaceTableDataSourceChangedListener
-
deselected
- Specified by:
deselected
in interfaceTableSelectionListener
-
focusChanged
- Specified by:
focusChanged
in interfaceTableSelectionListener
-
selected
- Specified by:
selected
in interfaceTableSelectionListener
-
prepareSelectionState
private void prepareSelectionState() -
selectionChanged
Description copied from interface:TableSelectionListener
Use this instead of selected/deselected if it makes more sense- Specified by:
selectionChanged
in interfaceTableSelectionListener
-
stateChanged
- Specified by:
stateChanged
in interfaceDownloadManagerListener
-
downloadComplete
Description copied from interface:DownloadManagerListener
Notification that we were downloading and the download has completed- Specified by:
downloadComplete
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
-
positionChanged
- Specified by:
positionChanged
in interfaceDownloadManagerListener
-
filePriorityChanged
- Specified by:
filePriorityChanged
in interfaceDownloadManagerListener
-
fileLocationChanged
- Specified by:
fileLocationChanged
in interfaceDownloadManagerListener
- Parameters:
download
-file
- null - overall location change (e.g. move download)
-
getRowForFile
-
filterCheck
public boolean filterCheck(DiskManagerFileInfo ds, String filter, boolean regex, boolean confusable) - Specified by:
filterCheck
in interfaceTableViewFilterCheck<DiskManagerFileInfo>
-
filterSet
- Specified by:
filterSet
in interfaceTableViewFilterCheck<DiskManagerFileInfo>
-
viewChanged
- Specified by:
viewChanged
in interfaceTableViewFilterCheck.TableViewFilterCheckEx<DiskManagerFileInfo>
-
updateSelectedContent
public void updateSelectedContent() -
defaultSelected
- Specified by:
defaultSelected
in interfaceTableSelectionListener
-
doTreeAction
private boolean doTreeAction(List<FilesView.FilesViewNodeInner> nodes, int action, boolean test_only) -
doTreeAction
private boolean doTreeAction(Map<FilesView.FilesViewNodeInner, TableRowCore> node_to_row_map, FilesView.FilesViewNodeInner node, int action, boolean recursive, boolean test_only) -
fillMenu
- Specified by:
fillMenu
in interfaceTableViewSWTMenuFillListener
-
tableRefresh
public void tableRefresh()- Specified by:
tableRefresh
in interfaceTableRefreshListener
-
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
-
tableLifeCycleEventOccurred
- Specified by:
tableLifeCycleEventOccurred
in interfaceTableLifeCycleListener
-
tableViewTabInitComplete
public void tableViewTabInitComplete()- Overrides:
tableViewTabInitComplete
in classTableViewTab<DiskManagerFileInfo>
-
mouseEnter
- Specified by:
mouseEnter
in interfaceTableSelectionListener
-
mouseExit
- Specified by:
mouseExit
in interfaceTableSelectionListener
-
createDragDrop
private void createDragDrop() -
eventOccurred
Description copied from interface:UISWTViewEventListener
Triggers when an even listed in UISWTViewEvent occurs- Specified by:
eventOccurred
in interfaceUISWTViewEventListener
- Overrides:
eventOccurred
in classTableViewTab<DiskManagerFileInfo>
- Parameters:
event
- event that occurred- Returns:
- meaning dependent upon event type
-
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
-
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
-
updateHeader
private void updateHeader() -
getSelectionText
-
setDisableWhenEmpty
public void setDisableWhenEmpty(boolean b) -
rowExpanded
- Specified by:
rowExpanded
in interfaceTableExpansionChangeListener
-
rowCollapsed
- Specified by:
rowCollapsed
in interfaceTableExpansionChangeListener
-
updateTreeExpansionState
-
updateTable
private void updateTable() -
updateTreeView
private void updateTreeView(boolean sync) -
parentDataSourceChanged
- Overrides:
parentDataSourceChanged
in classTableViewTab<DiskManagerFileInfo>
-
getTitleInfoProperty
- Specified by:
getTitleInfoProperty
in interfaceViewTitleInfo
- Parameters:
propertyID
- TITLE_*- Returns:
- value, or null if you don't want to set it
-
updateFlatView
private void updateFlatView(boolean sync) -
getFileInfo
-
doAllExist
-