Package com.biglybt.ui.swt.mdi
Class TabbedMDI
java.lang.Object
com.biglybt.ui.swt.skin.SWTSkinObjectAdapter
com.biglybt.ui.swt.views.skin.SkinView
com.biglybt.ui.swt.mdi.BaseMDI
com.biglybt.ui.swt.mdi.TabbedMDI
- All Implemented Interfaces:
ParameterListener
,AEDiagnosticsEvidenceGenerator
,UIUpdatable
,MultipleDocumentInterface
,ObfuscateImage
,MultipleDocumentInterfaceSWT
,TabbedMdiInterface
,SWTSkinObjectListener
public class TabbedMDI
extends BaseMDI
implements TabbedMdiInterface, AEDiagnosticsEvidenceGenerator, ParameterListener, ObfuscateImage
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private Object
private boolean
private int
protected boolean
private static final String
private Map
private TabbedMdiMaximizeListener
private boolean
protected boolean
private boolean
private int
private ParameterListener
private final String
private LinkedList
<TabbedEntry> private org.eclipse.swt.custom.CTabFolder
private TabFolderRenderer
private org.eclipse.swt.widgets.Composite
Fields inherited from class com.biglybt.ui.swt.mdi.BaseMDI
AUTOOPENINFO_DS, AUTOOPENINFO_PARENTID, AUTOOPENINFO_TITLE, CLOSEABLECONFIG_INITIALID
Fields inherited from interface com.biglybt.ui.mdi.MultipleDocumentInterface
SIDEBAR_HEADER_DASHBOARD, SIDEBAR_HEADER_DEVICES, SIDEBAR_HEADER_DISCOVERY, SIDEBAR_HEADER_ORDER_DEFAULT, SIDEBAR_HEADER_PLUGINS, SIDEBAR_HEADER_TRANSFERS, SIDEBAR_HEADER_VUZE, SIDEBAR_POS_FIRST, SIDEBAR_SECTION_ACTIVITIES, SIDEBAR_SECTION_ALL_TRACKERS, SIDEBAR_SECTION_ALLBLOCKS, SIDEBAR_SECTION_ALLPEERS, SIDEBAR_SECTION_ALLPIECES, SIDEBAR_SECTION_ARCHIVED_DOWNLOADS, SIDEBAR_SECTION_BETAPROGRAM, SIDEBAR_SECTION_CHAT, SIDEBAR_SECTION_CLIENT_STATS, SIDEBAR_SECTION_CONFIG, SIDEBAR_SECTION_DEVICES, SIDEBAR_SECTION_DISK_OPS, SIDEBAR_SECTION_DOWNLOAD_HISTORY, SIDEBAR_SECTION_LIBRARY, SIDEBAR_SECTION_LIBRARY_CAT_INSTANCES, SIDEBAR_SECTION_LIBRARY_CD, SIDEBAR_SECTION_LIBRARY_DL, SIDEBAR_SECTION_LIBRARY_TAG_INSTANCES, SIDEBAR_SECTION_LIBRARY_UNOPENED, SIDEBAR_SECTION_LOGGER, SIDEBAR_SECTION_MY_SHARES, SIDEBAR_SECTION_MY_TRACKER, SIDEBAR_SECTION_PLUGINS, SIDEBAR_SECTION_SEARCH, SIDEBAR_SECTION_SUBSCRIPTIONS, SIDEBAR_SECTION_TAG_DISCOVERY, SIDEBAR_SECTION_TAGS, SIDEBAR_SECTION_TORRENT_DETAILS, SIDEBAR_SECTION_TORRENT_OPTIONS, SIDEBAR_SECTION_WELCOME, SIDEBAR_TRANSFERS_SECTION_ORDER
Fields inherited from interface com.biglybt.ui.swt.skin.SWTSkinObjectListener
EVENT_CREATE_REQUEST, EVENT_CREATED, EVENT_DATASOURCE_CHANGED, EVENT_DESTROY, EVENT_HIDE, EVENT_LANGUAGE_CHANGE, EVENT_OBFUSCATE, EVENT_SELECT, EVENT_SHOW, NAMES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
addMenus
(TabbedEntry entry, String id) void
buildMDI
(SWTSkinObject skinObject) void
buildMDI
(org.eclipse.swt.widgets.Composite parent) Builds MDI and populates it with entries registered to id or datasourcetypeprivate void
protected BaseMdiEntry
closeEntryByID
(String id, boolean userInitiated) createEntry
(UISWTViewBuilderCore builder, boolean closeable) protected MdiEntry
createEntryByCreationListener
(String id, Map<?, ?> autoOpenInfo) private TabbedEntry
createEntryFromSkinRef
(String id, String configID, String title, ViewTitleInfo titleInfo, Object params, boolean closeable, String preferredAfterID) createEntryFromSkinRef
(String parentEntryID, String id, String configID, String title, ViewTitleInfo titleInfo, Object params, boolean closeable, String preferedAfterID) If you prefix the 'preferedAfterID' string with '~' then the operation will actually switch to 'preferedBeforeID'createHeader
(String id, String title, String preferredAfterID) private void
creatMDI()
void
void
generate
(IndentWriter writer) boolean
Whether this MDI wants subviews.getEntryBySkinView
(Object skinView) protected TabbedEntry
getEntryFromTabItem
(org.eclipse.swt.custom.CTabItem item) int
boolean
private TabbedEntry
getPrevious
(TabbedEntry current) org.eclipse.swt.custom.CTabFolder
A name for this UIUpdatable so we can track who's being badprivate String
getViewTitleID
(String view_id) private MdiEntryVitalityImageSWT
getVitalityImageAtPos
(int x, int y) private int
private int
boolean
isEmpty()
private boolean
private void
minimize()
org.eclipse.swt.graphics.Image
obfuscatedImage
(org.eclipse.swt.graphics.Image image) void
parameterChanged
(String parameterName) Called, when a parameter has changed.boolean
popoutEntry
(MdiEntry entry, Map<String, Object> options) private void
restore()
void
private void
selectNextTab
(boolean selectNext) void
setAllowSubViews
(boolean allowSubViews) Sets whether this MDI wants subviews.protected void
setCurrentEntry
(MdiEntrySWT entry) void
setDestroyEntriesOnDeactivate
(boolean destroyEntriesOnDeactivate) void
setEntriesDataSource
(Object newDataSource) protected void
void
setMaximizeVisible
(boolean visible) void
setMinimized
(boolean minimized) void
setMinimizeVisible
(boolean visible) void
private void
setupNewEntry
(TabbedEntry entry) void
skinObjectCreated
(SWTSkinObject skinObject, Object params) Skin Object was created.skinObjectDestroyed
(SWTSkinObject skinObject, Object params) Skin Object was destroyedprotected void
private void
swt_setupNewEntry
(TabbedEntry entry) void
updateUI()
Update your UI!protected boolean
Methods inherited from class com.biglybt.ui.swt.mdi.BaseMDI
addItem, addListener, addListener, addListener, canShowEntryByID, closeEntry, closeEntry, closeEntryByID, createEntryFromEventListener, deregisterEntry, deregisterEntry, entryExists, getChildrenOf, getDataSourceType, getEntries, getEntries, getEntriesCount, getEntry, getEntryFromSkinObject, getMenuHackListeners, getParentView, getPreferredOrder, getShowIDAtStartup, getViewID, isInitialized, itemSelected, loadEntryByID, loadEntryByID, popoutEntryByID, registerEntry, registerEntry, removeEntryAutoOpen, removeItem, removeItem, removeListener, removeListener, removeListener, saveCloseables, setCloseableConfigFile, setDefaultEntryID, setEntryAutoOpen, setPreferredOrder, setupPluginViews, showEntryByID, showEntryByID, skinObjectInitialShow, triggerEntryLoadedListeners, triggerSelectionListener, updateLanguage, willEntryAutoOpen
Methods inherited from class com.biglybt.ui.swt.views.skin.SkinView
getMainSkinObject, getMdiEntry, getSkin, getSkinObject, isDisposed, isVisible, setMainSkinObject, skinObjectHidden, skinObjectShown
Methods inherited from class com.biglybt.ui.swt.skin.SWTSkinObjectAdapter
dataSourceChanged, eventOccured, skinObjectSelected
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.mdi.MultipleDocumentInterface
addListener, addListener, closeEntry, closeEntry, closeEntryByID, deregisterEntry, deregisterEntry, entryExists, getChildrenOf, getDataSourceType, getEntriesCount, getEntry, getPreferredOrder, getViewID, isDisposed, isInitialized, isVisible, loadEntryByID, loadEntryByID, popoutEntryByID, registerEntry, registerEntry, removeEntryAutoOpen, removeItem, removeListener, removeListener, setDefaultEntryID, setEntryAutoOpen, setPreferredOrder, showEntryByID, showEntryByID, willEntryAutoOpen
Methods inherited from interface com.biglybt.ui.swt.mdi.MultipleDocumentInterfaceSWT
createEntryFromEventListener, getEntries, setCloseableConfigFile
Methods inherited from interface com.biglybt.ui.swt.mdi.TabbedMdiInterface
addListener
-
Field Details
-
KEY_AUTO_CLOSE
- See Also:
-
tabFolder
private org.eclipse.swt.custom.CTabFolder tabFolder -
tabFolderRenderer
-
select_history
-
minimized
protected boolean minimized -
iFolderHeightAdj
private int iFolderHeightAdj -
props_prefix
-
minimumCharacters
private int minimumCharacters -
isMainMDI
protected boolean isMainMDI -
mapUserClosedTabs
-
maximizeVisible
private boolean maximizeVisible -
minimizeVisible
private boolean minimizeVisible -
maximizeListener
-
paramFancyTabListener
-
topRight
private org.eclipse.swt.widgets.Composite topRight -
destroyEntriesOnDeactivate
private boolean destroyEntriesOnDeactivate -
dataSource
-
allowSubViews
private boolean allowSubViews
-
-
Constructor Details
-
TabbedMDI
public TabbedMDI() -
TabbedMDI
public TabbedMDI(Class<?> pluginDataSourceType, String viewID, String props_prefix, UISWTView parentView, Object dataSource) - Parameters:
pluginDataSourceType
- Only needed if every tab is based on the same datasource, such asDownload
viewID
- ID used to register views against this MDIprops_prefix
- Prefix for loading MDIs properties (open history, etc)
Also used to get registered menu items. So, should be one of MENU_ constants inMenuManager
parentView
- This MDI's parent. For example, Parent=(Torrent's Peers View), this=(MDI showing Piece Map, Files, etc)dataSource
- DataSource to pass into each new entry. If null, entry's initial datasource will be used.parent
- SWT Composite to place widgets on
-
-
Method Details
-
buildMDI
public void buildMDI(org.eclipse.swt.widgets.Composite parent) Description copied from interface:MultipleDocumentInterfaceSWT
Builds MDI and populates it with entries registered to id or datasourcetype- Specified by:
buildMDI
in interfaceMultipleDocumentInterfaceSWT
- Parameters:
parent
-
-
buildMDI
- Specified by:
buildMDI
in interfaceMultipleDocumentInterfaceSWT
-
skinObjectCreated
Description copied from class:SWTSkinObjectAdapter
Skin Object was created. All children are guaranteed to be created.- Overrides:
skinObjectCreated
in classSkinView
-
skinObjectDestroyed
Description copied from class:SWTSkinObjectAdapter
Skin Object was destroyed- Overrides:
skinObjectDestroyed
in classBaseMDI
-
creatMDI
private void creatMDI() -
addDragDropListeners
private void addDragDropListeners() -
buildTabs
private void buildTabs() -
getVitalityImageAtPos
-
getViewTitleID
-
minimize
private void minimize() -
restore
private void restore() -
selectNextTab
private void selectNextTab(boolean selectNext) -
wasEntryLoadedOnce
- Specified by:
wasEntryLoadedOnce
in classBaseMDI
-
setEntryLoadedOnce
- Specified by:
setEntryLoadedOnce
in classBaseMDI
-
getPrevious
-
showEntry
- Specified by:
showEntry
in interfaceMultipleDocumentInterface
-
createEntryFromSkinRef
private TabbedEntry createEntryFromSkinRef(String id, String configID, String title, ViewTitleInfo titleInfo, Object params, boolean closeable, String preferredAfterID) -
createEntryFromSkinRef
public TabbedEntry createEntryFromSkinRef(String parentEntryID, String id, String configID, String title, ViewTitleInfo titleInfo, Object params, boolean closeable, String preferedAfterID) Description copied from interface:MultipleDocumentInterface
If you prefix the 'preferedAfterID' string with '~' then the operation will actually switch to 'preferedBeforeID'- Specified by:
createEntryFromSkinRef
in interfaceMultipleDocumentInterface
- Specified by:
createEntryFromSkinRef
in classBaseMDI
- Parameters:
parentEntryID
-id
-configID
-title
-titleInfo
-params
-closeable
-preferedAfterID
- Not used for Tabs- Returns:
-
createEntry
- Specified by:
createEntry
in interfaceMultipleDocumentInterfaceSWT
- Returns:
- Newly created MDI Entry
-
closeEntryByID
- Overrides:
closeEntryByID
in classBaseMDI
-
updateUI
public void updateUI()Description copied from interface:UIUpdatable
Update your UI!- Specified by:
updateUI
in interfaceTabbedMdiInterface
- Specified by:
updateUI
in interfaceUIUpdatable
- Overrides:
updateUI
in classBaseMDI
-
isEntryClosedByUser
-
setupNewEntry
-
swt_setupNewEntry
-
indexOf
-
indexOf
-
getEntryFromTabItem
-
getUpdateUIName
Description copied from interface:UIUpdatable
A name for this UIUpdatable so we can track who's being bad- Specified by:
getUpdateUIName
in interfaceUIUpdatable
- Overrides:
getUpdateUIName
in classBaseMDI
- Returns:
- some name
-
generate
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-
createHeader
- Specified by:
createHeader
in interfaceMultipleDocumentInterface
-
getTabFolder
public org.eclipse.swt.custom.CTabFolder getTabFolder()- Specified by:
getTabFolder
in interfaceTabbedMdiInterface
-
setMaximizeVisible
public void setMaximizeVisible(boolean visible) - Specified by:
setMaximizeVisible
in interfaceTabbedMdiInterface
-
setMinimizeVisible
public void setMinimizeVisible(boolean visible) - Specified by:
setMinimizeVisible
in interfaceTabbedMdiInterface
-
getMinimized
public boolean getMinimized()- Specified by:
getMinimized
in interfaceTabbedMdiInterface
-
setMinimized
public void setMinimized(boolean minimized) - Specified by:
setMinimized
in interfaceTabbedMdiInterface
-
getRenderer
-
getFolderHeight
public int getFolderHeight()- Specified by:
getFolderHeight
in interfaceTabbedMdiInterface
-
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
-
setTabbedMdiMaximizeListener
- Specified by:
setTabbedMdiMaximizeListener
in interfaceTabbedMdiInterface
-
setDestroyEntriesOnDeactivate
public void setDestroyEntriesOnDeactivate(boolean destroyEntriesOnDeactivate) - Specified by:
setDestroyEntriesOnDeactivate
in interfaceTabbedMdiInterface
-
setEntriesDataSource
- Specified by:
setEntriesDataSource
in interfaceTabbedMdiInterface
-
setAllowSubViews
public void setAllowSubViews(boolean allowSubViews) Description copied from interface:TabbedMdiInterface
Sets whether this MDI wants subviews. This is only a recommendation. It's up to the MdiEntry to obey what they show or don't show. MdiEntries can check for this flag inUISWTViewEvent.TYPE_CREATE
with:
UISWTView view = event.getView(); if (view instanceof TabbedEntry) { enable_tabs = ((TabbedEntry) view).getMDI().getAllowSubViews(); } else { // Not in an MDI, set enable_tabs here }
- Specified by:
setAllowSubViews
in interfaceTabbedMdiInterface
-
getAllowSubViews
public boolean getAllowSubViews()Description copied from interface:TabbedMdiInterface
Whether this MDI wants subviews. This is only a recommendation. It's up to the MdiEntry to obey what they show or don't show.- Specified by:
getAllowSubViews
in interfaceTabbedMdiInterface
-
isEmpty
public boolean isEmpty() -
obfuscatedImage
public org.eclipse.swt.graphics.Image obfuscatedImage(org.eclipse.swt.graphics.Image image) - Specified by:
obfuscatedImage
in interfaceObfuscateImage
-
createEntryByCreationListener
- Overrides:
createEntryByCreationListener
in classBaseMDI
-
addMenus
-
popoutEntry
- Specified by:
popoutEntry
in classBaseMDI
-
fillMenu
-
getMenuIdPrefix
- Overrides:
getMenuIdPrefix
in classBaseMDI
-
setCurrentEntry
- Overrides:
setCurrentEntry
in classBaseMDI
-
swt_refreshVitality
protected void swt_refreshVitality() -
getEntry
- Specified by:
getEntry
in interfaceMultipleDocumentInterface
- Specified by:
getEntry
in interfaceMultipleDocumentInterfaceSWT
- Overrides:
getEntry
in classBaseMDI
-
getCurrentEntry
- Specified by:
getCurrentEntry
in interfaceMultipleDocumentInterface
- Specified by:
getCurrentEntry
in interfaceMultipleDocumentInterfaceSWT
- Overrides:
getCurrentEntry
in classBaseMDI
-
getEntryBySkinView
- Specified by:
getEntryBySkinView
in interfaceMultipleDocumentInterfaceSWT
- Overrides:
getEntryBySkinView
in classBaseMDI
- Parameters:
skinView
-- Returns:
-
runWhenIdle
- Specified by:
runWhenIdle
in interfaceMultipleDocumentInterface
-