Class PageObject
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPageObject
(String id, String prototypeId, PageObject prototype, String componentRootId, Boolean childrenReordered, List<Script> allScripts, List<PageObject> allChildren, Page page) -
Method Summary
Modifier and TypeMethodDescriptionaddChildFromPrototype
(int idx, PageObject prototype) addScript
(ClassMetadata classMetadata) Adds a new script of specified classclonePageObject
(Page targetPage, UuidMapper uuidMapper) Makes a deep copy of a page object, changing ids for the object and all its children using provided mapper.copy()
Create a copy of this elementboolean
deepEquals
(Object o) Makes comparison for all instance attributesboolean
fromPrototype
(Page page) fromPrototype
(Page page, String componentRootId) Returns ID of the root object of component instance to which this object belongs.boolean
getId()
Return object ID.getName()
getPage()
TODO WEBBPMNEXT-5094 removeПолучить родителя в иерархииПолучить положение объекта на страницеGet the prototype of this objectReturns prototype id required by this object.getRoot()
boolean
hasEnabledScript
(ClassRef classRef) int
hashCode()
boolean
Check that specified object has a script of specified type or any of its subtypes (i.e. such a script thatscript instanceof classRef
is true)inherit()
Create a new object that inherits from this objectboolean
boolean
boolean
boolean
Check if this object is marked as removed.void
Mark object as removed, changing its state if needed TODO WEBBPMNEXT-5447 remove thisvoid
setComponentRootId
(String componentRootId) void
setContainer
(boolean container) void
setExpanded
(boolean expanded) void
void
setParent
(PageObjectParent parent) void
setRemoved
(boolean removed) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ru.cg.webbpm.studio.subsystems.page_designer.serialization.api.beans.PageObjectParent
addChildFromPrototype
-
Constructor Details
-
PageObject
public PageObject(String id, String prototypeId, PageObject prototype, String componentRootId, Boolean childrenReordered, List<Script> allScripts, List<PageObject> allChildren, Page page)
-
-
Method Details
-
clonePageObject
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 objectuuidMapper
- 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
-
fromPrototype
-
allPageObjects
-
getChildren
- Specified by:
getChildren
in interfacePageObjectParent
-
getParent
Получить родителя в иерархии -
setParent
-
getParentPageObject
-
getRoot
- Specified by:
getRoot
in interfacePageObjectParent
-
addChildFromPrototype
- Specified by:
addChildFromPrototype
in interfacePageObjectParent
-
getPage
TODO WEBBPMNEXT-5094 remove- Returns:
- page, or null if this object is not inside a page
-
getPathInPage
Получить положение объекта на странице- Returns:
- путь к объекту
-
getId
Description copied from interface:ArrayItemWithPrototype
Return object ID. It must be guaranteed that IDs are unique inside any list- Specified by:
getId
in interfaceArrayItemWithPrototype<PageObject>
- Returns:
- object ID
-
getName
-
setName
-
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 interfaceArrayItemWithPrototype<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 interfaceArrayItemWithPrototype<PageObject>
-
isContainer
public boolean isContainer() -
getContainer
public boolean getContainer() -
setContainer
public void setContainer(boolean container) -
getPrototype
Description copied from interface:ArrayItemWithPrototype
Get the prototype of this object- Specified by:
getPrototype
in interfaceArrayItemWithPrototype<PageObject>
- Returns:
- object's prototype
-
inherit
Description copied from interface:ArrayItemWithPrototype
Create a new object that inherits from this object- Specified by:
inherit
in interfaceArrayItemWithPrototype<PageObject>
- Returns:
- new object
-
copy
Description copied from interface:ArrayItemWithPrototype
Create a copy of this element- Specified by:
copy
in interfaceArrayItemWithPrototype<PageObject>
- Returns:
- shallow copy of the element TODO WEBBPMNEXT-5447 revise this
-
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
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
-
isChildrenReordered
public boolean isChildrenReordered() -
getScripts
-
addScript
Adds a new script of specified class- Parameters:
classMetadata
- script class
-
hasScript
Check that specified object has a script of specified type or any of its subtypes (i.e. such a script thatscript instanceof classRef
is true)- Parameters:
classRef
- class ref of script to look for
-
hasEnabledScript
-
getScript
-
getScript
-
equals
-
deepEquals
Description copied from interface:ArrayItemWithPrototype
Makes comparison for all instance attributes- Specified by:
deepEquals
in interfaceArrayItemWithPrototype<PageObject>
- Returns:
- true if equals
-
hashCode
public int hashCode()
-