Search in sources :

Example 1 with WebServiceClient

use of org.cytoscape.io.webservice.WebServiceClient in project cytoscape-impl by cytoscape.

the class WebServiceImportDialog method datasourceComboBoxActionPerformed.

private void datasourceComboBoxActionPerformed(ActionEvent evt) {
    // show the dialog.
    if (!readyToShow) {
        return;
    }
    Object selected = datasourceComboBox.getSelectedItem();
    if (selected == null) {
        selected = datasourceComboBox.getItemAt(0);
        if (selected == null)
            return;
    }
    queryTextPane.setText("");
    if (selected instanceof WebServiceClient == false)
        return;
    final WebServiceClient client = (WebServiceClient) selected;
    // Update Panel
    dataQueryPanel.removeAll();
    Container gui = getUIPanel(client);
    if (gui != null) {
        // This service has custom panel.
        dataQueryPanel.add(gui, BorderLayout.CENTER);
        // Hide button panel.
        buttonPanel.setVisible(false);
    } else {
        // Otherwise, use the default panel.
        dataQueryPanel.add(mainTabbedPane, BorderLayout.CENTER);
        buttonPanel.setVisible(true);
    }
    pack();
    repaint();
}
Also used : Container(java.awt.Container) WebServiceClient(org.cytoscape.io.webservice.WebServiceClient)

Example 2 with WebServiceClient

use of org.cytoscape.io.webservice.WebServiceClient in project cytoscape-impl by cytoscape.

the class WebServiceImportDialog method searchButtonActionPerformed.

private void searchButtonActionPerformed() {
    final Object selected = datasourceComboBox.getSelectedItem();
    if (selected == null)
        return;
    WebServiceClient client = null;
    if (selected instanceof WebServiceClient) {
        client = (WebServiceClient) selected;
    } else {
        throw new IllegalStateException("Selected client is not a compatible one.");
    }
    final DialogTaskManager taskManager = serviceRegistrar.getService(DialogTaskManager.class);
    // Set query. Just pass the text in the panel.
    taskManager.execute(client.createTaskIterator(this.queryTextPane.getText()));
}
Also used : WebServiceClient(org.cytoscape.io.webservice.WebServiceClient) DialogTaskManager(org.cytoscape.work.swing.DialogTaskManager)

Example 3 with WebServiceClient

use of org.cytoscape.io.webservice.WebServiceClient in project cytoscape-impl by cytoscape.

the class WebServiceImportDialog method aboutButtonActionPerformed.

private void aboutButtonActionPerformed(ActionEvent evt) {
    final WebServiceClient wsc = (WebServiceClient) datasourceComboBox.getSelectedItem();
    final String clientName = wsc.getDisplayName();
    final String description = wsc.getDescription();
    final AboutDialog aboutDialog = new AboutDialog(this, Dialog.ModalityType.APPLICATION_MODAL, serviceRegistrar);
    aboutDialog.showDialog(clientName, description);
}
Also used : WebServiceClient(org.cytoscape.io.webservice.WebServiceClient)

Aggregations

WebServiceClient (org.cytoscape.io.webservice.WebServiceClient)3 Container (java.awt.Container)1 DialogTaskManager (org.cytoscape.work.swing.DialogTaskManager)1