Class DualModeQueryChoicePanel

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

public class DualModeQueryChoicePanel extends JPanel
Panel used to select a named query by path and set the parameters with support for both Direct and Expression modes. Displays the actual query and description in Direct mode. Components that use this panel can register a ChangeListener to be notified when entries change.

The query path is kept in sync across both modes. Parameters are maintained separately per mode to prevent cross-contamination.

See Also:
  • Constructor Details

    • DualModeQueryChoicePanel

      public DualModeQueryChoicePanel(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.
  • Method Details

    • setButtons

      public void setButtons(JComponent[] buttons)
    • createDirectModePanel

      protected DirectModePanel createDirectModePanel()
    • createExpressionModePanel

      protected ExpressionModePanel createExpressionModePanel()
    • createExtraBottomRowComponent

      protected Optional<JComponent> createExtraBottomRowComponent()
    • getTable

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

      public void setConfig(String path, Map<String,Object> args)
      Sets the path on both panels and configures parameters on the active panel only. Parameters are kept separate per mode to prevent cross-contamination between direct and expression modes.
      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)
      Both panels are updated to keep state consistent when switching modes.
    • getPath

      public String getPath()
    • getPathMode

      public DualModeQueryChoicePanel.PathMode getPathMode()
    • setPathMode

      public void setPathMode(DualModeQueryChoicePanel.PathMode mode)
    • 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.