Search in sources :

Example 36 with MdiEntry

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;
}
Also used : MdiEntry(com.biglybt.ui.mdi.MdiEntry)

Example 37 with MdiEntry

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);
}
Also used : MdiEntry(com.biglybt.ui.mdi.MdiEntry)

Example 38 with MdiEntry

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);
    }
}
Also used : MdiEntry(com.biglybt.ui.mdi.MdiEntry) DownloadManager(com.biglybt.core.download.DownloadManager)

Example 39 with MdiEntry

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);
    }
}
Also used : MdiEntry(com.biglybt.ui.mdi.MdiEntry)

Example 40 with MdiEntry

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;
}
Also used : ParameterListener(com.biglybt.core.config.ParameterListener) UISWTViewEventListener(com.biglybt.ui.swt.pif.UISWTViewEventListener) SWTViewListener(com.biglybt.ui.swt.pifimpl.UISWTInstanceImpl.SWTViewListener) MdiEntry(com.biglybt.ui.mdi.MdiEntry) UISWTViewEvent(com.biglybt.ui.swt.pif.UISWTViewEvent) UIUpdater(com.biglybt.ui.common.updater.UIUpdater)

Aggregations

MdiEntry (com.biglybt.ui.mdi.MdiEntry)41 MultipleDocumentInterface (com.biglybt.ui.mdi.MultipleDocumentInterface)13 BaseMdiEntry (com.biglybt.ui.swt.mdi.BaseMdiEntry)11 MenuItem (com.biglybt.pif.ui.menus.MenuItem)4 ViewTitleInfo (com.biglybt.ui.common.viewtitleinfo.ViewTitleInfo)4 MdiCloseListener (com.biglybt.ui.mdi.MdiCloseListener)4 MultipleDocumentInterfaceSWT (com.biglybt.ui.swt.mdi.MultipleDocumentInterfaceSWT)4 UISWTViewEvent (com.biglybt.ui.swt.pif.UISWTViewEvent)4 UISWTViewEventListener (com.biglybt.ui.swt.pif.UISWTViewEventListener)4 ParameterListener (com.biglybt.core.config.ParameterListener)3 DownloadManager (com.biglybt.core.download.DownloadManager)3 PluginInterface (com.biglybt.pif.PluginInterface)3 UIPluginViewToolBarListener (com.biglybt.pif.ui.UIPluginViewToolBarListener)3 UIFunctions (com.biglybt.ui.UIFunctions)3 DownloadManagerPeerListener (com.biglybt.core.download.DownloadManagerPeerListener)2 PEPeer (com.biglybt.core.peer.PEPeer)2 PEPeerStats (com.biglybt.core.peer.PEPeerStats)2 UIManager (com.biglybt.pif.ui.UIManager)2 MenuItemListener (com.biglybt.pif.ui.menus.MenuItemListener)2 MenuManager (com.biglybt.pif.ui.menus.MenuManager)2