Class DefaultDesktopAgent

    • Constructor Detail

      • DefaultDesktopAgent

        public DefaultDesktopAgent​(Client client,
                                   org.zkoss.zk.ui.Desktop desktop)
    • Method Detail

      • getId

        public String getId()
        Description copied from interface: DesktopAgent
        get ID. of this the desktop.
        Specified by:
        getId in interface DesktopAgent
        Returns:
        ID or null if it hasn't.
      • getType

        public String getType()
      • getAttribute

        public Object getAttribute​(String name)
        Description copied from interface: DesktopAgent
        get attribute by specify name.
        Specified by:
        getAttribute in interface DesktopAgent
        Parameters:
        name - attribute name.
        Returns:
        attribute value or null if not found or otherwise.
      • getClient

        public Client getClient()
        Description copied from interface: Agent
        get client this agent belonged to.
        Specified by:
        getClient in interface Agent
      • getDesktop

        public org.zkoss.zk.ui.Desktop getDesktop()
        Description copied from interface: DesktopAgent
        Get the attached Desktop instance.
        Specified by:
        getDesktop in interface DesktopAgent
        Returns:
        the attached Desktop instance.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getDelegatee

        public Object getDelegatee()
        Description copied from interface: Agent
        get the delegatee object
        Specified by:
        getDelegatee in interface Agent
      • query

        public ComponentAgent query​(String selector)
        Description copied from interface: QueryAgent
        to find the first component agent with the selector in this query agent.
        Specified by:
        query in interface QueryAgent
        Parameters:
        selector - the selector
        Returns:
        the first component agent, null if not found
      • queryAll

        public List<ComponentAgent> queryAll​(String selector)
        Description copied from interface: QueryAgent
        to find the component agents with the selector in this query agent.
        Specified by:
        queryAll in interface QueryAgent
        Parameters:
        selector - the selector
        Returns:
        the component agents
      • as

        public <T> T as​(Class<T> clazz)
        Description copied from interface: QueryAgent
        Try to get a instance of target class for this query agent, the target class is usually a OperationAgent or a native Component
        if it cannot get a instance of target class, it will throw AgentException.
        Specified by:
        as in interface QueryAgent
        Parameters:
        clazz - class of specify operation.
        Returns:
        operation object.
      • is

        public <T> boolean is​(Class<T> clazz)
        Description copied from interface: QueryAgent
        Can get a instance of target class for this query agent.
        Specified by:
        is in interface QueryAgent
        Parameters:
        clazz - the class cast to.
        Returns:
        true if can get a instance of target class
      • setDownloadable

        public void setDownloadable​(Resource downloadable)
        Description copied from interface: DesktopCtrl
        setting current downloadable file.
        Specified by:
        setDownloadable in interface DesktopCtrl
        Parameters:
        downloadable - a downloadable resouce or null indicated there is no downloadable currently.
      • getDownloadable

        public Resource getDownloadable()
        Description copied from interface: DesktopAgent
        Get the current downloadable resource.
        Specified by:
        getDownloadable in interface DesktopAgent
        Returns:
        downloadable resource or null if there is no such resource.
      • getZkLog

        public List<String> getZkLog()
        Description copied from interface: DesktopAgent
        Gets the Clients.log results.
        Specified by:
        getZkLog in interface DesktopAgent
        Returns:
        Messages. An empty list if no message.
      • appendZkLog

        public void appendZkLog​(String message)
        Description copied from interface: DesktopCtrl
        Append a debug message of AuLog to current desktop.
        Specified by:
        appendZkLog in interface DesktopCtrl
        Parameters:
        message - a message.