use of org.cytoscape.browser.internal.view.AbstractTableBrowser in project cytoscape-impl by cytoscape.
the class ClearErrorsEdit method getBrowserTable.
public static BrowserTable getBrowserTable(final CyTable table, final CyServiceRegistrar serviceRegistrar) {
final CySwingApplication swingAppManager = serviceRegistrar.getService(CySwingApplication.class);
final CytoPanel cytoPanel = swingAppManager.getCytoPanel(CytoPanelName.SOUTH);
if (cytoPanel != null) {
final int count = cytoPanel.getCytoPanelComponentCount();
for (int i = 0; i < count; i++) {
final Component c = cytoPanel.getComponentAt(i);
if (c instanceof AbstractTableBrowser) {
final AbstractTableBrowser tableBrowser = (AbstractTableBrowser) c;
final BrowserTable browserTable = tableBrowser.getBrowserTable(table);
if (browserTable != null)
return browserTable;
}
}
}
return null;
}
use of org.cytoscape.browser.internal.view.AbstractTableBrowser in project cytoscape-impl by cytoscape.
the class SetColumnFormatTask method getBrowserTable.
public static BrowserTable getBrowserTable(final CyTable table, final CyServiceRegistrar serviceRegistrar) {
final CySwingApplication swingAppManager = serviceRegistrar.getService(CySwingApplication.class);
final CytoPanel cytoPanel = swingAppManager.getCytoPanel(CytoPanelName.SOUTH);
if (cytoPanel != null) {
final int count = cytoPanel.getCytoPanelComponentCount();
for (int i = 0; i < count; i++) {
final Component c = cytoPanel.getComponentAt(i);
if (c instanceof AbstractTableBrowser) {
final AbstractTableBrowser tableBrowser = (AbstractTableBrowser) c;
final BrowserTable browserTable = tableBrowser.getBrowserTable(table);
if (browserTable != null)
return browserTable;
}
}
}
return null;
}
use of org.cytoscape.browser.internal.view.AbstractTableBrowser in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
PopupMenuHelper popupMenuHelper = new PopupMenuHelper(serviceRegistrar);
AbstractTableBrowser nodeTableBrowser = new DefaultTableBrowser("Node Table", CyNode.class, serviceRegistrar, popupMenuHelper);
AbstractTableBrowser edgeTableBrowser = new DefaultTableBrowser("Edge Table", CyEdge.class, serviceRegistrar, popupMenuHelper);
AbstractTableBrowser networkTableBrowser = new DefaultTableBrowser("Network Table", CyNetwork.class, serviceRegistrar, popupMenuHelper);
AbstractTableBrowser globalTableBrowser = new GlobalTableBrowser("Unassigned Tables", serviceRegistrar, popupMenuHelper);
registerAllServices(bc, nodeTableBrowser, new Properties());
registerAllServices(bc, edgeTableBrowser, new Properties());
registerAllServices(bc, networkTableBrowser, new Properties());
final Properties globalTableProp = new Properties();
registerService(bc, globalTableBrowser, ActionListener.class, globalTableProp);
registerService(bc, globalTableBrowser, SessionLoadedListener.class, globalTableProp);
registerService(bc, globalTableBrowser, SessionAboutToBeSavedListener.class, globalTableProp);
registerService(bc, globalTableBrowser, TableAboutToBeDeletedListener.class, globalTableProp);
registerService(bc, globalTableBrowser, TableAddedListener.class, globalTableProp);
registerService(bc, globalTableBrowser, TablePrivacyChangedListener.class, globalTableProp);
registerService(bc, globalTableBrowser, RowsSetListener.class, globalTableProp);
registerService(bc, globalTableBrowser, RowsDeletedListener.class, globalTableProp);
registerServiceListener(bc, popupMenuHelper::addTableColumnTaskFactory, popupMenuHelper::removeTableColumnTaskFactory, TableColumnTaskFactory.class);
registerServiceListener(bc, popupMenuHelper::addTableCellTaskFactory, popupMenuHelper::removeTableCellTaskFactory, TableCellTaskFactory.class);
{
ClearAllErrorsTaskFactory taskFactory = new ClearAllErrorsTaskFactory(serviceRegistrar);
Properties props = new Properties();
props.setProperty(TITLE, "Clear all errors");
registerService(bc, taskFactory, TableColumnTaskFactory.class, props);
}
{
SetColumnFormatTaskFactory taskFactory = new SetColumnFormatTaskFactory(serviceRegistrar);
Properties props = new Properties();
props.setProperty(TITLE, "Format column...");
registerService(bc, taskFactory, TableColumnTaskFactory.class, props);
}
}
Aggregations