use of com.biglybt.ui.mdi.MdiEntry in project BiglyBT by BiglySoftware.
the class TabbedMDI method getUpdateUIName.
@Override
public String getUpdateUIName() {
String name = "MDI";
MdiEntry entry = getCurrentEntry();
if (entry != null) {
name += "-" + entry.getViewID();
}
return name;
}
use of com.biglybt.ui.mdi.MdiEntry in project BiglyBT by BiglySoftware.
the class TabbedMDI method skinObjectDestroyed.
/* (non-Javadoc)
* @see BaseMDI#skinObjectDestroyed(SWTSkinObject, java.lang.Object)
*/
@Override
public Object skinObjectDestroyed(SWTSkinObject skinObject, Object params) {
saveCloseables();
MdiEntry[] entries = getEntries();
for (MdiEntry entry : entries) {
closeEntry(entry, false);
}
String key = props_prefix + ".closedtabs";
COConfigurationManager.removeWeakParameterListener(this, key);
COConfigurationManager.removeParameterListener("GUI_SWT_bFancyTab", paramFancyTabListener);
return super.skinObjectDestroyed(skinObject, params);
}
use of com.biglybt.ui.mdi.MdiEntry in project BiglyBT by BiglySoftware.
the class TabbedMDI method setEntriesDataSource.
@Override
public void setEntriesDataSource(Object newDataSource) {
if (DataSourceUtils.areSame(newDataSource, dataSource)) {
return;
}
dataSource = newDataSource;
MdiEntry[] entries = getEntries();
for (MdiEntry entry : entries) {
entry.setDatasource(dataSource);
}
DownloadManager[] dms = DataSourceUtils.getDMs(dataSource);
if (maximizeListener != null) {
setMaximizeVisible(dms.length == 1);
}
}
use of com.biglybt.ui.mdi.MdiEntry in project BiglyBT by BiglySoftware.
the class SideBar method showNext.
private void showNext() {
MdiEntry current = getCurrentEntry();
String next = null;
synchronized (entryViewHistory) {
while (!entryViewFuture.isEmpty()) {
String maybe_next = entryViewFuture.pop();
if (entryExists(maybe_next)) {
if (current != null && current.getViewID().equals(maybe_next)) {
continue;
}
next = maybe_next;
// prepare for show-next so we keep future history
entryViewHistory.push(next);
break;
}
}
}
if (next != null) {
showEntryByID(next);
}
}
use of com.biglybt.ui.mdi.MdiEntry in project BiglyBT by BiglySoftware.
the class SideBar method skinObjectCreated.
// @see SWTSkinObjectAdapter#skinObjectCreated(SWTSkinObject, java.lang.Object)
@Override
public Object skinObjectCreated(SWTSkinObject skinObject, Object params) {
super.skinObjectCreated(skinObject, params);
skin = skinObject.getSkin();
soSideBarContents = (SWTSkinObjectContainer) skin.getSkinObject("sidebar-contents");
soSideBarPopout = skin.getSkinObject("sidebar-pop");
SWTSkinObjectContainer soSideBarPluginsArea = (SWTSkinObjectContainer) skin.getSkinObject("sidebar-plugins");
if (soSideBarPluginsArea != null) {
/*
Composite composite = soSideBarPluginsArea.getComposite();
cPluginsArea = new Composite(composite, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = layout.marginWidth = 0;
layout.verticalSpacing = layout.horizontalSpacing = 0;
cPluginsArea.setLayout(layout);
cPluginsArea.setLayoutData(Utils.getFilledFormData());
*/
soSideBarPluginsArea.setVisible(false);
}
addGeneralMenus();
createSideBar();
try {
// don't think this is required as the SideBar constructor (well SkinView) registers it
UIUpdater updater = UIUpdaterSWT.getInstance();
if (updater != null && !updater.isAdded(this)) {
updater.addUpdater(this);
}
} catch (Throwable e) {
Debug.out(e);
}
Display.getDefault().addFilter(SWT.KeyDown, new Listener() {
@Override
public void handleEvent(Event event) {
// F7 works on both
if (event.keyCode == SWT.F9 || event.keyCode == SWT.F7 || (event.keyCode == 116 && event.stateMask == (SWT.COMMAND | SWT.ALT))) {
event.doit = false;
event.keyCode = 0;
event.character = '\0';
flipSideBarVisibility();
} else if (event.keyCode == SWT.F4 && event.stateMask == SWT.CTRL) {
MdiEntry entry = getCurrentEntry();
if (entry instanceof SideBarEntrySWT && entry.isCloseable()) {
((SideBarEntrySWT) entry).getTreeItem().dispose();
}
}
}
});
Display.getDefault().addFilter(SWT.Traverse, (ev) -> {
if (ev.character == '\t' && (ev.stateMask & (SWT.MOD1 + SWT.SHIFT)) == SWT.MOD1) {
showNext();
ev.doit = false;
} else if (ev.character == '\t' && (ev.stateMask & (SWT.MOD1 + SWT.SHIFT)) == SWT.MOD1 + SWT.SHIFT) {
showPrevious();
ev.doit = false;
}
});
return null;
}
Aggregations