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:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
public class NamedQueryChoicePanel extends javax.swing.JPanel
Panel used to select a named query by path and set the parameters. Displays the actual query and description. Components that use this panel can register a ChangeListener to be notified when entries change.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description NamedQueryChoicePanel(DesignerContext designerContext, boolean updateQueriesOnly)
For use when you need the choice panel constructed before you can make your buttons.NamedQueryChoicePanel(DesignerContext designerContext, javax.swing.JButton[] buttons, boolean updateQueriesOnly)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener that will be notified when the table model changes.protected java.util.Optional<javax.swing.JComponent>
createExtraTopRowComponent()
protected ParameterChoiceTable
createParameterTable()
protected void
fireStateChanged()
Tell all the listeners who care that something important changed.java.util.Map<java.lang.String,java.lang.Object>
getParams()
java.lang.String
getPath()
ParameterChoiceTable
getTable()
Gets the parameter table, so that the action buttons passed in to this class can alter the table contents.int
getTableValueColumn()
Some action buttons will want to know what column they should edit.void
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a previously added ChangeListener.void
setButtons(javax.swing.JButton[] buttons)
void
setComponentsEnabled(boolean enabled)
void
setConfig(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
Update these panels with a new path or args.void
setPath(java.lang.String path)
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
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, javax.swing.JButton[] 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 Detail
-
setButtons
public void setButtons(javax.swing.JButton[] buttons)
-
createExtraTopRowComponent
protected java.util.Optional<javax.swing.JComponent> createExtraTopRowComponent()
-
createParameterTable
protected ParameterChoiceTable createParameterTable()
-
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(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
Update these panels 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(java.lang.String path)
-
getPath
public java.lang.String getPath()
-
getParams
public java.util.Map<java.lang.String,java.lang.Object> getParams()
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener that will be notified when the table model changes.- Parameters:
listener
- Not null.
-
removeChangeListener
public void removeChangeListener(javax.swing.event.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.
-
-