Search in sources :

Example 1 with WebServiceGUIImpl

use of org.cytoscape.webservice.internal.ui.WebServiceGUIImpl 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[23]", 0.5f, "Network from Public Databases...", networkImportShortcut, "Import a network from a curated database", serviceRegistrar);
    ShowImportDialogAction showImportTableFromWebServiceDialogAction = new ShowImportDialogAction(unifiedTableImportDialog, "File.Import[23]", 7.0f, "Table from 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