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();
}
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()));
}
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);
}
Aggregations