org.objectweb.telosys.uil.screenmap
Class ScreenDefinition

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.uil.screenmap.ScreenDefinition

public class ScreenDefinition
extends TelosysObject

Each instance of this class represents a screen definition loaded from the "screens.xml" file
or defined by convention (since v 1.1.0 )
One instance for each screen.


Constructor Summary
protected ScreenDefinition(java.lang.String screenName, org.objectweb.telosys.uil.screenmap.ScreenDefLocation screenLoc, java.lang.String sContextId, java.lang.String sContextName, java.lang.String sContextAction)
          Creates a new screen definition with the attributes located at the "screen" tag level
 
Method Summary
protected  void addElement(ScreenMapElement elem)
          Adds a screen element
This method is used by the loader when a subtag "screen/element" is encountered
 int getElemCount()
          Returns the number of elements
 java.util.HashMap getElements()
          Returns all the elements defined
 boolean getFlagScreenBodyParsed()
          Returns true if the Screen Body file has been parsed
 java.lang.String getScreenBody(java.lang.String sType)
          Returns the "screen body" file part for the given type ( without the "root dir" part )
 java.lang.String getScreenContextAction()
          Returns the default screen context action for this ScreenMap, or null if none
 int getScreenContextId()
          Returns the id of the screen context associated with this ScreenMap
The expected values are :
.
 java.lang.String getScreenContextName()
          Returns the name of the screen context associated with this ScreenMap
or null if none
 java.lang.String getScreenCss(java.lang.String sType)
          Returns the CSS to use
protected  org.objectweb.telosys.uil.screenmap.ScreenDefLocation getScreenDefLocation()
          Returns the common screen location (used for both "html" and "xml" types)
protected  org.objectweb.telosys.uil.screenmap.ScreenDefLocation getScreenDefLocation(java.lang.String sScreenTypeParam)
          Returns the screen definition associated with the given type, or null if no specific definition has been defined
 java.lang.String getScreenName()
          Returns the ScreenMap name
 java.lang.String getScreenScript(java.lang.String sType)
          Returns the Javascript to use
 java.lang.String getScreenTarget(java.lang.String sType)
          Returns the screen target ( template, simpe page or URL )
 Translator getTranslator()
          Returns the translator to use
 boolean isBodyTarget(java.lang.String sType)
          Returns true if the screen is composed of a template and a screen body
 boolean isPageTarget(java.lang.String sType)
          Returns true if the screen is a single resource ( just one JSP, no template + body )
protected  void setElements(java.util.HashMap hm)
          Set the elements
protected  void setFlagScreenBodyParsed(boolean v)
          Set the flag saying if the Screen Body file has been parsed
protected  void setScreenContextAction(java.lang.String v)
          Set the default screen context action for this ScreenMap
protected  void setScreenContextId(java.lang.String v)
          Set the id of the screen context associated with this ScreenMap
protected  void setScreenContextName(java.lang.String v)
          Set the name of the screen context associated with this ScreenMap
protected  void setScreenDefLocation(org.objectweb.telosys.uil.screenmap.ScreenDefLocation screenLoc)
          Set a specific "html" or "xul" definition
This method is used by the loader when a subtag "screen/html" or "screen/xul" is encountered
protected  void setTranslator(Translator t)
          Set the translator to use
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenDefinition

protected ScreenDefinition(java.lang.String screenName,
                           org.objectweb.telosys.uil.screenmap.ScreenDefLocation screenLoc,
                           java.lang.String sContextId,
                           java.lang.String sContextName,
                           java.lang.String sContextAction)
Creates a new screen definition with the attributes located at the "screen" tag level

Parameters:
screenName - the screen name (cannot be null)
screenLoc - the common Screen Def Location (cannot be null)
sContextId - can be null or void
sContextName - can be null or void
sContextAction - can be null or void
Method Detail

getScreenName

public final java.lang.String getScreenName()
Returns the ScreenMap name

Returns:

getFlagScreenBodyParsed

public final boolean getFlagScreenBodyParsed()
Returns true if the Screen Body file has been parsed

Returns:

setFlagScreenBodyParsed

protected final void setFlagScreenBodyParsed(boolean v)
Set the flag saying if the Screen Body file has been parsed

Parameters:
v -

getScreenContextId

public final int getScreenContextId()
Returns the id of the screen context associated with this ScreenMap
The expected values are :
. UNDEFINED_CONTEXT_ID
. DYNAMIC_CONTEXT_ID
. 0 .. N ( explicit context id )

Returns:

setScreenContextId

protected final void setScreenContextId(java.lang.String v)
Set the id of the screen context associated with this ScreenMap

Parameters:
v -
Since:
1.0.5

getScreenContextName

public final java.lang.String getScreenContextName()
Returns the name of the screen context associated with this ScreenMap
or null if none

Returns:

setScreenContextName

protected final void setScreenContextName(java.lang.String v)
Set the name of the screen context associated with this ScreenMap

Parameters:
v -
Since:
1.0.5

getScreenContextAction

public final java.lang.String getScreenContextAction()
Returns the default screen context action for this ScreenMap, or null if none

Returns:

setScreenContextAction

protected final void setScreenContextAction(java.lang.String v)
Set the default screen context action for this ScreenMap

Parameters:
v -
Since:
1.0.5

setScreenDefLocation

protected void setScreenDefLocation(org.objectweb.telosys.uil.screenmap.ScreenDefLocation screenLoc)
Set a specific "html" or "xul" definition
This method is used by the loader when a subtag "screen/html" or "screen/xul" is encountered

Parameters:
screenLoc -

getScreenDefLocation

protected final org.objectweb.telosys.uil.screenmap.ScreenDefLocation getScreenDefLocation()
Returns the common screen location (used for both "html" and "xml" types)

Returns:
Since:
1.0.5

getScreenDefLocation

protected final org.objectweb.telosys.uil.screenmap.ScreenDefLocation getScreenDefLocation(java.lang.String sScreenTypeParam)
Returns the screen definition associated with the given type, or null if no specific definition has been defined

Parameters:
sScreenTypeParam - "html" or "xul" ( not case sensitive )
Returns:

addElement

protected void addElement(ScreenMapElement elem)
Adds a screen element
This method is used by the loader when a subtag "screen/element" is encountered

Parameters:
elem -

setElements

protected void setElements(java.util.HashMap hm)
Set the elements

Parameters:
hm -

getElements

public java.util.HashMap getElements()
Returns all the elements defined

Returns:

getElemCount

public int getElemCount()
Returns the number of elements

Returns:

setTranslator

protected void setTranslator(Translator t)
Set the translator to use

Parameters:
t -

getTranslator

public Translator getTranslator()
Returns the translator to use

Returns:

isBodyTarget

public boolean isBodyTarget(java.lang.String sType)
Returns true if the screen is composed of a template and a screen body

Parameters:
sType -
Returns:

isPageTarget

public boolean isPageTarget(java.lang.String sType)
Returns true if the screen is a single resource ( just one JSP, no template + body )

Parameters:
sType -
Returns:

getScreenTarget

public java.lang.String getScreenTarget(java.lang.String sType)
Returns the screen target ( template, simpe page or URL )

Parameters:
sType -
Returns:
the path to the target

getScreenBody

public java.lang.String getScreenBody(java.lang.String sType)
Returns the "screen body" file part for the given type ( without the "root dir" part )

Parameters:
sType -
Returns:

getScreenCss

public java.lang.String getScreenCss(java.lang.String sType)
Returns the CSS to use

Parameters:
sType -
Returns:

getScreenScript

public java.lang.String getScreenScript(java.lang.String sType)
Returns the Javascript to use

Parameters:
sType -
Returns: