Class SessionScriptWrapper.SafetyWrapper
- java.lang.Object
- 
- com.inductiveautomation.perspective.gateway.script.SessionScriptWrapper.SafetyWrapper
 
- 
- All Implemented Interfaces:
- PropertyTreeOwner
 - Enclosing class:
- SessionScriptWrapper
 
 public static class SessionScriptWrapper.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(Session session)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidclose(java.lang.String message)org.python.core.PyObjectgetInfo()java.lang.StringgetName()PagegetPage()PagegetPage(java.lang.String id)java.util.List<? extends Page>getPages()java.lang.StringgetProject()org.python.core.PyObjectgetProjectInfo()PropertyTreegetPropertyTreeOf(PropertyType propertyType)Fetch thePropertyTreeassociated with the givenPropertyTypeSessiongetSession()ViewgetView()org.python.core.PyObjectinvokeOnQueue(org.python.core.PyObject func)Invokes a python script on the queue.voidprint(java.lang.String message)booleanrefreshBinding(java.lang.String propertyStr)
 
- 
- 
- 
Field Detail- 
elementprotected final PerspectiveElement element 
 
- 
 - 
Constructor Detail- 
SafetyWrapperpublic SafetyWrapper(Session session) 
 
- 
 - 
Method Detail- 
getProjectpublic java.lang.String getProject() 
 - 
getProjectInfopublic org.python.core.PyObject getProjectInfo() 
 - 
refreshBindingpublic boolean refreshBinding(java.lang.String propertyStr) throws java.lang.Throwable- Throws:
- java.lang.Throwable
 
 - 
getInfopublic org.python.core.PyObject getInfo() - Returns:
- info about this session. Note that the return format matches the format of system.perspective.getSessionInfos() except that this object does include the pages array.
 
 - 
getPage@Nullable public Page getPage(java.lang.String id) 
 - 
getPagespublic java.util.List<? extends Page> getPages() 
 - 
closepublic void close() 
 - 
closepublic void close(@Nullable java.lang.String message)
 - 
invokeOnQueuepublic org.python.core.PyObject invokeOnQueue(org.python.core.PyObject func) throws java.lang.ExceptionInvokes a python script on the queue. In general this is a big no-no, but it can be useful in certain circumstances where you need atomicity across multiple statements with respect to changes to property trees. For example, an atomic increment. We use this method for testing. Not documented for customer use.- Throws:
- java.lang.Exception
 
 - 
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() 
 
- 
 
-