public class NodeEditor
extends javax.swing.JPanel
Modifier and Type | Class and Description |
---|---|
class |
NodeEditor.MainEditor
The panel that is the main row of editing UI for this node (i.e.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
GUTTER_BACKGROUND |
static javax.swing.border.MatteBorder |
GUTTER_BORDER |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
NodeEditor(JsonEditor jsonEditor,
int depth,
NodeEditor parentEditor,
DocumentNode node)
This constructor can be used for a normal node editor or a special empty version.
|
Modifier and Type | Method and Description |
---|---|
void |
addAfterChildrenUpdateCallback(java.lang.Runnable r) |
int |
applyFilter(com.jidesoft.filter.Filter<java.lang.String> filter)
Applies a string filter to this editor.
|
void |
clearFilter() |
protected KeyEditorField |
createKeyEditor(DocumentNode node) |
protected javax.swing.JComponent |
createValueEditor(DocumentNode node,
java.awt.event.MouseListener popupListener)
Called for "value" nodes, that is, nodes that are not objects or arrays, in order to create
an editor for them.
|
void |
destroy()
Called when this UI is no longer used in order to remove any listeners from the underlying document node.
|
protected java.lang.String |
getAddChildText() |
protected java.util.Optional<javax.swing.JComponent> |
getArrayHelper(JsonSchema schema)
Called for array-typed nodes, in order to optionally create a helper component that will be added
to the right of the object size indicator.
|
com.inductiveautomation.ignition.client.jsonedit.NodeEditor.ChildEditors |
getChildPanel() |
int |
getDepth() |
NodeEditor.MainEditor |
getMainEditor() |
DocumentNode |
getNode() |
protected java.util.Optional<javax.swing.JComponent> |
getObjectHelper(JsonSchema schema)
Called for object-typed nodes, in order to optionally create a helper component that will be added
to the right of the object size indicator.
|
NodeEditor |
getParentEditor() |
protected void |
initContextMenu(javax.swing.JPopupMenu menu)
Called to initialize the context menu at the very end (to add actions after the cut, copy, paste, delete, and
type actions.
|
protected void |
initContextMenuAdditionalActions(javax.swing.JPopupMenu menu) |
boolean |
isExpanded() |
boolean |
isFullyLoaded() |
protected void |
onDestroy()
Subclasses may override this to do something when the editor is being destroyed
|
protected void |
onInit()
Subclasses may override this to provide custom initialization.
|
void |
setExpanded(boolean expanded) |
void |
startEditing()
Expands the node and if the key is editable, starts editing it.
|
java.lang.String |
toString() |
void |
visit(java.util.function.Consumer<NodeEditor> visitor)
Calls the visitor for each node editor in the hierarchy.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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
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
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.awt.Color GUTTER_BACKGROUND
public static final javax.swing.border.MatteBorder GUTTER_BORDER
public NodeEditor(JsonEditor jsonEditor, int depth, @Nullable NodeEditor parentEditor, @Nullable DocumentNode node)
depth
- This defines the depth of this node within the document. If the root node is given a depth of
zero, then controls for the root object will be visible. If the root node is given a depth
of -1, then the root node controls will be hidden (useful when the document should always
be an object at the root and you don't want to give the user the ability to change the root
node type)public final void destroy()
protected void onDestroy()
protected void onInit()
protected void initContextMenu(javax.swing.JPopupMenu menu)
protected void initContextMenuAdditionalActions(javax.swing.JPopupMenu menu)
public NodeEditor.MainEditor getMainEditor()
public com.inductiveautomation.ignition.client.jsonedit.NodeEditor.ChildEditors getChildPanel()
public NodeEditor getParentEditor()
public DocumentNode getNode()
public java.lang.String toString()
toString
in class java.awt.Component
public boolean isFullyLoaded()
public void startEditing()
public void addAfterChildrenUpdateCallback(java.lang.Runnable r)
public int getDepth()
public void visit(java.util.function.Consumer<NodeEditor> visitor)
public int applyFilter(com.jidesoft.filter.Filter<java.lang.String> filter)
1. Test the filter against this node's key and value (if applicable) 2. Highlight they key and/or value fields if they match the filter 3. Apply the filter to all children. 4. If this node or any children matched the filter, will set expanded=true
public void clearFilter()
public boolean isExpanded()
public void setExpanded(boolean expanded)
protected java.lang.String getAddChildText()
protected java.util.Optional<javax.swing.JComponent> getObjectHelper(@Nullable JsonSchema schema)
protected java.util.Optional<javax.swing.JComponent> getArrayHelper(@Nullable JsonSchema schema)
protected javax.swing.JComponent createValueEditor(DocumentNode node, java.awt.event.MouseListener popupListener)
If your editor happens to implement ValueEditorComponent
, you'll get additional functionality
like schema and ui lifecycle support
popupListener
- Mouse listener to add to any interior components in order for the context menu
to work correctlyprotected KeyEditorField createKeyEditor(DocumentNode node)