Class Window

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Badgeable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable
Direct Known Subclasses:
TaskBarPage

public abstract class Window extends Container
This abstract class must be extended to implement a Container object that represents a page of the application
See Also:
  • Field Details

    • _es

      protected EntitySet _es
    • _restoreTo

      protected Component[] _restoreTo
    • _restoreMethod

      protected String _restoreMethod
    • _docType

      protected DocType _docType
    • _code

      protected String _code
    • _eventFirewall

      protected EventFirewall _eventFirewall
    • _gk

      protected GateKeeper _gk
    • _tz

      protected TimeZone _tz
    • hasAnEditableComponent

      protected boolean hasAnEditableComponent
    • blind

      protected boolean blind
  • Constructor Details

    • Window

      public Window()
      Main constructor
  • Method Details

    • getEventFirewall

      public EventFirewall getEventFirewall()
      Returns the EventFirewall associated to the Window
      Returns:
      The firewall used to allow or deny the execution of the events
    • setDOCTYPE

      public void setDOCTYPE(String doctype)
      Sets the DocType for the Window, depending on the string passed as parameter.
      Parameters:
      doctype - The string used to retrieve the instance of DocType. It can be "html" (DocType.HTML), "html401strict" (DocType.HTML401STRICT) or "html401transitional" (DocType.HTML401TRANSITIONAL). If the string is not recognized, it will be used the DocType.QUIRKS declaration.
    • setTimeZone

      public void setTimeZone(TimeZone tz)
      Sets the actual time zone.
      Parameters:
      tz - The Time zone to set.
    • getTimeZone

      public TimeZone getTimeZone()
      Gets the actual Time zone to use.
      Returns:
      The actual time zone to use.
    • setup

      protected void setup()
      Description copied from class: Component
      Setup the Component
      Overrides:
      setup in class Component
    • getEntitySet

      public EntitySet getEntitySet()
      Returns the EntitySet of the Window
      Returns:
      The EntitySet of the Window
    • getRoot

      public UINode getRoot()
      Returns the UINode that corresponds to the root element of the Window. In always returns the instance of the Window, which has no parent components.
      Overrides:
      getRoot in class UINode
      Returns:
      this the instance of the Window
    • getCode

      public String getCode()
      Returns the code associated to the Window, used in the url creation for the Servlet
      Returns:
      The string that represents the code of the Window
    • genCode

      public final void genCode()
      Generates the code for the Window, used in the url creation for the Servlet
    • postMessage

      public UIMessage postMessage(UIMessage uim)
    • postMessage

      public UIMessage postMessage(UIMessage uim, boolean useFirewall)
      Adds the UIMessage of the queue (LinkedList) of messages to elaborate
      Parameters:
      uim - the message to be posted
      useFirewall - to enable firewalling of unwanted messages
      Returns:
      The UIMessage
    • peekMessage

      public UIMessage peekMessage()
      Removes the first element from the queue (LinkedList) of messages to elaborate
      Returns:
      The UIMessage that is the first element of the queue of the messages to elaborate
    • setWM

      public void setWM(WindowManager wm)
      Sets the WindowManager of the Window
      Parameters:
      wm - The WindowManager to set to the Window
    • getWM

      public WindowManager getWM()
      Description copied from class: Control
      Returns the WindowManager to which belongs the Window containing the Control
      Overrides:
      getWM in class Control
      Returns:
      The instance of the WindowManager
    • getSession

      public overit.geocall.servlet.WebSession getSession()
      Returns the WebSession to which the WindowManager containing the Window belongs
      Returns:
      The WebSession to which the Window belongs
    • getRestoreTo

      public Component[] getRestoreTo()
      Returns the array of Component that are addressed when the WindowManager.pop(Object) is executed (ie the component showed when the Window is removed from the stack)
      Returns:
      The array of components that are showed when the Window is removed from the stack
    • getRestoreMethod

      public String getRestoreMethod()
      Returns the name of the method that is triggered when the WindowManager.pop(Object) is executed, ie when the Window is removed from the stack
      Returns:
      The name of the method triggered when the Window is removed from the stack
    • setRestoreTo

      public void setRestoreTo(Component[] cc)
      Sets the array of Component that are addressed when the WindowManager.pop(Object) is executed (ie the component showed when the Window is removed from the stack)
      Parameters:
      cc - The array of components that are showed when the Window is removed from the stack
    • setRestoreTo

      public void setRestoreTo(Component cc, String method)
      Sets the Component that is addressed when the WindowManager.pop(Object) is executed (ie the component showed when the Window is removed from the stack), and the method of that component that is triggered
      Parameters:
      cc - The Component showed when the Window is removed from the stack
      method - The name of the method of the component that will be triggered
    • dispatchMessage

      public boolean dispatchMessage(UIMessage msg)
      Elaborates the UIMessage passed as parameter
      Parameters:
      msg - The UIMessage to elaborate
      Returns:
      true if the message is elaborated, false if the handler for the message does not exists
    • getRegistry

      public HashGetter getRegistry()
      Returns the registry that automatically stores all the component with a registryname and all the components explicitly inserted. This registry can be used to retrieve the components from the Java classes or an external servlet
      Returns:
      The HashGetter used as registry for the components
    • getComponentById

      public <C extends Component> C getComponentById(String componentId)
      Retrieves the Component from the HashGetter that stores the components of the Window.
      Type Parameters:
      C - The method will return the component with the correct cast to the right derived class
      Parameters:
      componentId - The string that corresponds to the unique identifier, used as the key to retrieve the Component from the map.
      Returns:
      The instance of the Component retrieved from the map, with the correct cast to the right derived class, or null if in the map there isn't an entry with the desired key
    • putComponent

      public void putComponent(String id, Component c)
      Puts the Component in the HashGetter that stores the components of the Window. At each component is associated a string, used as unique identifier, that allows to retrieve the component
      Parameters:
      id - The string used as unique identifier of the component
      c - The Component to be stored in the map
    • putComponentInRegistry

      public void putComponentInRegistry(String registryName, Component c)
      Puts the Component in the registry
      Parameters:
      registryName - The registryname of the component, used as the key for the entry
      c - The Component to be stored in the registry
    • getComponentFromRegistry

      public <C extends Component> C getComponentFromRegistry(String componentName)
      Retrieves the Component from the registry
      Type Parameters:
      C - The method will return the component with the correct cast to the right derived class
      Parameters:
      componentName - The string that corresponds to the registryname, used as the key to retrieve the Component from the registry.
      Returns:
      The instance of the Component retrieved from the registry, with the correct cast to the right derived class, or null if in the registry there isn't an entry with the desired key
    • getComponentsFromRegistry

      public HashGetter getComponentsFromRegistry(String componentPrefix)
      Returns an HashGetter containing all the components that have been saved in the registry, whose registrynames start with the prefix string passed as parameter
      Parameters:
      componentPrefix - The string that defines the prefix used to retrieve the components from the registry
      Returns:
      The HashGetter containing the components whose registrynames start with the prefix string
    • show

      public void show(SingleUseComponent c)
      Shows the SingleUseComponent passed as parameter
      Parameters:
      c - An instance of SingleUseComponent like an Alert, a Tooltip or a Menu
    • showPanel

      public void showPanel(String xml, Container caller)
      Show the Panel defined by the xml passed as a parameter.
      The xml passed as parameter must represent a Panel object otherwise a ClassCastException will be raised.
      Parameters:
      xml - The path of xml that represents the Panel to show.
      caller - The caller and parent object.
    • showPanel

      public void showPanel(String xml, Container caller, boolean refreshPage)
      Show the Panel defined by the xml passed as a parameter.
      The xml passed as parameter must represent a Panel object otherwise a ClassCastException will be raised.
      Parameters:
      xml - The path of xml that represents the Panel to show.
      caller - The caller and parent object.
      refreshPage - Defines if the panel will be shown using an Ajax interaction or not. Using an Ajax interaction, the panel will be shown in a smart way, without refreshing the page, but components inside panel won't be able to manage the EntitySet of the page.
    • showPanel

      public void showPanel(String xml, Serializable params, Container caller)
      Show the Panel defined by the xml passed as a parameter.
      The xml passed as parameter must represent a Panel object otherwise a ClassCastException will be raised.
      Parameters:
      xml - The path of xml that represents the Panel to show.
      params - A Serializable object to pass as global variable to the Panel to show.
      caller - The caller and parent object.
    • showPanel

      public void showPanel(XMLTree xmlt, String xml, Serializable params, Container caller)
      Show the Panel defined by the xml passed as a parameter.
      The xml passed as parameter must represent a Panel object otherwise a ClassCastException will be raised.
      Parameters:
      xmlt - The XMLTree from which parse and create the xml of the Panel.
      xml - The path of xml that represents the Panel to show.
      caller - The caller and parent object.
    • showPanel

      public void showPanel(XMLTree xmlt, String xml, Serializable params, Container caller, boolean refreshPage)
      Show the Panel defined by the xml passed as a parameter.
      The xml passed as parameter must represent a Panel object otherwise a ClassCastException will be raised.
      Parameters:
      xmlt - The XMLTree from which parse and create the xml of the Panel.
      xml - The path of xml that represents the Panel to show.
      caller - The caller and parent object.
      refreshPage - Defines if the panel will be shown using an Ajax interaction or not. Using an Ajax interaction, the panel will be shown in a smart way, without refreshing the page, but components inside panel won't be able to manage the EntitySet of the page.
    • getDocType

      public DocType getDocType()
      Returns the DocType of the Window
      Returns:
      The DocType instance associated to the Window. If it is not forcibly set with the setDOCTYPE(String) method, it is by default the one set in the configuration file of the application (PropertiesUI.DOC_TYPE). If in the configuration file is not set, it will be the DocType.HTML one.
    • getDocument

      public org.apache.ecs.Element getDocument()
      Returns the ElementContainer that contains the html code of the EntitySet of the Window
      Returns:
      The html document of the Window
    • getGateKeeper

      public GateKeeper getGateKeeper()
      Returns the GateKeeper that is associated to the Window
      Returns:
      The GateKeeper associated to the Window
    • makeSerializationTest

      public Object makeSerializationTest(Alert a, Object o)
      Makes a list of serialization/deserialization tests of an object and fills an Alert with a table of the results, including possible errors.
      Parameters:
      a - , the Alert to be prepared
      o - The object to be serielized an deserielizaed
      Returns:
      the last algorithm deserialized object.
    • activate

      public static void activate(Window window)
      Bind the window to the current context
      Parameters:
      window - the window to bind
    • deactivate

      public static void deactivate()
      Unbind the window from the context
    • current

      public static Window current()
      Returns the current context's window
      Returns:
      The current context's window
    • hasAnEditableComponent

      public boolean hasAnEditableComponent()
      Gets if inside this window there at least one grid or table that can be configured by the user.
      Returns:
      true if inside this window there at least one grid or table that can be configured by the user, false otherwise.
    • setHasAnEditableComponent

      public void setHasAnEditableComponent(boolean b)
      Sets if inside this window there at least one grid or table that can be configured by the user.
      Parameters:
      b - true if inside this window there at least one grid or table that can be configured by the user, false otherwise.
    • isBlind

      public boolean isBlind()
      Gets if the window is a blind window or not.
      If a window is blind means that the restore phase will not be managed when the window will be closed.
      So with a blind window the Container.onRestore(Object) method will not be called, when the Container.onClose() will be called.
      Returns:
      true if the window is a blind window, false otherwise.
    • setIsBlind

      public void setIsBlind(boolean b)
      Sets if the window is a blind window or not.
      If a window is blind means that the restore phase will not be managed when the window will be closed.
      So with a blind window the Container.onRestore(Object) method will not be called, when the Container.onClose() will be called.
      Parameters:
      b - true if the window is a blind window, false otherwise.
    • addClientResource

      public void addClientResource(String name, org.apache.ecs.Element e)
      Adds a Element to the wrapper's set of resources to send to the client.
      The element will be identified by its name.
      Parameters:
      name - The name that identify the Element.
      e - The Element to send to the client.
    • getClientResources

      public org.apache.ecs.Element getClientResources()
      Gets the set of scripts and styles Element resources to send to the client.
      Returns:
      The set of scripts and styles Element resources to send to the client.
    • clearClientResources

      public void clearClientResources()
      Clear the set of scripts and styles Element resources to send to the client.