Class ComponentModel

    • Method Detail

      • newActionHandler

        protected com.inductiveautomation.perspective.gateway.model.ActionCollection newActionHandler​(EventConfig config)
      • initChildren

        protected void initChildren​(java.util.List<ComponentConfig> configChildren)
      • setName

        protected void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface PerspectiveElement
        Returns:
        The name of the element. If this is a component, it will be the name of the component. If this is a View, the name will be "view". If this is a Page, the name will be "page". If this is the session, the name will be "session".
      • getQualifiedPath

        public java.lang.String getQualifiedPath()
        Specified by:
        getQualifiedPath in interface PerspectiveElement
        Returns:
        The qualified name of the element. If session or page, this is just the name. If a view or component, is the logical path starting at the view id.
      • findCustomMethod

        public java.util.Optional<org.python.core.PyMethod> findCustomMethod​(java.lang.String methodName)
      • mdcTeardown

        public void mdcTeardown()
        Description copied from interface: LoggingContext
        Tear down the MDC keys that are added in #mdcSetup
        Specified by:
        mdcTeardown in interface LoggingContext
      • onStartup

        protected void onStartup()
        Starts up the bindings and any children
        Specified by:
        onStartup in class AbstractLifecycle
      • onShutdown

        protected void onShutdown()
        Shuts down bindings and then shuts down all children
        Specified by:
        onShutdown in class AbstractLifecycle
      • getComponentAddressPath

        public java.lang.String getComponentAddressPath()
        Description copied from interface: Component
        Index path of the component, like "0:5"
        Specified by:
        getComponentAddressPath in interface Component
      • getParent

        @Nullable
        public Component getParent()
        Specified by:
        getParent in interface Component
        Returns:
        parent component, or null if this a root container.
      • refreshBinding

        public void refreshBinding​(PropertyKey property)
      • focus

        public void focus()
      • dispatch

        public void dispatch​(int[] propPath,
                             int pointer,
                             java.util.function.Consumer<ComponentModel> task)
        Call that will walk down the component tree given a path of indices, and then execute a task on the component indicated by the path.
      • children

        @Nonnull
        protected java.util.List<ComponentModel> children()
        This method should always return a list containing all children, in the proper order. Note that though all children are present and in the correct order, their index values may not be representative of their actual child ID (as is the case in the designer, where index and id diverge as changes are made to children).
        Returns:
        a list of child component models, which may be empty but will never be null.
      • fireEvent

        public void fireEvent​(java.lang.String eventType,
                              java.lang.String eventName,
                              java.lang.Object eventObject)
        Description copied from interface: Component
        Fire an event on component. Can either be a 'component' event or a 'delegate' event.
        Specified by:
        fireEvent in interface Component
      • getComponentState

        public com.inductiveautomation.ignition.common.gson.JsonElement getComponentState()
      • getTraceId

        public java.lang.String getTraceId()
        Returns:
        A string suitable for identifying this component in log messages. Will contain the address path, name, and component type, like "ia.display.label-MyLabel-0:5"
      • findChildByName

        @Nonnull
        public java.util.Optional<PerspectiveElement> findChildByName​(@Nonnull
                                                                      java.util.Iterator<java.lang.String> pathIterator)
        Attempts to locate a child at a given path. If the iterator is exhausted (hasNext() returns false), then this method will return itself. Otherwise, the iterator's values are interpreted as names of children and this method will call into a child's implementation of findChildByName.
        Specified by:
        findChildByName in interface Component
        Parameters:
        pathIterator - an iterator whose next value is the name of a child of this component, or if the iterator is exhausted, then this component is the one that will be returned.
        Returns:
        an optional of the component being searched for, empty if not found.
      • getView

        public ViewModel getView()
        Specified by:
        getView in interface PerspectiveElement
        Returns:
        The view within which this element exists, or null if this is a Page or Session