Class NamedQueryChoicePanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.designer.db.namedquery.NamedQueryChoicePanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class NamedQueryChoicePanel extends JPanel
Panel used to select a named query by path and set the parameters in Direct mode only. Displays the actual query and description. Components that use this panel can register a ChangeListener to be notified when entries change.
See Also:
  • Constructor Details

    • NamedQueryChoicePanel

      public NamedQueryChoicePanel(DesignerContext designerContext, boolean updateQueriesOnly)
      For use when you need the choice panel constructed before you can make your buttons. Call setButtons to add browse buttons afterwards, if needed.
    • NamedQueryChoicePanel

      public NamedQueryChoicePanel(DesignerContext designerContext, JComponent[] buttons, boolean updateQueriesOnly)
      Constructor. Buttons will be added to the right side of the parameters table, in the order they appear. This component will take care of show/hide, enable/disable; buttons need to take care of their action and tooltips.
      Parameters:
      designerContext - The designer context
      buttons - Action buttons to add to the parameter table
      updateQueriesOnly - Whether to show only update queries
  • Method Details

    • setButtons

      public void setButtons(JComponent... buttons)
    • createDirectModePanel

      protected DirectModePanel createDirectModePanel()
    • createExtraBottomRowComponent

      protected Optional<JComponent> createExtraBottomRowComponent()
    • setComponentsEnabled

      public void setComponentsEnabled(boolean enabled)
    • getTable

      public ParameterChoiceTable getTable()
      Gets the parameter table, so that the action buttons passed in to this class can alter the table contents.
    • getTableValueColumn

      public int getTableValueColumn()
      Some action buttons will want to know what column they should edit.
      Returns:
      The editable column number
    • setConfig

      public void setConfig(String path, Map<String,Object> args)
      Update the panel with a new path or args.
      Parameters:
      path - A NamedQuery path. Null path will not update the path field.
      args - Arguments of the NamedQuery. May be null.
    • setPath

      public void setPath(String path)
    • getPath

      public String getPath()
    • getParams

      public Map<String,Object> getParams()
    • addChangeListener

      public void addChangeListener(ChangeListener listener)
      Adds a ChangeListener that will be notified when the table model changes.
      Parameters:
      listener - Not null.
    • removeChangeListener

      public void removeChangeListener(ChangeListener listener)
      Removes a previously added ChangeListener. No effect if the listener was not already added
      Parameters:
      listener - Not null.
    • fireStateChanged

      protected void fireStateChanged()
      Tell all the listeners who care that something important changed.