Class JsonEditor
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- javax.swing.JPanel
- 
- com.inductiveautomation.ignition.client.jsonedit.JsonEditor
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable,- javax.accessibility.Accessible
 - Direct Known Subclasses:
- ComponentScopeEditor
 
 public class JsonEditor extends javax.swing.JPanelCreated by carlg on 5/15/2017.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classJsonEditor.AddNodeMenustatic classJsonEditor.HierarchyIconprotected classJsonEditor.NewNodeAction- 
Nested classes/interfaces inherited from class javax.swing.JPaneljavax.swing.JPanel.AccessibleJPanel
 - 
Nested classes/interfaces inherited from class javax.swing.JComponentjavax.swing.JComponent.AccessibleJComponent
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static javax.swing.IconCOLLAPSEDstatic javax.swing.IconEXPANDEDprotected DocumentModelmodelstatic intSCROLL_BLOCK_INCREMENTstatic intSCROLL_UNIT_INCREMENT- 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
- 
 - 
Constructor SummaryConstructors Constructor Description JsonEditor(DocumentModel model, boolean showRoot)JsonEditor(java.lang.String json, boolean showRoot)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intapplyFilter(com.jidesoft.filter.Filter<java.lang.String> filter)voidclearFilter()voidcollapseAll()voidcommitEdit()protected voidconfigureInsertMenu(MenuLike menu, DocumentNode parent, int insertPt)voidexpandAll()java.lang.StringgetJson()Get the current state of the edited model as a json documentjava.lang.StringgetJson(boolean prettyPrint)com.inductiveautomation.ignition.common.gson.JsonElementgetJsonElement()Get the current state of the edited model as a gson objectDocumentModelgetModel()booleaninsertDefaultItem(DocumentNode parent, int index)Insert a new node on the parent representing the default value as declared in it's schema.protected voidinsertNewNode(DocumentNode parent, DocumentNode newNode, int insertionPoint)protected booleanisScrollable()protected booleanisToolbarVisible()static voidmain(java.lang.String[] args)protected NodeEditornewNodeEditor(int depth, NodeEditor parent, DocumentNode node)protected java.lang.ObjectnewValueValue()The actual value to use for new "Value" nodes.voidsetModel(DocumentModel model)Sets the model for this editor- 
Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 - 
Methods inherited from class javax.swing.JComponentaddAncestorListener, 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.Containeradd, 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.Componentaction, 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
 
- 
 
- 
- 
- 
Field Detail- 
SCROLL_UNIT_INCREMENTpublic static final int SCROLL_UNIT_INCREMENT - See Also:
- Constant Field Values
 
 - 
SCROLL_BLOCK_INCREMENTpublic static final int SCROLL_BLOCK_INCREMENT - See Also:
- Constant Field Values
 
 - 
modelprotected DocumentModel model 
 - 
COLLAPSEDpublic static final javax.swing.Icon COLLAPSED 
 - 
EXPANDEDpublic static final javax.swing.Icon EXPANDED 
 
- 
 - 
Constructor Detail- 
JsonEditorpublic JsonEditor(java.lang.String json, boolean showRoot)
 - 
JsonEditorpublic JsonEditor(DocumentModel model, boolean showRoot) 
 
- 
 - 
Method Detail- 
setModelpublic void setModel(DocumentModel model) Sets the model for this editor
 - 
newNodeEditorprotected NodeEditor newNodeEditor(int depth, NodeEditor parent, DocumentNode node) 
 - 
insertDefaultItempublic boolean insertDefaultItem(DocumentNode parent, int index) Insert a new node on the parent representing the default value as declared in it's schema.- Parameters:
- parent- The parent node to insert new node.
- index- The index in which to add the new node.
- Returns:
- {boolean} Returns true if a new default item node was inserted, false otherwise.
 
 - 
applyFilterpublic int applyFilter(com.jidesoft.filter.Filter<java.lang.String> filter) 
 - 
clearFilterpublic void clearFilter() 
 - 
isToolbarVisibleprotected boolean isToolbarVisible() 
 - 
isScrollableprotected boolean isScrollable() 
 - 
getModelpublic DocumentModel getModel() 
 - 
expandAllpublic void expandAll() 
 - 
collapseAllpublic void collapseAll() 
 - 
commitEditpublic void commitEdit() 
 - 
getJsonElementpublic com.inductiveautomation.ignition.common.gson.JsonElement getJsonElement() Get the current state of the edited model as a gson object
 - 
getJsonpublic java.lang.String getJson() Get the current state of the edited model as a json document
 - 
getJsonpublic java.lang.String getJson(boolean prettyPrint) 
 - 
insertNewNodeprotected void insertNewNode(DocumentNode parent, DocumentNode newNode, int insertionPoint) 
 - 
configureInsertMenuprotected void configureInsertMenu(MenuLike menu, DocumentNode parent, int insertPt) 
 - 
newValueValueprotected java.lang.Object newValueValue() The actual value to use for new "Value" nodes.
 - 
mainpublic static void main(java.lang.String[] args) 
 
- 
 
-