Class ExpressionEditorContextMenu
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPopupMenu
-
- com.inductiveautomation.ignition.designer.gui.ExpressionEditorContextMenu
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible,javax.swing.MenuElement
public class ExpressionEditorContextMenu extends javax.swing.JPopupMenuA right-click menu that fills in operators and functions for an expression editing text area. The main constructor builds the standard expression menu, but the menu can also be customized with various chaining builder functions.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExpressionEditorContextMenu.CodeEditorItemReferenceSelectionHandlerstatic classExpressionEditorContextMenu.CodeEditorItemSelectionHandlerItem selection handler that places the selected item directly into the code editorstatic interfaceExpressionEditorContextMenu.ItemSelectionHandler-
Nested classes/interfaces inherited from class javax.swing.JPopupMenu
javax.swing.JPopupMenu.AccessibleJPopupMenu, javax.swing.JPopupMenu.Separator
-
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 ExpressionEditorContextMenu(FunctionFactory functionFactory, ExpressionEditorContextMenu.ItemSelectionHandler selectionHandler, javax.swing.Action... actions)Creates the default expression editing menu.ExpressionEditorContextMenu(ExpressionEditorContextMenu.ItemSelectionHandler selectionHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JMenuItemadd(javax.swing.JMenuItem menuItem)voidaddFunctions(java.lang.String id, java.lang.String displayKey, FunctionFactory factory)voidaddMenu(java.lang.String id, javax.swing.JPopupMenu menu)static ExpressionEditorContextMenucreateForCodeEditor(FunctionFactory functionFactory, com.jidesoft.editor.CodeEditor editor, javax.swing.Action... actions)Static function for creating a standard expression editing menu.javax.swing.JPopupMenugetFuncPopup()javax.swing.JPopupMenugetMenu(java.lang.String id)javax.swing.JPopupMenugetOpPopup()ExpressionEditorContextMenuseperator()ExpressionEditorContextMenuwithActions(javax.swing.Action... actions)ExpressionEditorContextMenuwithEditItems()Adds the standard cut/copy/paste items.ExpressionEditorContextMenuwithExpressionOperators()ExpressionEditorContextMenuwithFunctions(java.lang.String title, FunctionFactory functionFactory)-
Methods inherited from class javax.swing.JPopupMenu
add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, 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, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, 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, 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, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, 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, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
ExpressionEditorContextMenu
public ExpressionEditorContextMenu(ExpressionEditorContextMenu.ItemSelectionHandler selectionHandler)
-
ExpressionEditorContextMenu
public ExpressionEditorContextMenu(FunctionFactory functionFactory, ExpressionEditorContextMenu.ItemSelectionHandler selectionHandler, javax.swing.Action... actions)
Creates the default expression editing menu.
-
-
Method Detail
-
createForCodeEditor
public static ExpressionEditorContextMenu createForCodeEditor(FunctionFactory functionFactory, com.jidesoft.editor.CodeEditor editor, javax.swing.Action... actions)
Static function for creating a standard expression editing menu.
-
withEditItems
public ExpressionEditorContextMenu withEditItems()
Adds the standard cut/copy/paste items. Adds a separator after them, only if additional items are added.
-
withExpressionOperators
public ExpressionEditorContextMenu withExpressionOperators()
-
withFunctions
public ExpressionEditorContextMenu withFunctions(java.lang.String title, FunctionFactory functionFactory)
-
withActions
public ExpressionEditorContextMenu withActions(javax.swing.Action... actions)
-
seperator
public ExpressionEditorContextMenu seperator()
-
add
public javax.swing.JMenuItem add(javax.swing.JMenuItem menuItem)
- Overrides:
addin classjavax.swing.JPopupMenu
-
getOpPopup
public javax.swing.JPopupMenu getOpPopup()
-
getFuncPopup
public javax.swing.JPopupMenu getFuncPopup()
-
getMenu
public javax.swing.JPopupMenu getMenu(java.lang.String id)
-
addMenu
public void addMenu(java.lang.String id, javax.swing.JPopupMenu menu)
-
addFunctions
public void addFunctions(java.lang.String id, java.lang.String displayKey, FunctionFactory factory)
-
-