Class UrlColumnConfigurator

    • Constructor Detail

      • UrlColumnConfigurator

        protected UrlColumnConfigurator​(TopcatModelInfo tinfo,
                                        java.lang.String urlWord,
                                        ColFlag[] urlFlags)
        Constructor.
        Parameters:
        tinfo - topcat model information
        urlWord - 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 Detail

      • createActivator

        protected abstract Activator createActivator​(uk.ac.starlink.table.ColumnData cdata)
        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

        protected abstract java.lang.String getConfigMessage​(uk.ac.starlink.table.ColumnData cdata)
        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

        protected javax.swing.Box 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

        public Activator 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:
        ActivatorConfigurator.getConfigMessage()
      • getConfigMessage

        public java.lang.String 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

        public TopcatModel getTopcatModel()
        Returns the TopcatModel that this configurator is using.
        Returns:
        topcat model
      • getUrlState

        protected ConfigState getUrlState()
        Returns a partial config state, giving the current configuration of the selected URL column.
        Returns:
        url state
      • setUrlState

        protected void setUrlState​(ConfigState state)
        Restores the URL selection from a stored state object.
        Parameters:
        state - URL state
      • selectColumnByUCD

        protected void selectColumnByUCD​(java.lang.String ucd)
        If a column exists with the named UCD, select it in the selector.
        Parameters:
        ucd - UCD to match
      • selectColumnByUtype

        protected void selectColumnByUtype​(java.lang.String uType)
        If a column exists with the named UType, select it in the selector.
        Parameters:
        uType - UType to match
      • getWindowLabel

        protected java.lang.String getWindowLabel​(uk.ac.starlink.table.ColumnData cdata)
        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

        public void setLocationLabel​(java.lang.String label)
        Resets the label for the Location field.
        Parameters:
        label - new label
      • decorateOutcomeWithUrl

        public static Outcome decorateOutcomeWithUrl​(Outcome outcome,
                                                     java.lang.String url)
        Ensures that an outcome contains a given URL in its message.
        Parameters:
        outcome - input outcome
        url - context URL
        Returns:
        outcome like the input one, but with the url text guaranteed to appear somewhere in its message