use of com.biglybt.ui.swt.pifimpl.UIToolBarItemImpl in project BiglyBT by BiglySoftware.
the class ToolBarView method createItemSO.
private void createItemSO(ToolBarItem item, String templatePrefix, int position) {
ToolBarItemSO existingItemSO;
synchronized (mapToolBarItemToSO) {
existingItemSO = mapToolBarItemToSO.get(item);
}
if (existingItemSO != null) {
SWTSkinObject so = existingItemSO.getSO();
if (so != null) {
so.dispose();
}
}
String templateID = templatePrefix;
if (position == SWT.RIGHT) {
templateID += ".right";
} else if (position == SWT.LEFT) {
templateID += ".left";
} else if (position == SWT.SINGLE) {
templateID += ".lr";
}
Control attachToControl = getLastControl(item.getGroupID());
String id = "toolbar:" + item.getID();
SWTSkinObject so = skin.createSkinObject(id, templateID, getGroupSO(item.getGroupID()));
if (so != null) {
ToolBarItemSO itemSO;
itemSO = new ToolBarItemSO((UIToolBarItemImpl) item, so);
if (attachToControl != null) {
FormData fd = (FormData) so.getControl().getLayoutData();
fd.left = new FormAttachment(attachToControl);
}
initSO(so, itemSO);
if (initComplete) {
Utils.relayout(so.getControl().getParent());
}
}
}
use of com.biglybt.ui.swt.pifimpl.UIToolBarItemImpl in project BiglyBT by BiglySoftware.
the class ToolBarView method createItem.
private ToolBarItem createItem(ToolBarView tbv, String id, String imageid, String textID) {
UIToolBarItemImpl base = new UIToolBarItemImpl(id);
base.setImageID(imageid);
base.setTextID(textID);
return base;
}
use of com.biglybt.ui.swt.pifimpl.UIToolBarItemImpl in project BiglyBT by BiglySoftware.
the class ToolBarView method createItemSO.
private void createItemSO(Map<UIToolBarItem, ToolBarItemSO> newMap, ToolBarItem item, String templatePrefix, int position) {
ToolBarItemSO existingItemSO = newMap.get(item);
if (existingItemSO != null) {
SWTSkinObject so = existingItemSO.getSO();
if (so != null) {
so.dispose();
}
}
String templateID = templatePrefix;
if (position == SWT.RIGHT) {
templateID += ".right";
} else if (position == SWT.LEFT) {
templateID += ".left";
} else if (position == SWT.SINGLE) {
templateID += ".lr";
}
Control attachToControl = getLastControl(item.getGroupID());
String id = "toolbar:" + item.getID();
SWTSkinObject so = skin.createSkinObject(id, templateID, getGroupSO(item.getGroupID()));
if (so != null) {
ToolBarItemSO itemSO;
itemSO = new ToolBarItemSO((UIToolBarItemImpl) item, so);
if (attachToControl != null) {
FormData fd = (FormData) so.getControl().getLayoutData();
fd.left = new FormAttachment(attachToControl);
}
initSO(newMap, so, itemSO);
if (initComplete) {
Utils.relayout(so.getControl().getParent());
}
}
}
Aggregations