use of org.cytoscape.webservice.internal.task.ShowImportDialogAction in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
// UI for Network Import Clients
WebServiceImportDialog<NetworkImportWebServiceClient> unifiedNetworkImportDialog = new WebServiceImportDialog<NetworkImportWebServiceClient>(NetworkImportWebServiceClient.class, "Import Network from Public Databases", serviceRegistrar);
// UI for Table Import Clients
WebServiceImportDialog<TableImportWebServiceClient> unifiedTableImportDialog = new WebServiceImportDialog<TableImportWebServiceClient>(TableImportWebServiceClient.class, "Import Table from Public Databases", serviceRegistrar);
WebServiceGUIImpl webServiceGui = new WebServiceGUIImpl();
webServiceGui.addClient(NetworkImportWebServiceClient.class, unifiedNetworkImportDialog);
webServiceGui.addClient(TableImportWebServiceClient.class, unifiedTableImportDialog);
// ALT (for Mac, it's Option)
final KeyStroke networkImportShortcut = KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.ALT_DOWN_MASK);
final KeyStroke tableImportShortcut = KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.ALT_DOWN_MASK);
ShowImportDialogAction showImportNetworkFromWebServiceDialogAction = new ShowImportDialogAction(unifiedNetworkImportDialog, "File.Import.Network", 3.0f, "Public Databases...", networkImportShortcut, "Import Network from Database...", serviceRegistrar);
ShowImportDialogAction showImportTableFromWebServiceDialogAction = new ShowImportDialogAction(unifiedTableImportDialog, "File.Import.Table", 3.0f, "Public Databases...", tableImportShortcut, serviceRegistrar);
{
Properties props = new Properties();
props.setProperty("id", "showImportNetworkFromWebServiceDialogAction");
registerService(bc, showImportNetworkFromWebServiceDialogAction, CyAction.class, props);
}
registerService(bc, showImportTableFromWebServiceDialogAction, CyAction.class, new Properties());
registerService(bc, webServiceGui, WebServiceGUI.class, new Properties());
registerServiceListener(bc, unifiedNetworkImportDialog::addClient, unifiedNetworkImportDialog::removeClient, WebServiceClient.class);
registerServiceListener(bc, unifiedTableImportDialog::addClient, unifiedTableImportDialog::removeClient, WebServiceClient.class);
}
Aggregations