Package uk.ac.starlink.topcat.activate
Class UrlColumnConfigurator
java.lang.Object
uk.ac.starlink.topcat.activate.AbstractActivatorConfigurator
uk.ac.starlink.topcat.activate.UrlColumnConfigurator
- All Implemented Interfaces:
ActivatorConfigurator
Partial ActivatorConfigurator implementation for activators
that view the location (URL) in a table column using some
viewer application.
- Since:
- 21 Dec 2017
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Utility class providing a partial Activator implementation for UrlColumnConfigurators that want a location (file or URL) value.protected static class
Utility class providing a partial Activator implementation for UrlColumnConfigurators that want an actual URL value. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
UrlColumnConfigurator
(TopcatModelInfo tinfo, String urlWord, ColFlag[] urlFlags) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Activator
createActivator
(uk.ac.starlink.table.ColumnData cdata) Creates an activator from a ColumnData giving the URL string.static Outcome
decorateOutcomeWithUrl
(Outcome outcome, String url) Ensures that an outcome contains a given URL in its message.Constructs an activator in accordance with the current state of this GUI.Returns a short status message for display to the user.protected abstract String
getConfigMessage
(uk.ac.starlink.table.ColumnData cdata) Returns a config message given that a URL column has been supplied.protected Box
Returns the component used for storing user interaction components.Returns the TopcatModel that this configurator is using.protected ConfigState
Returns a partial config state, giving the current configuration of the selected URL column.protected String
getWindowLabel
(uk.ac.starlink.table.ColumnData cdata) Returns a label which identifies a particular column in this configurator's table.protected void
selectColumnByUCD
(String ucd) If a column exists with the named UCD, select it in the selector.protected void
selectColumnByUtype
(String uType) If a column exists with the named UType, select it in the selector.void
setLocationLabel
(String label) Resets the label for the Location field.void
setLocationTooltip
(String tooltip) Sets the tooltip text for the Location field.protected void
setUrlState
(ConfigState state) Restores the URL selection from a stored state object.Methods inherited from class uk.ac.starlink.topcat.activate.AbstractActivatorConfigurator
addActionListener, createDisplayField, createDisplayLabel, getActionForwarder, getPanel, removeActionListener
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.topcat.activate.ActivatorConfigurator
getSafety, getState, setState
-
Constructor Details
-
UrlColumnConfigurator
Constructor.- Parameters:
tinfo
- topcat model informationurlWord
- descriptive term for what's in the URL (displayed as part of GUI)urlFlags
- list of flags whose columns are to be selected as default values for the URL column selector; earlier entries are preferred over later ones
-
-
Method Details
-
createActivator
Creates an activator from a ColumnData giving the URL string.- Parameters:
cdata
- URL column data, will not be null- Returns:
- new activator, or null
-
getConfigMessage
Returns a config message given that a URL column has been supplied.- Parameters:
cdata
- URL column data, will not be null- Returns:
- message indicating why activator is not available, or null
-
getQueryPanel
Returns the component used for storing user interaction components. This is a vertical box, which may have some components already in it.- Returns:
- query box
-
getActivator
Description copied from interface:ActivatorConfigurator
Constructs an activator in accordance with the current state of this GUI. If the current state not an adequate specification, null may be returned. In that case, the getConfigMessage method should generally provide an explanation.This method may be called often, so should be cheap to invoke. The idea is that it will be called immediately before the activator is used, so the returned object may fix, rather than arrange to gather at a later date, information acquired from the GUI.
- Returns:
- currently configured activator, or null
- See Also:
-
getConfigMessage
Description copied from interface:ActivatorConfigurator
Returns a short status message for display to the user. This is supposed to be a comment, if one is needed, on the current state of the configuration.As a rule, exactly one of this method and the
getActivator
should return null. If there is no activator, this method should return some reason why the configuration is incorrect or incomplete, and otherwise it should return null.- Returns:
- message, typically indicating configuration problems, or null
-
getTopcatModel
Returns the TopcatModel that this configurator is using.- Returns:
- topcat model
-
getUrlState
Returns a partial config state, giving the current configuration of the selected URL column.- Returns:
- url state
-
setUrlState
Restores the URL selection from a stored state object.- Parameters:
state
- URL state
-
selectColumnByUCD
If a column exists with the named UCD, select it in the selector.- Parameters:
ucd
- UCD to match
-
selectColumnByUtype
If a column exists with the named UType, select it in the selector.- Parameters:
uType
- UType to match
-
getWindowLabel
Returns a label which identifies a particular column in this configurator's table. Used for labelling display windows.- Parameters:
cdata
- column data- Returns:
- label
-
setLocationLabel
Resets the label for the Location field.- Parameters:
label
- new label
-
setLocationTooltip
Sets the tooltip text for the Location field.- Parameters:
tooltip
- tooltip text
-
decorateOutcomeWithUrl
Ensures that an outcome contains a given URL in its message.- Parameters:
outcome
- input outcomeurl
- context URL- Returns:
- outcome like the input one, but with the
url
text guaranteed to appear somewhere in its message
-