uk.ac.starlink.vo
Class DalTableLoadDialog

java.lang.Object
  extended by uk.ac.starlink.table.gui.AbstractTableLoadDialog
      extended by uk.ac.starlink.vo.RegistryServiceTableLoadDialog
          extended by uk.ac.starlink.vo.DalTableLoadDialog
All Implemented Interfaces:
TableLoadDialog
Direct Known Subclasses:
SkyDalTableLoadDialog, TapTableLoadDialog

public abstract class DalTableLoadDialog
extends RegistryServiceTableLoadDialog

Table load dialogue abstract superclass for registry-based DAL-like queries.

Since:
22 Sep 2009
Author:
Mark Taylor

Constructor Summary
protected DalTableLoadDialog(String name, String protoName, String description, Capability capability, boolean showCapabilities, boolean autoQuery)
          Constructor.
 
Method Summary
 URL checkUrl(String url)
          Performs syntactic checks on a string which should be a URL, and throws an informative RuntimeException if it is not.
protected  Component createQueryComponent()
          Constructs the query component used by this dialogue.
 RegCapabilityInterface[] getCapabilities(RegResource resource)
          Returns the capabilities associated with a given resource.
 DescribedValue[] getMetadata(RegResource resource, RegCapabilityInterface cap)
          Returns a list of described values for the resource object representing a DAL service.
 DescribedValue[] getResourceMetadata(String serviceUrl)
          Returns an array of metadata items describing the resource being queried.
 String getServiceUrl()
          Returns the current contents of the service URL field.
 JTextField getServiceUrlField()
          Returns the text field into which the user can enter the service URL.
 boolean isReady()
          Indicates whether the submit action should be enabled.
 void setServiceUrl(String url)
          Sets the current contents of the service URL field.
 
Methods inherited from class uk.ac.starlink.vo.RegistryServiceTableLoadDialog
acceptResourceIdList, getControlBox, getQueryFactory, getRegistryMenuItems, getRegistryPanel
 
Methods inherited from class uk.ac.starlink.table.gui.AbstractTableLoadDialog
asIOException, configure, createFormatSelector, getDescription, getIcon, getMenus, getName, getQueryComponent, getSelectedFormat, getSubmitAction, getToolbarActions, isAvailable, isComponentShowing, setIcon, setIconUrl, setMenus, setToolbarActions, submit, updateReady
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.table.gui.TableLoadDialog
createTableLoader
 

Constructor Detail

DalTableLoadDialog

protected DalTableLoadDialog(String name,
                             String protoName,
                             String description,
                             Capability capability,
                             boolean showCapabilities,
                             boolean autoQuery)
Constructor.

Parameters:
name - dialogue name
protoName - short name (perhaps acronym) for protocol
description - dialogue description
capability - service capability type
showCapabilities - true to display the capabilities JTable as well as the Resource one; sensible if resource:capabilities relationship may not be 1:1
autoQuery - populate service table with full registry query on initial display
Method Detail

createQueryComponent

protected Component createQueryComponent()
Description copied from class: AbstractTableLoadDialog
Constructs the query component used by this dialogue. Called only once (lazily).

Overrides:
createQueryComponent in class RegistryServiceTableLoadDialog
Returns:
query component

isReady

public boolean isReady()
Description copied from class: AbstractTableLoadDialog
Indicates whether the submit action should be enabled. The implementation should return true if the user should be allowed to submit the query, or false if the internal state of this dialogue is known to be incomplete in some way. Evaluation should be fast; the return does not need to provide a guarantee that a submitted query will suceed.

The default implementation returns true.

Overrides:
isReady in class AbstractTableLoadDialog
Returns:
false iff dialogue state is known to be incomplete

getServiceUrl

public String getServiceUrl()
Returns the current contents of the service URL field.

Returns:
currently filled in query service URL, if any

setServiceUrl

public void setServiceUrl(String url)
Sets the current contents of the service URL field.

Parameters:
url - value to insert into service URL field

getServiceUrlField

public JTextField getServiceUrlField()
Returns the text field into which the user can enter the service URL.

Returns:
url field

checkUrl

public URL checkUrl(String url)
Performs syntactic checks on a string which should be a URL, and throws an informative RuntimeException if it is not.

Parameters:
url - string to test for URL-ness
Returns:
the url as URL if correct, never null

getResourceMetadata

public DescribedValue[] getResourceMetadata(String serviceUrl)
Returns an array of metadata items describing the resource being queried.

Parameters:
serviceUrl - service URL of query - may or may not be that of the currently selected resource/capability
Returns:
metadata array

getMetadata

public DescribedValue[] getMetadata(RegResource resource,
                                    RegCapabilityInterface cap)
Returns a list of described values for the resource object representing a DAL service.

Parameters:
resource - DAL resource
cap - DAL capability interface

getCapabilities

public RegCapabilityInterface[] getCapabilities(RegResource resource)
Description copied from class: RegistryServiceTableLoadDialog
Returns the capabilities associated with a given resource. This determines those capabilities which will be displayed and selecatable for each resource. The default implementation is to include all capabilities; this may however be overridded in a more selective way by subclasses.

Overrides:
getCapabilities in class RegistryServiceTableLoadDialog
Parameters:
resource - registry resource
Returns:
relevant capabilities from that resource


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.