java.lang.Object
ru.cg.webbpm.studio.subsystems.page_designer.serialization.api.beans.PageObject
All Implemented Interfaces:
PageObjectParent, ArrayItemWithPrototype<PageObject>

public class PageObject extends Object implements PageObjectParent, ArrayItemWithPrototype<PageObject>
Author:
Abdulin Ildar
  • Constructor Details

  • Method Details

    • clonePageObject

      public PageObject clonePageObject(Page targetPage, UuidMapper uuidMapper)
      Makes a deep copy of a page object, changing ids for the object and all its children using provided mapper. Changes references to correct ids according to provided mapper.
      Parameters:
      targetPage - target page for the object
      uuidMapper - a mapper for page objects' UUIDs; it will be applied to the object and all its children. note that the mapper will be memoized to preserve component root ids
      Returns:
      deep copy of the object
    • fromPrototype

      public PageObject fromPrototype(Page page)
    • fromPrototype

      public PageObject fromPrototype(Page page, String componentRootId)
    • allPageObjects

      public Stream<PageObject> allPageObjects()
    • getChildren

      public PrototypedList<PageObject> getChildren()
      Specified by:
      getChildren in interface PageObjectParent
    • getParent

      public PageObjectParent getParent()
      Получить родителя в иерархии
    • setParent

      public void setParent(PageObjectParent parent)
    • getParentPageObject

      public PageObject getParentPageObject()
    • getRoot

      public PageObjectParent getRoot()
      Specified by:
      getRoot in interface PageObjectParent
    • addChildFromPrototype

      public PageObject addChildFromPrototype(int idx, PageObject prototype)
      Specified by:
      addChildFromPrototype in interface PageObjectParent
    • getPage

      public Optional<Page> getPage()
      TODO WEBBPMNEXT-5094 remove
      Returns:
      page, or null if this object is not inside a page
    • getPathInPage

      public String getPathInPage()
      Получить положение объекта на странице
      Returns:
      путь к объекту
    • getId

      public String getId()
      Description copied from interface: ArrayItemWithPrototype
      Return object ID. It must be guaranteed that IDs are unique inside any list
      Specified by:
      getId in interface ArrayItemWithPrototype<PageObject>
      Returns:
      object ID
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • isExpanded

      public boolean isExpanded()
    • setExpanded

      public void setExpanded(boolean expanded)
    • isRemoved

      public boolean isRemoved()
      Description copied from interface: ArrayItemWithPrototype
      Check if this object is marked as removed. Removed objects are preserved for list inheritance
      Specified by:
      isRemoved in interface ArrayItemWithPrototype<PageObject>
      Returns:
      true if object is removed TODO WEBBPMNEXT-5447 remove this
    • setRemoved

      public void setRemoved(boolean removed)
    • markRemoved

      public void markRemoved()
      Description copied from interface: ArrayItemWithPrototype
      Mark object as removed, changing its state if needed TODO WEBBPMNEXT-5447 remove this
      Specified by:
      markRemoved in interface ArrayItemWithPrototype<PageObject>
    • isContainer

      public boolean isContainer()
    • getContainer

      public boolean getContainer()
    • setContainer

      public void setContainer(boolean container)
    • getPrototype

      public PageObject getPrototype()
      Description copied from interface: ArrayItemWithPrototype
      Get the prototype of this object
      Specified by:
      getPrototype in interface ArrayItemWithPrototype<PageObject>
      Returns:
      object's prototype
    • inherit

      public PageObject inherit()
      Description copied from interface: ArrayItemWithPrototype
      Create a new object that inherits from this object
      Specified by:
      inherit in interface ArrayItemWithPrototype<PageObject>
      Returns:
      new object
    • copy

      public PageObject copy()
      Description copied from interface: ArrayItemWithPrototype
      Create a copy of this element
      Specified by:
      copy in interface ArrayItemWithPrototype<PageObject>
      Returns:
      shallow copy of the element TODO WEBBPMNEXT-5447 revise this
    • getPrototypeId

      public String getPrototypeId()
      Returns prototype id required by this object. Note that prototype not necessarily exists, so #getPrototype().getId() is not the same as #getPrototypeId()
      Returns:
      prototype id, or null if object has no prototype id
    • getComponentRootId

      public String getComponentRootId()
      Returns ID of the root object of component instance to which this object belongs. If this object's prototype is a "simple" component (i.e. VBox), this returns object id. If the prototype is a root object of a "complex" component (e.g. EditableOneToMany root), this returns object id. If the prototype is a non-root object of a "complex" component, this returns id of an object corresponding to the root object of prototype component "instance"
      Returns:
      id of a component root
    • setComponentRootId

      public void setComponentRootId(String componentRootId)
    • isChildrenReordered

      public boolean isChildrenReordered()
    • getScripts

      public PrototypedList<Script> getScripts()
    • addScript

      public Script addScript(ClassMetadata classMetadata)
      Adds a new script of specified class
      Parameters:
      classMetadata - script class
    • hasScript

      public boolean hasScript(ClassRef classRef)
      Check that specified object has a script of specified type or any of its subtypes (i.e. such a script that script instanceof classRef is true)
      Parameters:
      classRef - class ref of script to look for
    • hasEnabledScript

      public boolean hasEnabledScript(ClassRef classRef)
    • getScript

      public Optional<Script> getScript(ClassRef classRef)
    • getScript

      public Optional<Script> getScript(Predicate<Script> predicate)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • deepEquals

      public boolean deepEquals(Object o)
      Description copied from interface: ArrayItemWithPrototype
      Makes comparison for all instance attributes
      Specified by:
      deepEquals in interface ArrayItemWithPrototype<PageObject>
      Returns:
      true if equals
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object