Search in sources :

Example 6 with SWTSkinObject

use of com.biglybt.ui.swt.skin.SWTSkinObject in project BiglyBT by BiglySoftware.

the class SkinViewManager method getByClass.

/**
 * Gets the first SkinView created of the specified class
 *
 * @param cla
 * @return
 */
public static SkinView getByClass(Class<?> cla) {
    List<SkinView> list = mapSkinViews.get(cla);
    if (list == null) {
        return null;
    }
    Object[] skinViews = list.toArray();
    for (int i = 0; i < skinViews.length; i++) {
        SkinView sv = (SkinView) skinViews[i];
        SWTSkinObject so = sv.getMainSkinObject();
        if (so != null) {
            if (!so.isDisposed()) {
                return sv;
            }
            remove(sv);
        }
    }
    return null;
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject)

Example 7 with SWTSkinObject

use of com.biglybt.ui.swt.skin.SWTSkinObject in project BiglyBT by BiglySoftware.

the class ToolBarView method skinObjectInitialShow.

// @see SkinView#showSupport(SWTSkinObject, java.lang.Object)
@Override
public Object skinObjectInitialShow(SWTSkinObject skinObject, Object params) {
    boolean uiClassic = COConfigurationManager.getStringParameter("ui").equals("az2");
    if (uiClassic && !"global-toolbar".equals(skinObject.getViewID())) {
        skinObject.setVisible(false);
        return null;
    }
    // walk up skins to see if toolbar explicitly disabled (for pop-out views for example)
    SWTSkinObject temp = skinObject;
    while (temp != null) {
        int visible = temp.getSkin().getSkinProperties().getIntValue("mdientry.toolbar.visible", 1);
        if (visible == 0) {
            skinObject.setVisible(false);
            return null;
        }
        temp = temp.getParent();
    }
    buttonListener = new toolbarButtonListener();
    if (firstTimeEver) {
        firstTimeEver = false;
        if (!uiClassic) {
            COConfigurationManager.addParameterListener("IconBar.enabled", this);
        }
        setupToolBarItems(uiClassic);
        TorrentUtil.init();
    }
    tbm.addListener(this);
    build();
    return (null);
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject)

Example 8 with SWTSkinObject

use of com.biglybt.ui.swt.skin.SWTSkinObject in project BiglyBT by BiglySoftware.

the class SBC_ActivityView method skinObjectInitialShow.

// @see SkinView#showSupport(SWTSkinObject, java.lang.Object)
@Override
public Object skinObjectInitialShow(SWTSkinObject skinObject, Object params) {
    soListArea = getSkinObject(ID + "-area");
    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);
            }
        });
    }
    so = getSkinObject(ID + "-button-right");
    if (so != null) {
        so.setVisible(true);
        SWTSkinButtonUtility btnReadAll = new SWTSkinButtonUtility(so);
        btnReadAll.setTextID("v3.activity.button.readall");
        btnReadAll.addSelectionListener(new SWTSkinButtonUtility.ButtonListenerAdapter() {

            @Override
            public void pressed(SWTSkinButtonUtility buttonUtility, SWTSkinObject skinObject, int stateMask) {
                List<ActivitiesEntry> allEntries = ActivitiesManager.getAllEntries();
                for (ActivitiesEntry entry : allEntries) {
                    entry.setRead(true);
                }
            }
        });
    }
    setViewMode(COConfigurationManager.getIntParameter(ID + ".viewmode", MODE_DEFAULT), false);
    return null;
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) SWTSkinButtonUtility(com.biglybt.ui.swt.skin.SWTSkinButtonUtility) ActivitiesEntry(com.biglybt.activities.ActivitiesEntry) List(java.util.List)

Example 9 with SWTSkinObject

use of com.biglybt.ui.swt.skin.SWTSkinObject in project BiglyBT by BiglySoftware.

the class SBC_ChatOverview method skinObjectShown.

@Override
public Object skinObjectShown(SWTSkinObject skinObject, Object params) {
    super.skinObjectShown(skinObject, params);
    SWTSkinObject so_list = getSkinObject("chats-list");
    if (so_list != null) {
        initTable((Composite) so_list.getControl());
    } else {
        System.out.println("NO chats-list");
        return null;
    }
    if (tv == null) {
        return null;
    }
    BuddyPluginBeta beta = BuddyPluginUtils.getBetaPlugin();
    if (beta != null) {
        if (!listener_added) {
            listener_added = true;
            beta.addListener(this, true);
        }
    }
    return null;
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) BuddyPluginBeta(com.biglybt.plugin.net.buddy.BuddyPluginBeta)

Example 10 with SWTSkinObject

use of com.biglybt.ui.swt.skin.SWTSkinObject in project BiglyBT by BiglySoftware.

the class SBC_DevicesView method initAdvInfo.

/**
 * @param soAdvInfo
 *
 * @since 4.1.0.5
 */
private void initAdvInfo(SWTSkinObject soAdvInfo) {
    SWTSkinButtonUtility btnAdvInfo = new SWTSkinButtonUtility(soAdvInfo);
    btnAdvInfo.addSelectionListener(new ButtonListenerAdapter() {

        @Override
        public void pressed(SWTSkinButtonUtility buttonUtility, SWTSkinObject skinObject, int stateMask) {
            SWTSkinObject soArea = getSkinObject("advinfo-area");
            if (soArea != null) {
                boolean newVisibility = !soArea.isVisible();
                setAdditionalInfoTitle(newVisibility);
            }
        }
    });
    setAdditionalInfoTitle(false);
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) SWTSkinButtonUtility(com.biglybt.ui.swt.skin.SWTSkinButtonUtility) ButtonListenerAdapter(com.biglybt.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter)

Aggregations

SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)53 SWTSkinObjectContainer (com.biglybt.ui.swt.skin.SWTSkinObjectContainer)15 GridLayout (org.eclipse.swt.layout.GridLayout)8 SWTSkinObjectListener (com.biglybt.ui.swt.skin.SWTSkinObjectListener)7 SWTSkinButtonUtility (com.biglybt.ui.swt.skin.SWTSkinButtonUtility)5 SWTSkinObjectText (com.biglybt.ui.swt.skin.SWTSkinObjectText)5 SWTSkinObjectTextbox (com.biglybt.ui.swt.skin.SWTSkinObjectTextbox)5 GridData (org.eclipse.swt.layout.GridData)5 CoreRunningListener (com.biglybt.core.CoreRunningListener)4 MultipleDocumentInterface (com.biglybt.ui.mdi.MultipleDocumentInterface)4 FormAttachment (org.eclipse.swt.layout.FormAttachment)4 FormData (org.eclipse.swt.layout.FormData)4 Core (com.biglybt.core.Core)3 ToolBarItem (com.biglybt.ui.common.ToolBarItem)3 UIUpdatable (com.biglybt.ui.common.updater.UIUpdatable)3 UIUpdater (com.biglybt.ui.common.updater.UIUpdater)3 MdiEntry (com.biglybt.ui.mdi.MdiEntry)3 PluginUISWTSkinObject (com.biglybt.ui.swt.pif.PluginUISWTSkinObject)3 Control (org.eclipse.swt.widgets.Control)3 ActivitiesEntry (com.biglybt.activities.ActivitiesEntry)2