Search in sources :

Example 6 with UISWTViewCore

use of com.biglybt.ui.swt.pifimpl.UISWTViewCore in project BiglyBT by BiglySoftware.

the class TableViewSWT_TabsCommon method addTabView.

// TabViews Functions
private MdiEntry addTabView(UISWTViewEventListenerWrapper listener, String afterID) {
    UISWTViewCore view = null;
    MdiEntrySWT entry = (MdiEntrySWT) tabbedMDI.createEntryFromEventListener(tv.getTableID(), listener, listener.getViewID(), true, null, afterID);
    if (entry instanceof UISWTViewCore) {
        view = (UISWTViewCore) entry;
    } else {
        return entry;
    }
    try {
        if (parentView != null) {
            view.setParentView(parentView);
        }
        triggerTabViewDataSourceChanged(entry, tv, null);
    } catch (Throwable e) {
        Debug.out(e);
    }
    return entry;
}
Also used : UISWTViewCore(com.biglybt.ui.swt.pifimpl.UISWTViewCore) MdiEntrySWT(com.biglybt.ui.swt.mdi.MdiEntrySWT)

Example 7 with UISWTViewCore

use of com.biglybt.ui.swt.pifimpl.UISWTViewCore in project BiglyBT by BiglySoftware.

the class SideBar method createSideBarPluginViews.

private void createSideBarPluginViews() {
    if (cPluginsArea == null) {
        return;
    }
    UISWTInstanceImpl uiSWTinstance = (UISWTInstanceImpl) UIFunctionsManagerSWT.getUIFunctionsSWT().getUISWTInstance();
    if (uiSWTinstance == null) {
        return;
    }
    UISWTViewEventListenerHolder[] pluginViews = uiSWTinstance.getViewListeners(UISWTInstance.VIEW_SIDEBAR_AREA);
    for (UISWTViewEventListenerHolder l : pluginViews) {
        if (l != null) {
            try {
                UISWTViewImpl view = new UISWTViewImpl(l.getViewID(), UISWTInstance.VIEW_SIDEBAR_AREA, false);
                view.setEventListener(l, true);
                addSideBarView(view, cPluginsArea);
                cPluginsArea.getParent().getParent().layout(true, true);
            } catch (Exception e) {
                e.printStackTrace();
            // skip, plugin probably specifically asked to not be added
            }
        }
    }
    swtViewListener = new SWTViewListener() {

        @Override
        public void setViewAdded(final String parent, final String id, final UISWTViewEventListener l) {
            if (!parent.equals(UISWTInstance.VIEW_SIDEBAR_AREA)) {
                return;
            }
            Utils.execSWTThread(new AERunnable() {

                @Override
                public void runSupport() {
                    try {
                        UISWTViewImpl view = new UISWTViewImpl(id, parent, false);
                        view.setEventListener(l, true);
                        addSideBarView(view, cPluginsArea);
                    } catch (Exception e) {
                        e.printStackTrace();
                    // skip, plugin probably specifically asked to not be added
                    }
                }
            });
        }

        @Override
        public void setViewRemoved(final String parent, final String id, final UISWTViewEventListener l) {
            if (!parent.equals(UISWTInstance.VIEW_SIDEBAR_AREA)) {
                return;
            }
            Utils.execSWTThread(new AERunnable() {

                @Override
                public void runSupport() {
                    try {
                        for (UISWTViewCore view : SideBar.this.pluginViews) {
                            if (l.equals(view.getEventListener())) {
                                view.closeView();
                            } else {
                                if (l instanceof UISWTViewEventListenerHolder) {
                                    UISWTViewEventListener l2 = ((UISWTViewEventListenerHolder) l).getDelegatedEventListener(view);
                                    if (l2 != null && l2.equals(view.getEventListener())) {
                                        view.closeView();
                                    }
                                }
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    // skip, plugin probably specifically asked to not be added
                    }
                }
            });
        }
    };
    uiSWTinstance.addSWTViewListener(swtViewListener);
    cPluginsArea.getParent().getParent().layout(true, true);
}
Also used : UISWTViewCore(com.biglybt.ui.swt.pifimpl.UISWTViewCore) UISWTViewImpl(com.biglybt.ui.swt.pifimpl.UISWTViewImpl) SWTViewListener(com.biglybt.ui.swt.pifimpl.UISWTInstanceImpl.SWTViewListener) UISWTViewEventListener(com.biglybt.ui.swt.pif.UISWTViewEventListener) UISWTViewEventListenerHolder(com.biglybt.ui.swt.pifimpl.UISWTViewEventListenerHolder) UISWTInstanceImpl(com.biglybt.ui.swt.pifimpl.UISWTInstanceImpl)

Aggregations

UISWTViewCore (com.biglybt.ui.swt.pifimpl.UISWTViewCore)7 UIPluginViewToolBarListener (com.biglybt.pif.ui.UIPluginViewToolBarListener)2 TableViewImpl (com.biglybt.ui.common.table.impl.TableViewImpl)2 UISWTViewEventListener (com.biglybt.ui.swt.pif.UISWTViewEventListener)2 UISWTViewEventListenerHolder (com.biglybt.ui.swt.pifimpl.UISWTViewEventListenerHolder)2 DownloadManager (com.biglybt.core.download.DownloadManager)1 DownloadManagerPeerListener (com.biglybt.core.download.DownloadManagerPeerListener)1 PEPeer (com.biglybt.core.peer.PEPeer)1 PEPeerStats (com.biglybt.core.peer.PEPeerStats)1 UIFunctions (com.biglybt.ui.UIFunctions)1 UserPrompterResultListener (com.biglybt.ui.UserPrompterResultListener)1 MdiEntry (com.biglybt.ui.mdi.MdiEntry)1 ISelectedContent (com.biglybt.ui.selectedcontent.ISelectedContent)1 MdiEntrySWT (com.biglybt.ui.swt.mdi.MdiEntrySWT)1 PluginUISWTSkinObject (com.biglybt.ui.swt.pif.PluginUISWTSkinObject)1 UISWTViewEvent (com.biglybt.ui.swt.pif.UISWTViewEvent)1 UISWTInstanceImpl (com.biglybt.ui.swt.pifimpl.UISWTInstanceImpl)1 SWTViewListener (com.biglybt.ui.swt.pifimpl.UISWTInstanceImpl.SWTViewListener)1 UISWTViewImpl (com.biglybt.ui.swt.pifimpl.UISWTViewImpl)1 MessageBoxShell (com.biglybt.ui.swt.shells.MessageBoxShell)1