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