Search in sources :

Example 1 with TableImportWebServiceClient

use of org.cytoscape.io.webservice.TableImportWebServiceClient 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);
}
Also used : WebServiceImportDialog(org.cytoscape.webservice.internal.ui.WebServiceImportDialog) ShowImportDialogAction(org.cytoscape.webservice.internal.task.ShowImportDialogAction) Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) NetworkImportWebServiceClient(org.cytoscape.io.webservice.NetworkImportWebServiceClient) TableImportWebServiceClient(org.cytoscape.io.webservice.TableImportWebServiceClient) KeyStroke(javax.swing.KeyStroke) CyAction(org.cytoscape.application.swing.CyAction) WebServiceGUIImpl(org.cytoscape.webservice.internal.ui.WebServiceGUIImpl)

Aggregations

Properties (java.util.Properties)1 KeyStroke (javax.swing.KeyStroke)1 CyAction (org.cytoscape.application.swing.CyAction)1 NetworkImportWebServiceClient (org.cytoscape.io.webservice.NetworkImportWebServiceClient)1 TableImportWebServiceClient (org.cytoscape.io.webservice.TableImportWebServiceClient)1 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)1 ShowImportDialogAction (org.cytoscape.webservice.internal.task.ShowImportDialogAction)1 WebServiceGUIImpl (org.cytoscape.webservice.internal.ui.WebServiceGUIImpl)1 WebServiceImportDialog (org.cytoscape.webservice.internal.ui.WebServiceImportDialog)1