use of com.biglybt.ui.mdi.MdiEntryLoadedListener 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);
}
});
}
Aggregations