use of com.biglybt.ui.swt.pif.UISWTInstance in project BiglyBT by BiglySoftware.
the class PiecesView method registerPluginViews.
private void registerPluginViews(final UISWTInstance pluginUI) {
if (pluginUI == null || registeredCoreSubViews) {
return;
}
pluginUI.addView(TableManager.TABLE_TORRENT_PIECES, "PieceInfoView", PieceInfoView.class, manager);
pluginUI.addView(TableManager.TABLE_TORRENT_PIECES, "MyPieceDistributionView", MyPieceDistributionView.class, manager);
registeredCoreSubViews = true;
final UIManager uiManager = PluginInitializer.getDefaultInterface().getUIManager();
uiManager.addUIListener(new UIManagerListener() {
@Override
public void UIAttached(UIInstance instance) {
}
@Override
public void UIDetached(UIInstance instance) {
if (!(instance instanceof UISWTInstance)) {
return;
}
registeredCoreSubViews = false;
pluginUI.removeViews(TableManager.TABLE_TORRENT_PIECES, "PieceInfoView");
pluginUI.removeViews(TableManager.TABLE_TORRENT_PIECES, "MyPieceDistributionView");
uiManager.removeUIListener(this);
}
});
}
use of com.biglybt.ui.swt.pif.UISWTInstance in project BiglyBT by BiglySoftware.
the class PiecesView method initYourTableView.
// @see com.biglybt.ui.swt.views.table.impl.TableViewTab#initYourTableView()
@Override
public TableViewSWT<PEPiece> initYourTableView() {
tv = TableViewFactory.createTableViewSWT(PEPiece.class, TableManager.TABLE_TORRENT_PIECES, getPropertiesPrefix(), basicItems, basicItems[0].getName(), SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);
tv.setEnableTabViews(enable_tabs, true, null);
UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (uiFunctions != null) {
UISWTInstance pluginUI = uiFunctions.getUISWTInstance();
registerPluginViews(pluginUI);
}
tv.addTableDataSourceChangedListener(this, true);
tv.addMenuFillListener(this);
tv.addLifeCycleListener(this);
tv.addSelectionListener(this, false);
return tv;
}
use of com.biglybt.ui.swt.pif.UISWTInstance in project BiglyBT by BiglySoftware.
the class FilesView method registerPluginViews.
private void registerPluginViews(final UISWTInstance pluginUI) {
if (pluginUI == null || registeredCoreSubViews) {
return;
}
DownloadManager manager;
if (managers.size() == 1) {
manager = managers.get(0);
} else {
manager = null;
}
pluginUI.addView(TableManager.TABLE_TORRENT_FILES, "FileInfoView", FileInfoView.class, manager);
registeredCoreSubViews = true;
final UIManager uiManager = PluginInitializer.getDefaultInterface().getUIManager();
uiManager.addUIListener(new UIManagerListener() {
@Override
public void UIAttached(UIInstance instance) {
}
@Override
public void UIDetached(UIInstance instance) {
if (!(instance instanceof UISWTInstance)) {
return;
}
registeredCoreSubViews = false;
pluginUI.removeViews(TableManager.TABLE_TORRENT_FILES, "FileInfoView");
uiManager.removeUIListener(this);
}
});
}
use of com.biglybt.ui.swt.pif.UISWTInstance in project BiglyBT by BiglySoftware.
the class MainMenuV3 method builFileMenu.
/**
* Builds the File menu dynamically
* @param fileMenu
*/
private void builFileMenu(Menu fileMenu) {
MenuItem openMenuItem = MenuFactory.createOpenMenuItem(fileMenu);
Menu openSubMenu = openMenuItem.getMenu();
MenuFactory.addOpenTorrentMenuItem(openSubMenu);
MenuFactory.addOpenURIMenuItem(openSubMenu);
MenuFactory.addOpenTorrentForTrackingMenuItem(openSubMenu);
MenuFactory.addOpenVuzeFileMenuItem(openSubMenu);
int userMode = COConfigurationManager.getIntParameter("User Mode");
if (userMode > 0) {
Menu shareSubMenu = MenuFactory.createShareMenuItem(fileMenu).getMenu();
MenuFactory.addShareFileMenuItem(shareSubMenu);
MenuFactory.addShareFolderMenuItem(shareSubMenu);
MenuFactory.addShareFolderContentMenuItem(shareSubMenu);
MenuFactory.addShareFolderContentRecursiveMenuItem(shareSubMenu);
}
MenuFactory.addCreateMenuItem(fileMenu);
if (!Constants.isOSX) {
MenuFactory.addSeparatorMenuItem(fileMenu);
MenuFactory.addCloseWindowMenuItem(fileMenu);
MenuFactory.addCloseDetailsMenuItem(fileMenu);
MenuFactory.addCloseDownloadBarsToMenu(fileMenu);
}
MenuFactory.addSeparatorMenuItem(fileMenu);
MenuFactory.createTransfersMenuItem(fileMenu);
/*
* No need for restart and exit on OS X since it's already handled on the application menu
*/
if (!Constants.isOSX) {
MenuFactory.addSeparatorMenuItem(fileMenu);
MenuFactory.addRestartMenuItem(fileMenu);
}
if (Constants.isCVSVersion() && !UI.isFirstUI()) {
MenuItem itemLogout = new MenuItem(fileMenu, SWT.PUSH);
itemLogout.setText("Shutdown UI (Keep " + Constants.APP_NAME + " running)");
itemLogout.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (uiFunctions != null) {
UISWTInstance uiSWTInstance = uiFunctions.getUISWTInstance();
if (uiSWTInstance instanceof UIInstanceFactory) {
try {
PluginInterface pi = PluginInitializer.getDefaultInterface();
pi.getUIManager().detachUI((UIInstanceFactory) uiSWTInstance);
} catch (UIException e1) {
e1.printStackTrace();
}
}
}
}
});
}
if (!Constants.isOSX) {
MenuFactory.addExitMenuItem(fileMenu);
}
}
use of com.biglybt.ui.swt.pif.UISWTInstance in project BiglyBT by BiglySoftware.
the class SBC_ArchivedDownloadsView method registerPluginViews.
private void registerPluginViews(final UISWTInstance pluginUI) {
if (registeredCoreSubViews) {
return;
}
pluginUI.addView(TABLE_NAME, "ArchivedFilesView", ArchivedFilesView.class, null);
registeredCoreSubViews = true;
final UIManager uiManager = PluginInitializer.getDefaultInterface().getUIManager();
uiManager.addUIListener(new UIManagerListener() {
@Override
public void UIAttached(UIInstance instance) {
}
@Override
public void UIDetached(UIInstance instance) {
if (!(instance instanceof UISWTInstance)) {
return;
}
registeredCoreSubViews = false;
pluginUI.removeViews(TABLE_NAME, "ArchivedFilesView");
uiManager.removeUIListener(this);
}
});
}
Aggregations