Search in sources :

Example 6 with ToolBarItem

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

the class ToolBarView method skinObjectHidden.

// @see SkinView#skinObjectHidden(SWTSkinObject, java.lang.Object)
@Override
public Object skinObjectHidden(SWTSkinObject skinObject, Object params) {
    showCalled = false;
    SelectedContentManager.removeCurrentlySelectedContentListener(this);
    ToolBarItem[] allToolBarItems = tbm.getAllSWTToolBarItems();
    for (int i = 0; i < allToolBarItems.length; i++) {
        ToolBarItem toolBarItem = allToolBarItems[i];
        toolBarItem.removeToolBarItemListener(this);
    }
    return super.skinObjectHidden(skinObject, params);
}
Also used : ToolBarItem(com.biglybt.ui.common.ToolBarItem)

Example 7 with ToolBarItem

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

the class ToolBarView method initSO.

private void initSO(SWTSkinObject so, ToolBarItemSO itemSO) {
    ToolBarItem item = itemSO.getBase();
    itemSO.setSO(so);
    String toolTip = item.getToolTip();
    if (toolTip != null) {
        so.setTooltipID("!" + toolTip + "!");
    } else {
        so.setTooltipID(item.getToolTipID());
    }
    so.setData("toolbaritem", item);
    SWTSkinButtonUtility btn = (SWTSkinButtonUtility) so.getData("btn");
    if (btn == null) {
        btn = new SWTSkinButtonUtility(so, "toolbar-item-image");
        so.setData("btn", btn);
    }
    btn.setImage(item.getImageID());
    btn.addSelectionListener(buttonListener);
    itemSO.setSkinButton(btn);
    SWTSkinObject soTitle = skin.getSkinObject("toolbar-item-title", so);
    if (soTitle instanceof SWTSkinObjectText) {
        ((SWTSkinObjectText) soTitle).setTextID(item.getTextID());
        itemSO.setSkinTitle((SWTSkinObjectText) soTitle);
    }
    synchronized (mapToolBarItemToSO) {
        mapToolBarItemToSO.put(item, itemSO);
    }
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) SWTSkinButtonUtility(com.biglybt.ui.swt.skin.SWTSkinButtonUtility) SWTSkinObjectText(com.biglybt.ui.swt.skin.SWTSkinObjectText) ToolBarItem(com.biglybt.ui.common.ToolBarItem)

Aggregations

ToolBarItem (com.biglybt.ui.common.ToolBarItem)7 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)4 DownloadManager (com.biglybt.core.download.DownloadManager)2 GlobalManager (com.biglybt.core.global.GlobalManager)1 AERunnableBoolean (com.biglybt.core.util.AERunnableBoolean)1 Download (com.biglybt.pif.download.Download)1 UIInstance (com.biglybt.pif.ui.UIInstance)1 UIManager (com.biglybt.pif.ui.UIManager)1 UIManagerListener (com.biglybt.pif.ui.UIManagerListener)1 UIToolBarActivationListener (com.biglybt.pif.ui.toolbar.UIToolBarActivationListener)1 UIToolBarItem (com.biglybt.pif.ui.toolbar.UIToolBarItem)1 UIToolBarManager (com.biglybt.pif.ui.toolbar.UIToolBarManager)1 TableView (com.biglybt.ui.common.table.TableView)1 SWTSkinButtonUtility (com.biglybt.ui.swt.skin.SWTSkinButtonUtility)1 SWTSkinObjectContainer (com.biglybt.ui.swt.skin.SWTSkinObjectContainer)1 SWTSkinObjectText (com.biglybt.ui.swt.skin.SWTSkinObjectText)1 List (java.util.List)1 Clipboard (org.eclipse.swt.dnd.Clipboard)1