LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts
Class LyStrutsArea

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.LyWebPageWriter
              extended by leon.view.web.struts.LyStrutsContainer
                  extended by leon.view.web.struts.LyStrutsArea
All Implemented Interfaces:
LyGraphicalArea, LyGraphicalComponent, LyGraphicalContainer, LyGraphicalFieldItem, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LySetBorderPanelInterface, LySetVisibleInterface, LyWebComponent

public class LyStrutsArea
extends LyStrutsContainer
implements LyGraphicalArea, LySetVisibleInterface, LySetBorderPanelInterface

This class implements the Area object (as described in the dtd) for web viewer.

AREA: Area
An area allows the positioning of various graphical components inside a main window or a dialog window. It can contains any type of panel as well as a title bar, a tool bar and a command bar.


Field Summary
static java.lang.String __VERSION
           
static int BORDER_PANEL_MIN_HEIGHT
          Minimum height of the border panels.
static java.lang.String BOTTOMTOOLBAR
          The bottomtoolbar string representation used within frames names.
static java.lang.String CENTER
          The center string representation used within frames names.
static java.lang.String COMMANDS
          The commands string representation used within frames names.
static int DECO_AREA_PARAMETER
          Constant used to generate CSS class name for area.
static int DECO_TIP_PARAMETER
          Constant used to generate CSS class name for tip.
static java.lang.String EASTPANEL
          The eastpanel string representation used to build frame with eastpanel names.
static java.lang.String ELEMENT
          The element string representation used within frames names.
static int FRAME_MAX_HEIGHT
          Indicates the max heightof a frame in dhtml.
static int FRAME_MAX_WIDTH
          Indicates the max width of a frame in dhtml.
static int IMAGE_TOOLBAR_SIZE
          The toolbar image size.
static int LABEL_TOOLBAR_SIZE
          The toolbar label size.
static java.lang.String LEFT
          The left string representation used within frames names.
static java.lang.String NORTHPANEL
          The northpanel string representation used to build frame with northpanel names.
static java.lang.String RIGHT
          The right string representation used within frames names.
static int SCROLLBAR_SIZE
          The scrollbar size.
static java.lang.String SELECTBAR
          The selectbar string representation used within frames names.
static java.lang.String SOUTHPANEL
          The southpanel string representation used to build frame with southpanel names.
static int TITLEBAR_SIZE
          The titlebar size.
static int TOOLBAR_SIZE
          The toolbar size.
static java.lang.String TOOLTITLE
          The tooltitle string representation used to build frame with tooltitle names.
static boolean USE_AJAX_FOR_BORDER_PANELS
          Indicates whether Ajax must be used to refresh border panels.
static java.lang.String WESTPANEL
          The westpanel string representation used to build frame with westpanel names.
 
Fields inherited from class leon.view.web.LyWebPageWriter
FORCE_AJAX, MAIN_BUFFER
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Constructor Summary
LyStrutsArea(LyArea area)
          Constructor.
 
Method Summary
 void addPanel(LyPanel panel, int pos)
          (non-Javadoc).
 void clearBeginScripts()
          (non-Javadoc).
 void clearCssScripts()
          (non-Javadoc).
 void clearEndScripts()
          (non-Javadoc).
 boolean containsLabel(LyToolBar toolBar)
          Parses the tools contained in this toolBar and search if at least one has a label.
 void free()
          (non-Javadoc).
 java.lang.String getActionUrl()
          Method overriden to return the URL to the "Command" struts action path.
 int getAreaHeight()
          Returns the height of area if fixed.
 int getAreaWidth()
          Returns the width of area if fixed.
 java.lang.StringBuffer getBuffer(java.lang.String key)
          (non-Javadoc).
 java.lang.String getMainFrameName()
          Gets name of the main frame.
 LyMenuBar getMenuBar()
          Gets the area's parent's menu bar.
 java.util.Vector<LyWebPageWriter> getPageWriters()
          (non-Javadoc).
 java.lang.String getRedirect(java.lang.String frame)
          (non-Javadoc).
 java.lang.String getRootUrl()
          Method overriden to redirect the root URL to the page action handler.
 java.lang.String getToolbarClass()
          Gets the css class of the toolbars for this area.
 boolean hasMenuBar()
          Check if this area has a menu bar.
 void init()
          (non-Javadoc).
 boolean isFrameSet()
          (non-Javadoc).
 boolean isSubFrameSet(java.lang.String frame)
          Indicates if the specified frame is also a sub frame set.
 void preparePage(java.lang.String frame, java.lang.String targetWindow)
          (non-Javadoc).
 void refresh()
          (non-Javadoc).
 void removePanel(LyPanel panel)
          (non-Javadoc).
 void setBorderPanel(LyPanel panel, short position)
          Set a border panel at the given position.
 void setForceReloadState(boolean force)
          (non-Javadoc).
 void setLayoutInfo(java.lang.String layoutInfo)
          Updates attribute layoutInfo to the given value.
 void setNoFrames(boolean noFrames)
          (non-Javadoc).
 void setOpen(boolean open)
          Updates attribute open to the given value.
 void setPrintMode(boolean printMode)
          (non-Javadoc).
 void setRedirect(java.lang.String redirect)
          (non-Javadoc)
 void setRefresh(int duration)
          (non-Javadoc).
 void setVisible(boolean status)
          (non-Javadoc).
 void writeBeginPage(java.io.Writer pw, java.lang.String frame)
          (non-Javadoc).
 void writeEndPage(java.io.Writer pw, java.lang.String frame)
          (non-Javadoc).
static void writeFrame(java.lang.String id, java.lang.String windowName, LyWebPageWriter pw, java.lang.String rootURL, java.lang.String frameName, java.lang.String forceReload, boolean scrolling, boolean autoWidth, boolean autoHeight, java.lang.String maxHeight, java.lang.String maxWidth)
          Write an iframe to fetch a subelement.
 void writeGlobalFrameSet(LyWebPageWriter pw)
          Write the FRAMESET structure of the page.
 void writeGlobalFrameSet(LyWebPageWriter pw, boolean autoWidth, boolean autoHeight)
          Write the FRAMESET structure of the page.
 void writeHtml(LyWebPageWriter pw)
          Write HTML description corresponding to this component.
 
Methods inherited from class leon.view.web.LyWebPageWriter
addBeginScript, addCssScript, addEndScript, addEndScript, append, clearBeginScripts, clearBuffer, clearCssScripts, clearEndScripts, copyScriptsTo, endComponent, getActiveFormId, getActiveName, getAttachmentDirectory, getAttachmentHandler, getBackground, getBackgroundColor, getBeginScriptsAsHtml, getCssFileAsHtml, getCssScriptsAsHtml, getEndScriptsAsHtml, getForceReloadState, getFormId, getFrameName, getId, getLastReloadTime, getNextJavaScriptId, getOldIds, getOpenFormContent, getOpenFormContent, getProperty, getScriptRoot, getTarget, getWindowName, isInnerView, isNoFrames, isPrintMode, isVisible, setActiveBuffer, setAttachmentDirectory, setAttachmentDirectory, setAttachmentHandler, setAttachmentHandler, setBackground, setBackgroundColor, setBodyClassName, setFormId, setFrameName, setInnerView, setLastModified, setProperty, setTitle, setWindowName, setWriteDivOnly, startComponent, writeBeginScripts, writeCssScripts, writeDivOnly, writeEndScripts, writeHtml, writePageContent
 
Methods inherited from class leon.view.web.LyWebObject
addFileScript, decodeUrl, displayUpPage, encodeUrl, encodeUrlXhtml, expandUrl, getDisabledImageUrl, getFontSize, getFontString, getFontString, getFontString, getHexColor, getHexColor, getHtmlEntitiesString, getHtmlString, getImageSize, getImageSize, getImageUrl, getJavascriptString, getLastFrameName, getLyFont, getMessage, getRootURL, getScrollHeightForSplitter, getUrl, getWebViewManager, replaceUrl, replaceUrl, setUpdating, updateRefreshInfo, writeJson
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getBounds, getChildrenBounds, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
getViewComponent
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

FRAME_MAX_HEIGHT

public static int FRAME_MAX_HEIGHT
Indicates the max heightof a frame in dhtml.


FRAME_MAX_WIDTH

public static int FRAME_MAX_WIDTH
Indicates the max width of a frame in dhtml.


DECO_AREA_PARAMETER

public static int DECO_AREA_PARAMETER
Constant used to generate CSS class name for area.


DECO_TIP_PARAMETER

public static int DECO_TIP_PARAMETER
Constant used to generate CSS class name for tip.


TOOLBAR_SIZE

public static final int TOOLBAR_SIZE
The toolbar size.

See Also:
Constant Field Values

IMAGE_TOOLBAR_SIZE

public static final int IMAGE_TOOLBAR_SIZE
The toolbar image size.

See Also:
Constant Field Values

LABEL_TOOLBAR_SIZE

public static final int LABEL_TOOLBAR_SIZE
The toolbar label size.

See Also:
Constant Field Values

SCROLLBAR_SIZE

public static final int SCROLLBAR_SIZE
The scrollbar size.

See Also:
Constant Field Values

TITLEBAR_SIZE

public static final int TITLEBAR_SIZE
The titlebar size.

See Also:
Constant Field Values

BORDER_PANEL_MIN_HEIGHT

public static final int BORDER_PANEL_MIN_HEIGHT
Minimum height of the border panels.

See Also:
Constant Field Values

TOOLTITLE

public static final java.lang.String TOOLTITLE
The tooltitle string representation used to build frame with tooltitle names.


NORTHPANEL

public static final java.lang.String NORTHPANEL
The northpanel string representation used to build frame with northpanel names.


SOUTHPANEL

public static final java.lang.String SOUTHPANEL
The southpanel string representation used to build frame with southpanel names.


WESTPANEL

public static final java.lang.String WESTPANEL
The westpanel string representation used to build frame with westpanel names.


EASTPANEL

public static final java.lang.String EASTPANEL
The eastpanel string representation used to build frame with eastpanel names.


SELECTBAR

public static final java.lang.String SELECTBAR
The selectbar string representation used within frames names.


COMMANDS

public static final java.lang.String COMMANDS
The commands string representation used within frames names.


ELEMENT

public static final java.lang.String ELEMENT
The element string representation used within frames names.


LEFT

public static final java.lang.String LEFT
The left string representation used within frames names.


CENTER

public static final java.lang.String CENTER
The center string representation used within frames names.


RIGHT

public static final java.lang.String RIGHT
The right string representation used within frames names.


BOTTOMTOOLBAR

public static final java.lang.String BOTTOMTOOLBAR
The bottomtoolbar string representation used within frames names.


USE_AJAX_FOR_BORDER_PANELS

public static boolean USE_AJAX_FOR_BORDER_PANELS
Indicates whether Ajax must be used to refresh border panels. If set, empty panels may be visible even if they are empty.

Constructor Detail

LyStrutsArea

public LyStrutsArea(LyArea area)
Constructor.

Parameters:
area - the area component
Method Detail

writeHtml

public void writeHtml(LyWebPageWriter pw)
Description copied from interface: LyWebComponent
Write HTML description corresponding to this component.

Specified by:
writeHtml in interface LyWebComponent
Parameters:
pw - the page writer

setBorderPanel

public void setBorderPanel(LyPanel panel,
                           short position)
Set a border panel at the given position.

Specified by:
setBorderPanel in interface LySetBorderPanelInterface
Parameters:
panel - the border panel.
position - Either NORTH, SOUTH, EAST or WEST position.

addPanel

public void addPanel(LyPanel panel,
                     int pos)
(non-Javadoc).

Specified by:
addPanel in interface LyGraphicalArea
Parameters:
panel - The panels to add to panels list.
pos - Position where the sub-component is inserted.
See Also:
LyGraphicalArea.addPanel(leon.view.LyPanel, int)

removePanel

public void removePanel(LyPanel panel)
(non-Javadoc).

Specified by:
removePanel in interface LyGraphicalArea
Parameters:
panel - The panels to remove to panels list.
See Also:
LyGraphicalArea.removePanel(leon.view.LyPanel)

setOpen

public void setOpen(boolean open)
Description copied from interface: LyGraphicalArea
Updates attribute open to the given value.

Specified by:
setOpen in interface LyGraphicalArea
Parameters:
open - Boolean indicating if attribute open is set or unset.

getRootUrl

public java.lang.String getRootUrl()
Method overriden to redirect the root URL to the page action handler.

Overrides:
getRootUrl in class LyWebObject
Returns:
the root URL
See Also:
LyWebObject.getRootURL(LyEnvironment)

getActionUrl

public java.lang.String getActionUrl()
Method overriden to return the URL to the "Command" struts action path.

Overrides:
getActionUrl in class LyWebPageWriter
Returns:
the URL of the action or null.

getAreaWidth

public int getAreaWidth()
Returns the width of area if fixed.

Returns:
the width of area in pixels or a negative value if there is no fixed width.

getAreaHeight

public int getAreaHeight()
Returns the height of area if fixed.

Returns:
the height of area in pixels or a negative value if there is no fixed height.

init

public void init()
(non-Javadoc).

Overrides:
init in class LyWebPageWriter
See Also:
leon.view.web.LyWebPage#init()

getToolbarClass

public java.lang.String getToolbarClass()
Gets the css class of the toolbars for this area.

Returns:
the name of the css class to be used for toolbars of this area.

getMainFrameName

public java.lang.String getMainFrameName()
Gets name of the main frame.

Returns:
the main frame name

writeBeginPage

public void writeBeginPage(java.io.Writer pw,
                           java.lang.String frame)
                    throws java.io.IOException
(non-Javadoc).

Overrides:
writeBeginPage in class LyWebPageWriter
Parameters:
pw - the page writer
frame - the frame where the page is written
Throws:
java.io.IOException - if something is wrong during page writing
See Also:
leon.view.web.LyWebPage#writeBeginPage(java.io.Writer, java.lang.String)

writeEndPage

public void writeEndPage(java.io.Writer pw,
                         java.lang.String frame)
                  throws java.io.IOException
(non-Javadoc).

Overrides:
writeEndPage in class LyWebPageWriter
Parameters:
pw - the page writer
frame - the frame where the page is written
Throws:
java.io.IOException - if something is wrong during end page writes
See Also:
leon.view.web.LyWebPage#writeEndPage(java.io.Writer, java.lang.String)

getRedirect

public java.lang.String getRedirect(java.lang.String frame)
(non-Javadoc).

Specified by:
getRedirect in class LyWebPageWriter
Parameters:
frame - the frame to redirect
Returns:
the URL of the alternate Web page
See Also:
LyWebPageWriter.getRedirect(java.lang.String)

setVisible

public void setVisible(boolean status)
(non-Javadoc).

Specified by:
setVisible in interface LySetVisibleInterface
Overrides:
setVisible in class LyWebPageWriter
Parameters:
status - new visibility status, if true the component will be shown, if false it will be hiden
See Also:
leon.view.web.LyWebPage#setVisible(boolean)

setNoFrames

public void setNoFrames(boolean noFrames)
(non-Javadoc).

Overrides:
setNoFrames in class LyWebPageWriter
Parameters:
noFrames - if true, means that no frame set is used, false otherwise
See Also:
leon.view.web.LyWebPage#setNoFrames(boolean)

setPrintMode

public void setPrintMode(boolean printMode)
(non-Javadoc).

Overrides:
setPrintMode in class LyWebPageWriter
See Also:
LyWebPageWriter.setPrintMode(boolean)

getPageWriters

public java.util.Vector<LyWebPageWriter> getPageWriters()
(non-Javadoc).

Specified by:
getPageWriters in class LyWebPageWriter
See Also:
LyWebPageWriter.getPageWriters()

setForceReloadState

public void setForceReloadState(boolean force)
(non-Javadoc).

Overrides:
setForceReloadState in class LyWebPageWriter
See Also:
LyWebPageWriter.setForceReloadState(boolean)

getBuffer

public java.lang.StringBuffer getBuffer(java.lang.String key)
(non-Javadoc).

Overrides:
getBuffer in class LyWebPageWriter
Parameters:
key - the frame
Returns:
the buffer associated to the given frame if it exists, null otherwise
See Also:
leon.view.web.LyWebPage#getBuffer(java.lang.String)

setRefresh

public void setRefresh(int duration)
(non-Javadoc).

Specified by:
setRefresh in interface LyGraphicalArea
Parameters:
duration - New value of refresh.
See Also:
LyGraphicalArea.setRefresh(int)

free

public void free()
(non-Javadoc).

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LyWebPageWriter
See Also:
LyFreeInterface.free()

refresh

public void refresh()
(non-Javadoc).

Overrides:
refresh in class LyWebObject
See Also:
LyWebObject.refresh()

containsLabel

public boolean containsLabel(LyToolBar toolBar)
Parses the tools contained in this toolBar and search if at least one has a label.

Parameters:
toolBar - the toolbar to parse
Returns:
true if there is at least one label, false otherwise

clearBeginScripts

public void clearBeginScripts()
(non-Javadoc).

Overrides:
clearBeginScripts in class LyWebPageWriter
See Also:
LyWebPageWriter.clearBeginScripts()

clearEndScripts

public void clearEndScripts()
(non-Javadoc).

Overrides:
clearEndScripts in class LyWebPageWriter
See Also:
LyWebPageWriter.clearEndScripts()

clearCssScripts

public void clearCssScripts()
(non-Javadoc).

Overrides:
clearCssScripts in class LyWebPageWriter
See Also:
LyWebPageWriter.clearCssScripts()

isSubFrameSet

public boolean isSubFrameSet(java.lang.String frame)
Indicates if the specified frame is also a sub frame set. Root frame set may contain sub-frameset.

Parameters:
frame - the frame
Returns:
true if the frame is also a sub frame set, false otherwise

preparePage

public void preparePage(java.lang.String frame,
                        java.lang.String targetWindow)
(non-Javadoc).

Overrides:
preparePage in class LyWebPageWriter
See Also:
LyWebPageWriter.preparePage(java.lang.String, java.lang.String)

getMenuBar

public LyMenuBar getMenuBar()
Gets the area's parent's menu bar.

Returns:
the menu bar if exists, null otherwise

hasMenuBar

public boolean hasMenuBar()
Check if this area has a menu bar.

Returns:
true if it has a menu bar, false otherwise

isFrameSet

public boolean isFrameSet()
(non-Javadoc).

Overrides:
isFrameSet in class LyWebPageWriter
See Also:
LyWebPageWriter.isFrameSet()

writeFrame

public static void writeFrame(java.lang.String id,
                              java.lang.String windowName,
                              LyWebPageWriter pw,
                              java.lang.String rootURL,
                              java.lang.String frameName,
                              java.lang.String forceReload,
                              boolean scrolling,
                              boolean autoWidth,
                              boolean autoHeight,
                              java.lang.String maxHeight,
                              java.lang.String maxWidth)
Write an iframe to fetch a subelement.

Parameters:
id - the frame id
windowName - the window name
pw - the page writer
rootURL - the root URL
frameName - the frame name
forceReload - the value to print in URL to indicates that the relaod is forced
scrolling - indicates if the frame is scrolled. If true, set the HTML frame attribute 'scrolling' to 'auto', if false, set it to 'no' .
autoWidth - auto resize the iframe in javascript (width parameter)
autoHeight - auto resize the iframe in javascript (height parameter)
maxHeight - the maximum height
maxWidth - the maximum width

writeGlobalFrameSet

public void writeGlobalFrameSet(LyWebPageWriter pw)
Write the FRAMESET structure of the page.

Parameters:
pw - the page writer

writeGlobalFrameSet

public void writeGlobalFrameSet(LyWebPageWriter pw,
                                boolean autoWidth,
                                boolean autoHeight)
Write the FRAMESET structure of the page.

Parameters:
pw - the page writer
autoWidth - auto resize the iframe in javascript (width parameter)
autoHeight - auto resize the iframe in javascript (height parameter)

setRedirect

public void setRedirect(java.lang.String redirect)
(non-Javadoc)

Specified by:
setRedirect in interface LyGraphicalArea
Parameters:
redirect - New value of redirect.
See Also:
LyGraphicalArea.setRedirect(java.lang.String)

setLayoutInfo

public void setLayoutInfo(java.lang.String layoutInfo)
Description copied from interface: LyGraphicalArea
Updates attribute layoutInfo to the given value.

Specified by:
setLayoutInfo in interface LyGraphicalArea
Parameters:
layoutInfo - New value of layoutInfo.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com