use of com.biglybt.ui.swt.skin.SWTSkinButtonUtility in project BiglyBT by BiglySoftware.
the class SBC_LibraryView method setupView.
private void setupView(Core core, SWTSkinObject skinObject) {
torrentFilter = skinObject.getSkinObjectID();
if (torrentFilter.equalsIgnoreCase(SideBar.SIDEBAR_SECTION_LIBRARY_DL)) {
torrentFilterMode = TORRENTS_INCOMPLETE;
} else if (torrentFilter.equalsIgnoreCase(SideBar.SIDEBAR_SECTION_LIBRARY_CD)) {
torrentFilterMode = TORRENTS_COMPLETE;
} else if (torrentFilter.equalsIgnoreCase(SideBar.SIDEBAR_SECTION_LIBRARY_UNOPENED)) {
torrentFilterMode = TORRENTS_UNOPENED;
}
if (datasource instanceof Tag) {
Tag tag = (Tag) datasource;
TagType tagType = tag.getTagType();
if (tagType.getTagType() == TagType.TT_DOWNLOAD_STATE) {
// see GlobalManagerImp.tag_*
int tagID = tag.getTagID();
if (tagID == 1 || tagID == 3 || tagID == 11) {
torrentFilterMode = TORRENTS_INCOMPLETE;
} else if (tagID == 2 || tagID == 4 || tagID == 10) {
torrentFilterMode = TORRENTS_COMPLETE;
}
}
}
soListArea = getSkinObject(ID + "-area");
soListArea.getControl().setData("TorrentFilterMode", new Long(torrentFilterMode));
soListArea.getControl().setData("DataSource", datasource);
setViewMode(COConfigurationManager.getIntParameter(torrentFilter + ".viewmode"), false);
SWTSkinObject so;
so = getSkinObject(ID + "-button-smalltable");
if (so != null) {
btnSmallTable = new SWTSkinButtonUtility(so);
btnSmallTable.addSelectionListener(new SWTSkinButtonUtility.ButtonListenerAdapter() {
@Override
public void pressed(SWTSkinButtonUtility buttonUtility, SWTSkinObject skinObject, int stateMask) {
setViewMode(MODE_SMALLTABLE, true);
}
});
}
so = getSkinObject(ID + "-button-bigtable");
if (so != null) {
btnBigTable = new SWTSkinButtonUtility(so);
btnBigTable.addSelectionListener(new SWTSkinButtonUtility.ButtonListenerAdapter() {
@Override
public void pressed(SWTSkinButtonUtility buttonUtility, SWTSkinObject skinObject, int stateMask) {
setViewMode(MODE_BIGTABLE, true);
}
});
}
SB_Transfers sb_t = MainMDISetup.getSb_transfers();
if (sb_t != null) {
sb_t.setupViewTitleWithCore(core);
}
}
Aggregations