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);
}
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);
}
}
Aggregations