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 booleanprivate Objectprivate booleanprivate intprotected booleanprivate static final Stringprivate Mapprivate TabbedMdiMaximizeListenerprivate booleanprotected booleanprivate booleanprivate intprivate ParameterListenerprivate final Stringprivate LinkedList<TabbedEntry> private org.eclipse.swt.custom.CTabFolderprivate TabFolderRendererprivate org.eclipse.swt.widgets.CompositeFields inherited from class BaseMDI
AUTOOPENINFO_DS, AUTOOPENINFO_PARENTID, AUTOOPENINFO_TITLE, CLOSEABLECONFIG_INITIALIDFields inherited from interface 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_ORDERFields inherited from interface 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 voidprivate voidaddMenus(TabbedEntry entry, String id) voidbuildMDI(SWTSkinObject skinObject) voidbuildMDI(org.eclipse.swt.widgets.Composite parent) Builds MDI and populates it with entries registered to id or datasourcetypeprivate voidprotected BaseMdiEntrycloseEntryByID(String id, boolean userInitiated) createEntry(UISWTViewBuilderCore builder, boolean closeable) protected MdiEntrycreateEntryByCreationListener(String id, Map<?, ?> autoOpenInfo) private TabbedEntrycreateEntryFromSkinRef(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 voidcreatMDI()voidvoidgenerate(IndentWriter writer) booleanWhether this MDI wants subviews.getEntryBySkinView(Object skinView) protected TabbedEntrygetEntryFromTabItem(org.eclipse.swt.custom.CTabItem item) intgetMenuEntry(boolean activeOnly) booleanprivate TabbedEntrygetPrevious(TabbedEntry current) org.eclipse.swt.custom.CTabFolderA name for this UIUpdatable so we can track who's being badprivate StringgetViewTitleID(String view_id) private MdiEntryVitalityImageSWTgetVitalityImageAtPos(int x, int y) private intprivate intbooleanisEmpty()private booleanprivate voidminimize()org.eclipse.swt.graphics.ImageobfuscatedImage(org.eclipse.swt.graphics.Image image) voidparameterChanged(String parameterName) Called, when a parameter has changed.booleanpopoutEntry(MdiEntry entry, Map<String, Object> options) private voidrestore()voidprivate voidselectNextTab(boolean selectNext) voidsetAllowSubViews(boolean allowSubViews) Sets whether this MDI wants subviews.voidsetDestroyEntriesOnDeactivate(boolean destroyEntriesOnDeactivate) voidsetEntriesDataSource(Object newDataSource) protected voidvoidsetMaximizeVisible(boolean visible) voidsetMinimized(boolean minimized) voidsetMinimizeVisible(boolean visible) protected voidsetSelectedEntry(MdiEntrySWT entry) voidprivate voidsetupNewEntry(TabbedEntry entry) voidskinObjectCreated(SWTSkinObject skinObject, Object params) Skin Object was created.skinObjectDestroyed(SWTSkinObject skinObject, Object params) Skin Object was destroyedprotected voidprivate voidswt_setupNewEntry(TabbedEntry entry) voidupdateUI()Update your UI!protected booleanMethods inherited from class 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, willEntryAutoOpenMethods inherited from class SkinView
getMainSkinObject, getMdiEntry, getSkin, getSkinObject, isDisposed, isVisible, setMainSkinObject, skinObjectHidden, skinObjectShownMethods inherited from class SWTSkinObjectAdapter
dataSourceChanged, eventOccured, skinObjectSelectedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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, willEntryAutoOpenMethods inherited from interface MultipleDocumentInterfaceSWT
createEntryFromEventListener, getEntries, setCloseableConfigFileMethods inherited from interface 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 asDownloadviewID- 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 inMenuManagerparentView- 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:MultipleDocumentInterfaceSWTBuilds MDI and populates it with entries registered to id or datasourcetype- Specified by:
buildMDIin interfaceMultipleDocumentInterfaceSWT- Parameters:
parent-
-
buildMDI
- Specified by:
buildMDIin interfaceMultipleDocumentInterfaceSWT
-
skinObjectCreated
Description copied from class:SWTSkinObjectAdapterSkin Object was created. All children are guaranteed to be created.- Overrides:
skinObjectCreatedin classSkinView
-
skinObjectDestroyed
Description copied from class:SWTSkinObjectAdapterSkin Object was destroyed- Overrides:
skinObjectDestroyedin 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:
wasEntryLoadedOncein classBaseMDI
-
setEntryLoadedOnce
- Specified by:
setEntryLoadedOncein classBaseMDI
-
getPrevious
-
showEntry
- Specified by:
showEntryin 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:MultipleDocumentInterfaceIf you prefix the 'preferedAfterID' string with '~' then the operation will actually switch to 'preferedBeforeID'- Specified by:
createEntryFromSkinRefin interfaceMultipleDocumentInterface- Specified by:
createEntryFromSkinRefin classBaseMDI- Parameters:
parentEntryID-id-configID-title-titleInfo-params-closeable-preferedAfterID- Not used for Tabs- Returns:
-
createEntry
- Specified by:
createEntryin interfaceMultipleDocumentInterfaceSWT- Returns:
- Newly created MDI Entry
-
closeEntryByID
- Overrides:
closeEntryByIDin classBaseMDI
-
updateUI
public void updateUI()Description copied from interface:UIUpdatableUpdate your UI!- Specified by:
updateUIin interfaceTabbedMdiInterface- Specified by:
updateUIin interfaceUIUpdatable- Overrides:
updateUIin classBaseMDI
-
isEntryClosedByUser
-
setupNewEntry
-
swt_setupNewEntry
-
indexOf
-
indexOf
-
getEntryFromTabItem
-
getUpdateUIName
Description copied from interface:UIUpdatableA name for this UIUpdatable so we can track who's being bad- Specified by:
getUpdateUINamein interfaceUIUpdatable- Overrides:
getUpdateUINamein classBaseMDI- Returns:
- some name
-
generate
- Specified by:
generatein interfaceAEDiagnosticsEvidenceGenerator
-
createHeader
- Specified by:
createHeaderin interfaceMultipleDocumentInterface
-
getTabFolder
public org.eclipse.swt.custom.CTabFolder getTabFolder()- Specified by:
getTabFolderin interfaceTabbedMdiInterface
-
setMaximizeVisible
public void setMaximizeVisible(boolean visible) - Specified by:
setMaximizeVisiblein interfaceTabbedMdiInterface
-
setMinimizeVisible
public void setMinimizeVisible(boolean visible) - Specified by:
setMinimizeVisiblein interfaceTabbedMdiInterface
-
getMinimized
public boolean getMinimized()- Specified by:
getMinimizedin interfaceTabbedMdiInterface
-
setMinimized
public void setMinimized(boolean minimized) - Specified by:
setMinimizedin interfaceTabbedMdiInterface
-
getRenderer
-
getFolderHeight
public int getFolderHeight()- Specified by:
getFolderHeightin interfaceTabbedMdiInterface
-
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
-
setTabbedMdiMaximizeListener
- Specified by:
setTabbedMdiMaximizeListenerin interfaceTabbedMdiInterface
-
setDestroyEntriesOnDeactivate
public void setDestroyEntriesOnDeactivate(boolean destroyEntriesOnDeactivate) - Specified by:
setDestroyEntriesOnDeactivatein interfaceTabbedMdiInterface
-
setEntriesDataSource
- Specified by:
setEntriesDataSourcein interfaceTabbedMdiInterface
-
setAllowSubViews
public void setAllowSubViews(boolean allowSubViews) Description copied from interface:TabbedMdiInterfaceSets 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_CREATEwith:
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:
setAllowSubViewsin interfaceTabbedMdiInterface
-
getAllowSubViews
public boolean getAllowSubViews()Description copied from interface:TabbedMdiInterfaceWhether 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:
getAllowSubViewsin interfaceTabbedMdiInterface
-
isEmpty
public boolean isEmpty() -
obfuscatedImage
public org.eclipse.swt.graphics.Image obfuscatedImage(org.eclipse.swt.graphics.Image image) - Specified by:
obfuscatedImagein interfaceObfuscateImage
-
createEntryByCreationListener
- Overrides:
createEntryByCreationListenerin classBaseMDI
-
addMenus
-
popoutEntry
-
fillMenu
-
getMenuIdPrefix
- Overrides:
getMenuIdPrefixin classBaseMDI
-
setSelectedEntry
- Overrides:
setSelectedEntryin classBaseMDI
-
swt_refreshVitality
protected void swt_refreshVitality() -
getEntry
- Specified by:
getEntryin interfaceMultipleDocumentInterface- Specified by:
getEntryin interfaceMultipleDocumentInterfaceSWT- Overrides:
getEntryin classBaseMDI
-
getSelectedEntry
- Specified by:
getSelectedEntryin interfaceMultipleDocumentInterface- Specified by:
getSelectedEntryin interfaceMultipleDocumentInterfaceSWT- Overrides:
getSelectedEntryin classBaseMDI
-
getMenuEntry
- Specified by:
getMenuEntryin interfaceMultipleDocumentInterface
-
getEntryBySkinView
- Specified by:
getEntryBySkinViewin interfaceMultipleDocumentInterfaceSWT- Overrides:
getEntryBySkinViewin classBaseMDI- Parameters:
skinView-- Returns:
-
runWhenIdle
- Specified by:
runWhenIdlein interfaceMultipleDocumentInterface
-