use of com.biglybt.pif.ui.UIPluginViewToolBarListener in project BiglyBT by BiglySoftware.
the class SkinView method skinObjectCreated.
@Override
public Object skinObjectCreated(SWTSkinObject skinObject, Object params) {
SkinViewManager.add(this);
MultipleDocumentInterfaceSWT mdi = UIFunctionsManagerSWT.getUIFunctionsSWT().getMDISWT();
if (mdi != null) {
MdiEntry entry = mdi.getEntryFromSkinObject(skinObject);
if (entry != null && (this instanceof UIPluginViewToolBarListener)) {
entry.addToolbarEnabler((UIPluginViewToolBarListener) this);
}
}
return super.skinObjectCreated(skinObject, params);
}
use of com.biglybt.pif.ui.UIPluginViewToolBarListener in project BiglyBT by BiglySoftware.
the class MyTorrentsView method refreshToolBarItems.
@Override
public void refreshToolBarItems(Map<String, Long> list) {
if (!isTableFocus()) {
UISWTViewCore active_view = getActiveView();
if (active_view != null) {
UIPluginViewToolBarListener l = active_view.getToolBarListener();
if (l != null) {
Map<String, Long> activeViewList = new HashMap<>();
l.refreshToolBarItems(activeViewList);
if (activeViewList.size() > 0) {
list.putAll(activeViewList);
return;
}
}
}
}
}
use of com.biglybt.pif.ui.UIPluginViewToolBarListener in project BiglyBT by BiglySoftware.
the class MyTorrentsView method toolBarItemActivated.
@Override
public boolean toolBarItemActivated(ToolBarItem item, long activationType, Object datasource) {
boolean isTableSelected = false;
if (tv instanceof TableViewImpl) {
isTableSelected = ((TableViewImpl) tv).isTableSelected();
}
if (!isTableSelected) {
UISWTViewCore active_view = getActiveView();
if (active_view != null) {
UIPluginViewToolBarListener l = active_view.getToolBarListener();
if (l != null && l.toolBarItemActivated(item, activationType, datasource)) {
return true;
}
}
return false;
}
String itemKey = item.getID();
if (activationType == UIToolBarActivationListener.ACTIVATIONTYPE_HELD) {
if (itemKey.equals("up")) {
moveSelectedTorrentsTop();
return true;
}
if (itemKey.equals("down")) {
moveSelectedTorrentsEnd();
return true;
}
return false;
}
if (activationType != UIToolBarActivationListener.ACTIVATIONTYPE_NORMAL) {
return false;
}
if (itemKey.equals("top")) {
moveSelectedTorrentsTop();
return true;
}
if (itemKey.equals("bottom")) {
moveSelectedTorrentsEnd();
return true;
}
if (itemKey.equals("up")) {
moveSelectedTorrentsUp();
return true;
}
if (itemKey.equals("down")) {
moveSelectedTorrentsDown();
return true;
}
if (itemKey.equals("run")) {
TorrentUtil.runDataSources(tv.getSelectedDataSources().toArray());
return true;
}
if (itemKey.equals("start")) {
TorrentUtil.queueDataSources(tv.getSelectedDataSources().toArray(), false);
return true;
}
if (itemKey.equals("stop")) {
TorrentUtil.stopDataSources(tv.getSelectedDataSources().toArray());
return true;
}
if (itemKey.equals("startstop")) {
TorrentUtil.stopOrStartDataSources(tv.getSelectedDataSources().toArray(), false);
return true;
}
if (itemKey.equals("remove")) {
TorrentUtil.removeDataSources(tv.getSelectedDataSources().toArray());
return true;
}
return false;
}
use of com.biglybt.pif.ui.UIPluginViewToolBarListener in project BiglyBT by BiglySoftware.
the class SBC_AllTrackersView method toolBarItemActivated.
@Override
public boolean toolBarItemActivated(ToolBarItem item, long activationType, Object datasource) {
boolean isTableSelected = false;
if (tv instanceof TableViewImpl) {
isTableSelected = ((TableViewImpl) tv).isTableSelected();
}
if (!isTableSelected) {
UISWTViewCore active_view = getActiveView();
if (active_view != null) {
UIPluginViewToolBarListener l = active_view.getToolBarListener();
if (l != null && l.toolBarItemActivated(item, activationType, datasource)) {
return true;
}
}
return false;
}
if (tv == null || !tv.isVisible()) {
return (false);
}
boolean didSomething = false;
List<Object> datasources = tv.getSelectedDataSources();
for (Object o : datasources) {
AllTrackersViewEntry entry = (AllTrackersViewEntry) o;
String id = item.getID();
if (id.equals("remove")) {
entry.remove();
didSomething = true;
}
}
return (didSomething);
}
Aggregations