Class AbstractPropertyEditorPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.designer.propertyeditor.AbstractPropertyEditorPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
Direct Known Subclasses:
AbstractPerspectivePropsPanel, CategoryPanel, ClientGeneralPropsPanel, ClientLaunchPropsPanel, ClientLoginPropsPanel, ClientPermissionsPropsPanel, ClientPollingPropsPanel, ClientUIPropsPanel, DesignerGeneralPropsPanel, DesignerWindowEditPropsPanel, PermissionsPropsPanel, ProjectGlobalPropsPanel

public abstract class AbstractPropertyEditorPanel extends JPanel implements Scrollable
Base class for all property editing pages. See DesignerContext.addPropertyEditor(Class) for a more detailed description. Subclasses must have either a nullary (no-arg) constructor, or one that takes a DesignerContext
See Also:
  • Field Details

  • Constructor Details

    • AbstractPropertyEditorPanel

      protected AbstractPropertyEditorPanel()
    • AbstractPropertyEditorPanel

      protected AbstractPropertyEditorPanel(LayoutManager layout)
  • Method Details

    • setChanged

      public void setChanged(boolean b)
    • getListener

      Returns a shared instanceof (for this panel) of a ComponentChangeListener
    • listenTo

      protected void listenTo(JComboBox<?>... boxes)
      Adds a listener to the component(s) that will set the changed boolean when the value changes
    • listenTo

      protected void listenTo(AbstractProfileOptionDropdown... boxes)
      Adds a listener to the component(s) that will set the changed boolean when the value changes
    • listenTo

      protected void listenTo(AbstractButton... buttons)
      Adds a listener to the component(s) that will set the changed boolean when the value changes
    • listenTo

      protected void listenTo(JTextComponent... fields)
      Adds a listener to the component(s) that will set the changed boolean when the value changes
    • listenTo

      protected void listenTo(JSpinner... spinners)
      Adds a listener to the component(s) that will set the changed boolean when the value changes
    • listenTo

      protected void listenTo(JSlider... sliders)
      Adds a listener to the component(s) that will set the changed boolean when the value changes
    • getCategory

      public abstract String getCategory()
      Returns a dot-separated category placement. Something like: "Client.Launching"
    • getTitleKey

      public abstract String getTitleKey()
      Resource key for the banner on top of the editor panel
    • getResourceName

      public String getResourceName()
    • initProps

      public abstract void initProps(Object props)
      Initialize the page with the given properties.
      Parameters:
      props - Deserialized object from this page's corresponding ProjectResource, or null if the resource didn't exist.
    • notifyClosed

      public void notifyClosed()
      Override and implement this to do any cleanup when the UI is no longer shown.
    • isChanged

      public boolean isChanged()
      Have any of the properties represented by this page changed?
    • getState

    • setState

      public void setState(AbstractPropertyEditorPanel.State state)
    • addStateChangeListener

      public void addStateChangeListener(com.inductiveautomation.ignition.designer.propertyeditor.AbstractPropertyEditorPanel.StateListener listener)
    • dryCommit

      public boolean dryCommit()
      Test the input of the page for validity before commit.
      Returns:
      true if the page will commit successfully, false otherwise
    • commit

      public abstract Object commit()
      Create the object to be serialized and stored in the page's corresponding project resource
    • revert

      public void revert(DesignerContext context)
      Revert this panel's resource to its inherited state.
    • override

      public void override(DesignerContext context)
      Copy the target resource into the local project.
    • serialize

      public byte[] serialize(DesignerContext context, Object object) throws Exception
      Turn the object this panel is editing into a byte[] to be stored in a ProjectResource. Default implementation uses Ignition's XMLSerializer with gzip=true
      Throws:
      Exception
    • deserialize

      public Object deserialize(DesignerContext context, byte[] data) throws Exception
      Turn bytes stored in this panel's project resource into the correct object type for this panel. Default implementation simply calls ClientContext.deserialize(byte[], Logger)
      Throws:
      Exception
    • getResourceType

      public abstract ResourceType getResourceType()
      The resource type key used to look up this page's project resource
    • getResourceScope

      public int getResourceScope()
      The application scope for the ProjectResource that represents this property category
    • getUpstreamResourceFilter

      @Nonnull public ResourceFilter getUpstreamResourceFilter()
      Used by a given property panel to indicate it "cares about" other resource types, and should be notified if they are changed (e.g. during an apply operation).
    • notifyUpstreamResourceChanged

      public void notifyUpstreamResourceChanged()
      Invoked when an upstream resource is committed, which tells this panel it may need to update.
    • intValueOf

      protected int intValueOf(JSpinner spinner)
    • getPreferredScrollableViewportSize

      public Dimension getPreferredScrollableViewportSize()
      Specified by:
      getPreferredScrollableViewportSize in interface Scrollable
    • getScrollableUnitIncrement

      public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
      Specified by:
      getScrollableUnitIncrement in interface Scrollable
    • getScrollableBlockIncrement

      public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
      Specified by:
      getScrollableBlockIncrement in interface Scrollable
    • getScrollableTracksViewportWidth

      public boolean getScrollableTracksViewportWidth()
      Specified by:
      getScrollableTracksViewportWidth in interface Scrollable
    • getScrollableTracksViewportHeight

      public boolean getScrollableTracksViewportHeight()
      Specified by:
      getScrollableTracksViewportHeight in interface Scrollable