Class ViewModelScriptWrapper.SafetyWrapper
- java.lang.Object
- 
- com.inductiveautomation.perspective.gateway.script.ViewModelScriptWrapper.SafetyWrapper
 
- 
- All Implemented Interfaces:
- PropertyTreeOwner
 - Enclosing class:
- ViewModelScriptWrapper
 
 public static class ViewModelScriptWrapper.SafetyWrapper extends java.lang.ObjectDelegates to the actual view, this prevents the scripting system from being able to call everything on ViewModel, 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 
- 
- 
Field SummaryFields Modifier and Type Field Description protected PerspectiveElementelement
 - 
Constructor SummaryConstructors Constructor Description SafetyWrapper(ViewModel view)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description PerspectiveElementgetChild(java.lang.String name)java.lang.StringgetId()java.lang.StringgetName()PagegetPage()PropertyTreegetPropertyTreeOf(PropertyType propertyType)Fetch thePropertyTreeassociated with the givenPropertyTypeComponentgetRootContainer()SessiongetSession()ViewgetView()voidprint(java.lang.String message)booleanrefreshBinding(java.lang.String propertyStr)
 
- 
- 
- 
Field Detail- 
elementprotected final PerspectiveElement element 
 
- 
 - 
Constructor Detail- 
SafetyWrapperpublic SafetyWrapper(ViewModel view) 
 
- 
 - 
Method Detail- 
getChildpublic PerspectiveElement getChild(java.lang.String name) 
 - 
getRootContainerpublic Component getRootContainer() 
 - 
getIdpublic java.lang.String getId() 
 - 
refreshBindingpublic boolean refreshBinding(java.lang.String propertyStr) throws java.lang.Throwable- Throws:
- java.lang.Throwable
 
 - 
getPropertyTreeOf@Nullable public PropertyTree getPropertyTreeOf(@Nullable PropertyType propertyType) Description copied from interface:PropertyTreeOwnerFetch thePropertyTreeassociated with the givenPropertyType- Specified by:
- getPropertyTreeOfin interface- PropertyTreeOwner
- Parameters:
- propertyType- The- PropertyTypeof the- PropertyTreewe 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
 
 - 
printpublic void print(java.lang.String message) 
 - 
getViewpublic View getView() 
 - 
getSessionpublic Session getSession() 
 - 
getPagepublic Page getPage() 
 - 
getNamepublic java.lang.String getName() 
 
- 
 
-