Search in sources :

Example 6 with SWTSkinButtonUtility

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);
    }
}
Also used : TagType(com.biglybt.core.tag.TagType) SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) SWTSkinButtonUtility(com.biglybt.ui.swt.skin.SWTSkinButtonUtility) Tag(com.biglybt.core.tag.Tag) Point(org.eclipse.swt.graphics.Point)

Aggregations

SWTSkinButtonUtility (com.biglybt.ui.swt.skin.SWTSkinButtonUtility)6 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)6 ToolBarItem (com.biglybt.ui.common.ToolBarItem)2 SWTSkinObjectText (com.biglybt.ui.swt.skin.SWTSkinObjectText)2 List (java.util.List)2 ActivitiesEntry (com.biglybt.activities.ActivitiesEntry)1 Tag (com.biglybt.core.tag.Tag)1 TagType (com.biglybt.core.tag.TagType)1 TOTorrentFile (com.biglybt.core.torrent.TOTorrentFile)1 SWTSkin (com.biglybt.ui.swt.skin.SWTSkin)1 ButtonListenerAdapter (com.biglybt.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter)1 SWTSkinCheckboxListener (com.biglybt.ui.swt.skin.SWTSkinCheckboxListener)1 SWTSkinObjectButton (com.biglybt.ui.swt.skin.SWTSkinObjectButton)1 SWTSkinObjectCheckbox (com.biglybt.ui.swt.skin.SWTSkinObjectCheckbox)1 SWTSkinObjectContainer (com.biglybt.ui.swt.skin.SWTSkinObjectContainer)1 SWTSkinObjectList (com.biglybt.ui.swt.skin.SWTSkinObjectList)1 SWTSkinObjectTextbox (com.biglybt.ui.swt.skin.SWTSkinObjectTextbox)1 SkinnedDialog (com.biglybt.ui.swt.views.skin.SkinnedDialog)1 StandardButtonsArea (com.biglybt.ui.swt.views.skin.StandardButtonsArea)1 URL (java.net.URL)1