java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.factorypmi.designer.eventhandling.JythonBuilder
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
DBBrowserBuilder, NavigationBuilder, PropertySetBuilder, ScriptEditorBuilder, TagSetBuilder

public abstract class JythonBuilder extends JPanel
Base class for the different action tabs of the event configuration UI.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • setMethodNode

      public void setMethodNode(MethodDescriptorNode methodNode)
    • getMethodNode

      public MethodDescriptorNode getMethodNode()
    • getBean

      protected JComponent getBean()
    • fireNodeUpdated

      protected void fireNodeUpdated()
      Tell the event tree that this event has changed and needs to be redrawn
    • updateDisplay

      public abstract void updateDisplay()
      Called when the selected event changes and when the tab is made visible.
    • handles

      public abstract boolean handles(MethodDescriptorNode node)
      Return true if you're the appropriate type of builder to handle the node as it's currently configured
    • getDisplayName

      public abstract String getDisplayName()
    • getIcon

      public abstract Icon getIcon()
    • getSpacedIcon

      public Icon getSpacedIcon()
    • getBindingRoot

      public BindingRoot getBindingRoot()
    • setBindingRoot

      public void setBindingRoot(BindingRoot root)
    • propertyDialog

      protected PropertyDialog propertyDialog()
      Gets the lazily-created instance of PropertyDialog for this builder pane.
    • isStringNumber

      protected static boolean isStringNumber(String s)
      Returns true if the given string parses out to a number.
    • getPropertyNode

      protected PropertyNode getPropertyNode(String path)
    • appendWarning

      protected static void appendWarning(StringBuilder script, String builderName)
    • buildPropertyReference

      protected static void buildPropertyReference(StringBuilder realBuilder, String path, PropertyNode valueNode, String compName, String varName, String setValue, String tab)
      Generates Jython code, indented by tab, that either gets or sets a property.
      Parameters:
      realBuilder - The buffer that the generated Jython code will be appended to
      path - The path to the property to get or set.
      valueNode - The PropertyNode for the destination property
      compName - The name of a new Jython variable that will be set to the component that owns the property. If this is null, the get/set will be made in a more compressed form
      varName - If non-null, the name of a new Jython variable that will be assigned the value of valueNode
      setValue - If non-null, the property will be set to this value. Should be pre-quoted if desired.
      tab - The tab level for this new code
    • parseNodePropertyValue

      protected static String parseNodePropertyValue(PropertyNode valueNode)
    • applyDictionaryStyleAccess

      protected static String applyDictionaryStyleAccess(String str)
      Applies dictionary-style access to python statements which may have object member names with spaces in them (see FB3163). For example: converts foo.Hello World.bar to foo["Hello World"].bar
      Parameters:
      str - The string to apply dictionary style access rules
      Returns:
      The string which is modified to follow dictionary style access rules in order to avoid jython syntax errors