Class SessionScriptWrapper.SafetyWrapper

  • All Implemented Interfaces:
    PropertyTreeOwner
    Enclosing class:
    SessionScriptWrapper

    public static class SessionScriptWrapper.SafetyWrapper
    extends java.lang.Object
    Delegates 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

    • Constructor Detail

      • SafetyWrapper

        public SafetyWrapper​(Session session)
    • Method Detail

      • getProject

        public java.lang.String getProject()
      • getProjectInfo

        public org.python.core.PyObject getProjectInfo()
      • refreshBinding

        public boolean refreshBinding​(java.lang.String propertyStr)
                               throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • getInfo

        public 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)
      • getPages

        public java.util.List<? extends Page> getPages()
      • close

        public void close()
      • close

        public void close​(@Nullable
                          java.lang.String message)
      • invokeOnQueue

        public org.python.core.PyObject invokeOnQueue​(org.python.core.PyObject func)
                                               throws java.lang.Exception
        Invokes 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
      • 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()