com.aelitis.azureus.ui.swt.mdi
Class BaseMDI

java.lang.Object
  extended by com.aelitis.azureus.ui.swt.skin.SWTSkinObjectAdapter
      extended by com.aelitis.azureus.ui.swt.views.skin.SkinView
          extended by com.aelitis.azureus.ui.swt.mdi.BaseMDI
All Implemented Interfaces:
UIUpdatable, MultipleDocumentInterface, MultipleDocumentInterfaceSWT, SWTSkinObjectListener
Direct Known Subclasses:
SideBar, TabbedMDI

public abstract class BaseMDI
extends SkinView
implements MultipleDocumentInterfaceSWT, UIUpdatable


Field Summary
protected  MdiEntrySWT currentEntry
           
 
Fields inherited from class com.aelitis.azureus.ui.swt.views.skin.SkinView
skin, soMain
 
Fields inherited from interface com.aelitis.azureus.ui.mdi.MultipleDocumentInterface
SIDEBAR_HEADER_DEVICES, SIDEBAR_HEADER_DISCOVERY, SIDEBAR_HEADER_DVD, SIDEBAR_HEADER_PLUGINS, SIDEBAR_HEADER_TRANSFERS, SIDEBAR_HEADER_VUZE, SIDEBAR_POS_FIRST, SIDEBAR_SECTION_ABOUTPLUGINS, SIDEBAR_SECTION_ACTIVITIES, SIDEBAR_SECTION_ALLPEERS, SIDEBAR_SECTION_ARCHIVED_DOWNLOADS, SIDEBAR_SECTION_BETAPROGRAM, SIDEBAR_SECTION_BURN_INFO, SIDEBAR_SECTION_CHAT, SIDEBAR_SECTION_CLIENT_STATS, SIDEBAR_SECTION_CONFIG, SIDEBAR_SECTION_DEVICES, SIDEBAR_SECTION_DOWNLOAD_HISTORY, SIDEBAR_SECTION_GAMES, SIDEBAR_SECTION_LIBRARY, SIDEBAR_SECTION_LIBRARY_CD, SIDEBAR_SECTION_LIBRARY_DL, SIDEBAR_SECTION_LIBRARY_UNOPENED, SIDEBAR_SECTION_LOGGER, SIDEBAR_SECTION_MY_SHARES, SIDEBAR_SECTION_MY_TRACKER, SIDEBAR_SECTION_PLUGINS, SIDEBAR_SECTION_PLUS, SIDEBAR_SECTION_SEARCH, SIDEBAR_SECTION_SUBSCRIPTIONS, SIDEBAR_SECTION_TAG_DISCOVERY, SIDEBAR_SECTION_TAGS, SIDEBAR_SECTION_TORRENT_DETAILS, SIDEBAR_SECTION_TORRENT_OPTIONS, SIDEBAR_SECTION_WELCOME
 
Fields inherited from interface com.aelitis.azureus.ui.swt.skin.SWTSkinObjectListener
EVENT_CREATE_REQUEST, EVENT_CREATED, EVENT_DATASOURCE_CHANGED, EVENT_DESTROY, EVENT_HIDE, EVENT_LANGUAGE_CHANGE, EVENT_SELECT, EVENT_SHOW, NAMES
 
Constructor Summary
BaseMDI()
           
 
Method Summary
 void addItem(MdiEntry entry)
           
 void addListener(MdiEntryLoadedListener l)
           
 void addListener(MdiListener l)
           
 void addListener(MdiSWTMenuHackListener l)
           
 void closeEntry(String id)
           
protected  MdiEntry createEntryByCreationListener(String id, Object ds, Map<?,?> autoOpenMap)
           
 MdiEntry createEntryFromEventListener(String parentID, Class<? extends UISWTViewEventListener> cla, String id, boolean closeable, Object data, String preferedAfterID)
           
abstract  MdiEntry createEntryFromEventListener(String parentEntryID, String parentViewID, UISWTViewEventListener l, String id, boolean closeable, Object datasource, String preferredAfterID)
           
 MdiEntry createEntryFromEventListener(String parentID, UISWTViewEventListener l, String id, boolean closeable, Object datasource, String preferedAfterID)
          If you prefix the 'preferedAfterID' string with '~' then the operation will actually switch to 'preferedBeforeID'
abstract  MdiEntry createEntryFromSkinRef(String parentID, 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'
 void deregisterEntry(String id, MdiEntryCreationListener l)
           
 void deregisterEntry(String id, MdiEntryCreationListener2 l)
           
 boolean entryExists(String id)
           
 void fillMenu(org.eclipse.swt.widgets.Menu menu, MdiEntry entry, String menuID)
           
 List<MdiEntry> getChildrenOf(String id)
           
 UISWTViewCore getCoreViewFromID(String id)
           
 MdiEntry getCurrentEntry()
           
 MdiEntrySWT getCurrentEntrySWT()
           
 MdiEntry[] getEntries()
           
<T extends MdiEntry>
T[]
getEntries(T[] array)
           
 int getEntriesCount()
           
 MdiEntrySWT[] getEntriesSWT()
           
 MdiEntry getEntry(String id)
           
 MdiEntry getEntryBySkinView(Object skinView)
           
 MdiEntrySWT getEntrySWT(String id)
           
 MdiSWTMenuHackListener[] getMenuHackListeners()
           
 String[] getPreferredOrder()
           
 String getUpdateUIName()
          A name for this UIUpdatable so we can track who's being bad
 void informAutoOpenSet(MdiEntry entry, Map<String,Object> autoOpenInfo)
           
protected  void itemSelected(MdiEntry entry)
           
 void loadCloseables()
           
 boolean loadEntryByID(String id, boolean activate)
           
 boolean loadEntryByID(String id, boolean activate, boolean onlyLoadOnce, Object datasource)
           
 void registerEntry(String id, MdiEntryCreationListener l)
           
 void registerEntry(String id, MdiEntryCreationListener2 l)
           
 void removeEntryAutoOpen(String id)
           
 void removeItem(MdiEntry entry)
           
 void removeListener(MdiEntryLoadedListener l)
           
 void removeListener(MdiListener l)
           
 void removeListener(MdiSWTMenuHackListener l)
           
 void saveCloseables()
           
 void setCloseableConfigFile(String closeableConfigFile)
           
 void setEntryAutoOpen(String id, Object datasource)
          When an entry can not be opened (ie.
protected abstract  void setEntryLoadedOnce(String id)
           
 void setPreferredOrder(String[] preferredOrder)
           
protected  void setupPluginViews()
           
 boolean showEntryByID(String id)
           
 boolean showEntryByID(String id, Object datasource)
           
 Object skinObjectDestroyed(SWTSkinObject skinObject, Object params)
          Skin Object was destroyed
 Object skinObjectInitialShow(SWTSkinObject skinObject, Object params)
           
 void triggerEntryLoadedListeners(MdiEntry entry)
           
protected  void triggerSelectionListener(MdiEntry newEntry, MdiEntry oldEntry)
           
 Object updateLanguage(SWTSkinObject skinObject, Object params)
          skinObject needs to update any text
 void updateUI()
          Update your UI!
protected abstract  boolean wasEntryLoadedOnce(String id)
           
 
Methods inherited from class com.aelitis.azureus.ui.swt.views.skin.SkinView
getMainSkinObject, getSkin, getSkinObject, isDisposed, isVisible, setMainSkinObject, skinObjectCreated, skinObjectHidden, skinObjectShown
 
Methods inherited from class com.aelitis.azureus.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.aelitis.azureus.ui.swt.mdi.MultipleDocumentInterfaceSWT
getEntryFromSkinObject
 
Methods inherited from interface com.aelitis.azureus.ui.mdi.MultipleDocumentInterface
createHeader, isDisposed, isVisible, showEntry
 

Field Detail

currentEntry

protected MdiEntrySWT currentEntry
Constructor Detail

BaseMDI

public BaseMDI()
Method Detail

addListener

public void addListener(MdiListener l)
Specified by:
addListener in interface MultipleDocumentInterface

removeListener

public void removeListener(MdiListener l)
Specified by:
removeListener in interface MultipleDocumentInterface

addListener

public void addListener(MdiEntryLoadedListener l)
Specified by:
addListener in interface MultipleDocumentInterface

removeListener

public void removeListener(MdiEntryLoadedListener l)
Specified by:
removeListener in interface MultipleDocumentInterface

triggerSelectionListener

protected void triggerSelectionListener(MdiEntry newEntry,
                                        MdiEntry oldEntry)

triggerEntryLoadedListeners

public void triggerEntryLoadedListeners(MdiEntry entry)

closeEntry

public void closeEntry(String id)
Specified by:
closeEntry in interface MultipleDocumentInterface

createEntryFromEventListener

public final MdiEntry createEntryFromEventListener(String parentID,
                                                   UISWTViewEventListener l,
                                                   String id,
                                                   boolean closeable,
                                                   Object datasource,
                                                   String preferedAfterID)
Description copied from interface: MultipleDocumentInterfaceSWT
If you prefix the 'preferedAfterID' string with '~' then the operation will actually switch to 'preferedBeforeID'

Specified by:
createEntryFromEventListener in interface MultipleDocumentInterfaceSWT

createEntryFromEventListener

public abstract MdiEntry createEntryFromEventListener(String parentEntryID,
                                                      String parentViewID,
                                                      UISWTViewEventListener l,
                                                      String id,
                                                      boolean closeable,
                                                      Object datasource,
                                                      String preferredAfterID)
Specified by:
createEntryFromEventListener in interface MultipleDocumentInterfaceSWT

createEntryFromSkinRef

public abstract MdiEntry createEntryFromSkinRef(String parentID,
                                                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 interface MultipleDocumentInterface
Returns:

createEntryFromEventListener

public MdiEntry createEntryFromEventListener(String parentID,
                                             Class<? extends UISWTViewEventListener> cla,
                                             String id,
                                             boolean closeable,
                                             Object data,
                                             String preferedAfterID)
Specified by:
createEntryFromEventListener in interface MultipleDocumentInterfaceSWT

getCurrentEntry

public MdiEntry getCurrentEntry()
Specified by:
getCurrentEntry in interface MultipleDocumentInterface

getCurrentEntrySWT

public MdiEntrySWT getCurrentEntrySWT()
Specified by:
getCurrentEntrySWT in interface MultipleDocumentInterfaceSWT

getEntries

public MdiEntry[] getEntries()
Specified by:
getEntries in interface MultipleDocumentInterface

getEntriesSWT

public MdiEntrySWT[] getEntriesSWT()

getEntries

public <T extends MdiEntry> T[] getEntries(T[] array)

getEntry

public MdiEntry getEntry(String id)
Specified by:
getEntry in interface MultipleDocumentInterface

getEntrySWT

public MdiEntrySWT getEntrySWT(String id)
Specified by:
getEntrySWT in interface MultipleDocumentInterfaceSWT

getEntryBySkinView

public MdiEntry getEntryBySkinView(Object skinView)
Specified by:
getEntryBySkinView in interface MultipleDocumentInterfaceSWT
Parameters:
skinView -
Returns:
Since:
3.1.1.1

getCoreViewFromID

public UISWTViewCore getCoreViewFromID(String id)
Specified by:
getCoreViewFromID in interface MultipleDocumentInterfaceSWT

getUpdateUIName

public String getUpdateUIName()
Description copied from interface: UIUpdatable
A name for this UIUpdatable so we can track who's being bad

Specified by:
getUpdateUIName in interface UIUpdatable
Returns:
some name

registerEntry

public void registerEntry(String id,
                          MdiEntryCreationListener2 l)
Specified by:
registerEntry in interface MultipleDocumentInterface

deregisterEntry

public void deregisterEntry(String id,
                            MdiEntryCreationListener2 l)
Specified by:
deregisterEntry in interface MultipleDocumentInterface

createEntryByCreationListener

protected MdiEntry createEntryByCreationListener(String id,
                                                 Object ds,
                                                 Map<?,?> autoOpenMap)

registerEntry

public void registerEntry(String id,
                          MdiEntryCreationListener l)
Specified by:
registerEntry in interface MultipleDocumentInterface

deregisterEntry

public void deregisterEntry(String id,
                            MdiEntryCreationListener l)
Specified by:
deregisterEntry in interface MultipleDocumentInterface

showEntryByID

public boolean showEntryByID(String id)
Specified by:
showEntryByID in interface MultipleDocumentInterface

showEntryByID

public boolean showEntryByID(String id,
                             Object datasource)
Specified by:
showEntryByID in interface MultipleDocumentInterface

skinObjectInitialShow

public Object skinObjectInitialShow(SWTSkinObject skinObject,
                                    Object params)
Specified by:
skinObjectInitialShow in class SkinView
Returns:

skinObjectDestroyed

public Object skinObjectDestroyed(SWTSkinObject skinObject,
                                  Object params)
Description copied from class: SWTSkinObjectAdapter
Skin Object was destroyed

Overrides:
skinObjectDestroyed in class SkinView

updateUI

public void updateUI()
Description copied from interface: UIUpdatable
Update your UI!

Specified by:
updateUI in interface UIUpdatable

loadEntryByID

public boolean loadEntryByID(String id,
                             boolean activate)
Specified by:
loadEntryByID in interface MultipleDocumentInterface

loadEntryByID

public boolean loadEntryByID(String id,
                             boolean activate,
                             boolean onlyLoadOnce,
                             Object datasource)
Specified by:
loadEntryByID in interface MultipleDocumentInterface

setEntryLoadedOnce

protected abstract void setEntryLoadedOnce(String id)

wasEntryLoadedOnce

protected abstract boolean wasEntryLoadedOnce(String id)

entryExists

public boolean entryExists(String id)
Specified by:
entryExists in interface MultipleDocumentInterface

setEntryAutoOpen

public void setEntryAutoOpen(String id,
                             Object datasource)
Description copied from interface: MultipleDocumentInterface
When an entry can not be opened (ie. creation listener isn't registered yet), call this to store your open request

Specified by:
setEntryAutoOpen in interface MultipleDocumentInterface

removeEntryAutoOpen

public void removeEntryAutoOpen(String id)
Specified by:
removeEntryAutoOpen in interface MultipleDocumentInterface

setupPluginViews

protected void setupPluginViews()

informAutoOpenSet

public void informAutoOpenSet(MdiEntry entry,
                              Map<String,Object> autoOpenInfo)
Specified by:
informAutoOpenSet in interface MultipleDocumentInterface

loadCloseables

public void loadCloseables()

saveCloseables

public void saveCloseables()

addItem

public void addItem(MdiEntry entry)

itemSelected

protected void itemSelected(MdiEntry entry)

removeItem

public void removeItem(MdiEntry entry)
Specified by:
removeItem in interface MultipleDocumentInterface

getChildrenOf

public List<MdiEntry> getChildrenOf(String id)
Specified by:
getChildrenOf in interface MultipleDocumentInterface

updateLanguage

public Object updateLanguage(SWTSkinObject skinObject,
                             Object params)
Description copied from class: SWTSkinObjectAdapter
skinObject needs to update any text

Overrides:
updateLanguage in class SWTSkinObjectAdapter

setPreferredOrder

public void setPreferredOrder(String[] preferredOrder)
Specified by:
setPreferredOrder in interface MultipleDocumentInterface

getPreferredOrder

public String[] getPreferredOrder()
Specified by:
getPreferredOrder in interface MultipleDocumentInterface

getEntriesCount

public int getEntriesCount()
Specified by:
getEntriesCount in interface MultipleDocumentInterface
Returns:

setCloseableConfigFile

public void setCloseableConfigFile(String closeableConfigFile)
Specified by:
setCloseableConfigFile in interface MultipleDocumentInterfaceSWT

addListener

public void addListener(MdiSWTMenuHackListener l)

removeListener

public void removeListener(MdiSWTMenuHackListener l)

getMenuHackListeners

public MdiSWTMenuHackListener[] getMenuHackListeners()

fillMenu

public void fillMenu(org.eclipse.swt.widgets.Menu menu,
                     MdiEntry entry,
                     String menuID)