Class ComponentModelScriptWrapper.SafetyWrapper
- java.lang.Object
-
- com.inductiveautomation.perspective.gateway.script.ComponentModelScriptWrapper.SafetyWrapper
-
- All Implemented Interfaces:
PropertyTreeOwner
- Enclosing class:
- ComponentModelScriptWrapper
public static class ComponentModelScriptWrapper.SafetyWrapper extends java.lang.Object
Delegates to the actual component, this prevents the scripting system from being able to call everything on ComponentModel, like startup(), shutdown, etc.Also gives us a good place to implement methods that make sense for script authors, that don't belong on the the model object, like more user friendly versions of getChild, findSibling, etc.
-
-
Field Summary
Fields Modifier and Type Field Description protected PerspectiveElement
element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
focus()
PerspectiveElement
getChild(java.lang.String name)
java.util.Collection<Component>
getChildren()
java.lang.String
getName()
Page
getPage()
Component
getParent()
PropertyTree
getPropertyTreeOf(PropertyType propertyType)
Fetch thePropertyTree
associated with the givenPropertyType
Session
getSession()
PerspectiveElement
getSibling(java.lang.String name)
View
getView()
void
print(java.lang.String message)
boolean
refreshBinding(java.lang.String propertyStr)
-
-
-
Field Detail
-
element
protected final PerspectiveElement element
-
-
Method Detail
-
getChild
public PerspectiveElement getChild(java.lang.String name)
-
getSibling
public PerspectiveElement getSibling(java.lang.String name)
-
getChildren
public java.util.Collection<Component> getChildren()
-
refreshBinding
public boolean refreshBinding(java.lang.String propertyStr) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
focus
public void focus()
-
getParent
@Nullable public Component getParent()
-
getPropertyTreeOf
@Nullable public PropertyTree getPropertyTreeOf(@Nullable PropertyType propertyType)
Description copied from interface:PropertyTreeOwner
Fetch thePropertyTree
associated with the givenPropertyType
- Specified by:
getPropertyTreeOf
in interfacePropertyTreeOwner
- Parameters:
propertyType
- ThePropertyType
of thePropertyTree
we want to fetch- Returns:
- The PropertyTree or null if this PropertyTreeOwner does not manage a PropertyTree for the given PropertyType or if a null PropertyType is given
-
print
public void print(java.lang.String message)
-
getView
public View getView()
-
getSession
public Session getSession()
-
getPage
public Page getPage()
-
getName
public java.lang.String getName()
-
-