Search in sources :

Example 16 with ViewTitleInfo

use of com.biglybt.ui.common.viewtitleinfo.ViewTitleInfo in project BiglyBT by BiglySoftware.

the class SB_Vuze method setup.

private void setup(final MultipleDocumentInterface mdi) {
    ViewTitleInfoBetaP.setupSidebarEntry(mdi);
    WelcomeView.setupSidebarEntry(mdi);
    SBC_ActivityTableView.setupSidebarEntry(mdi);
    // Refresh the Vuze header when one of the children's title properties change
    viewTitleInfoListener = new ViewTitleInfoListener() {

        @Override
        public void viewTitleInfoRefresh(ViewTitleInfo titleInfo) {
            if (SB_Vuze.this.titleInfo == null) {
                return;
            }
            MdiEntry[] childrenArray = children.toArray(new MdiEntry[0]);
            for (MdiEntry entry : childrenArray) {
                if (entry.getViewTitleInfo() == titleInfo) {
                    ViewTitleInfoManager.refreshTitleInfo(SB_Vuze.this.titleInfo);
                    break;
                }
            }
        }
    };
    ViewTitleInfoManager.addListener(viewTitleInfoListener);
    // Maintain a list of children entries; Open header on load
    mdi.addListener(new MdiEntryLoadedListener() {

        @Override
        public void mdiEntryLoaded(MdiEntry entry) {
            if (MultipleDocumentInterface.SIDEBAR_HEADER_VUZE.equals(entry.getParentID())) {
                children.add(entry);
                entry.addListener(new MdiChildCloseListener() {

                    @Override
                    public void mdiChildEntryClosed(MdiEntry parent, MdiEntry child, boolean user) {
                        children.remove(child);
                    }
                });
            }
            if (!entry.getId().equals(MultipleDocumentInterface.SIDEBAR_HEADER_VUZE)) {
                return;
            }
            titleInfo = new ViewTitleInfo_Vuze(entry);
            entry.setViewTitleInfo(titleInfo);
        }
    });
}
Also used : MdiEntry(com.biglybt.ui.mdi.MdiEntry) MdiEntryLoadedListener(com.biglybt.ui.mdi.MdiEntryLoadedListener) ViewTitleInfoListener(com.biglybt.ui.common.viewtitleinfo.ViewTitleInfoListener) MdiChildCloseListener(com.biglybt.ui.mdi.MdiChildCloseListener) ViewTitleInfo(com.biglybt.ui.common.viewtitleinfo.ViewTitleInfo)

Aggregations

ViewTitleInfo (com.biglybt.ui.common.viewtitleinfo.ViewTitleInfo)16 PluginInterface (com.biglybt.pif.PluginInterface)4 MenuItem (com.biglybt.pif.ui.menus.MenuItem)4 MdiEntry (com.biglybt.ui.mdi.MdiEntry)4 MenuItemListener (com.biglybt.pif.ui.menus.MenuItemListener)3 MenuManager (com.biglybt.pif.ui.menus.MenuManager)3 DownloadManager (com.biglybt.core.download.DownloadManager)2 GlobalManager (com.biglybt.core.global.GlobalManager)2 TimerEvent (com.biglybt.core.util.TimerEvent)2 TimerEventPerformer (com.biglybt.core.util.TimerEventPerformer)2 UIManager (com.biglybt.pif.ui.UIManager)2 MdiEntryVitalityImage (com.biglybt.ui.mdi.MdiEntryVitalityImage)2 MdiListener (com.biglybt.ui.mdi.MdiListener)2 MultipleDocumentInterface (com.biglybt.ui.mdi.MultipleDocumentInterface)2 MdiSWTMenuHackListener (com.biglybt.ui.swt.mdi.MdiSWTMenuHackListener)2 UISWTViewEventListener (com.biglybt.ui.swt.pif.UISWTViewEventListener)2 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)2 SideBarEntrySWT (com.biglybt.ui.swt.views.skin.sidebar.SideBarEntrySWT)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2