LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts
Class LyStrutsViewManager

java.lang.Object
  extended by leon.view.LyViewManager
      extended by leon.view.web.LyWebViewManager
          extended by leon.view.web.struts.LyStrutsViewManager
All Implemented Interfaces:
LyViewManagerInterface

public class LyStrutsViewManager
extends LyWebViewManager

Communication control layer --> View Will implement remote update notifications.


Field Summary
static java.lang.String __VERSION
           
static java.awt.Frame _frame
          Default Frame used in some parts of the code when a default AWT component is needed (for example to create an image).
static boolean DHTML_POPUP_VIEW
          Enable/Disable popup views.
static boolean USE_ABSOLUTE_ROOT_URL
          Indicates whether an absolute URL must be used as a root url.
static int WAIT_COUNTER
          The wait counter.
 
Fields inherited from class leon.view.web.LyWebViewManager
_mobileStartUrl, _root_url, BROWSER_CHROME, BROWSER_CHROME_ID, BROWSER_FIREFOX, BROWSER_FIREFOX_ID, BROWSER_MSIE, BROWSER_MSIE_ID, BROWSER_NETSCAPE, BROWSER_NETSCAPE_ID, BROWSER_OPERA, BROWSER_OPERA_ID, BROWSER_OTHER, CACHED_IMAGE_MAX_SIZE, DEFAULT_POPUP_HEIGHT, DEFAULT_POPUP_WIDTH, OPTIMIZE_TABLE_GENERATION, PARAMETERS, REGISTER_PAGE_WRITERS, SEP_PW_ID, SHOW_LOCATION_PARAMETER_DIRECTORIES, SHOW_LOCATION_PARAMETER_LOCATION, SHOW_LOCATION_PARAMETER_MENUBAR, SHOW_LOCATION_PARAMETER_NAME, SHOW_LOCATION_PARAMETER_RESIZABLE, SHOW_LOCATION_PARAMETER_SCROLLBARS, SHOW_LOCATION_PARAMETER_STATUSBAR, SHOW_LOCATION_PARAMETER_TOOLBAR, TYPE_ALERT, TYPE_LOCATION, TYPE_LOCATION_NEW_WINDOW, TYPE_NO, TYPE_QUESTION, TYPE_SHOW_FILE, WEB_FILE_NEW_WINDOW
 
Fields inherited from class leon.view.LyViewManager
COMMAND_ALL, COMMAND_CANCEL, COMMAND_CLOSED, COMMAND_HELP, COMMAND_NO, COMMAND_NONE, COMMAND_OK, COMMAND_YES, EMPTY_AREA_HEIGHT, EMPTY_AREA_WIDTH, EMPTY_FORM_FIELD_HEIGHT, EMPTY_FORM_FIELD_WIDTH, EMPTY_FORM_HEIGHT, EMPTY_FORM_WIDTH, EMPTY_LABEL_HEIGHT, EMPTY_LABEL_WIDTH, EMPTY_MENUBAR_HEIGHT, EMPTY_MESSAGES_HEIGHT, EMPTY_MESSAGES_WIDTH, EMPTY_TABLE_HEIGHT, EMPTY_TABLE_WIDTH, EMPTY_TOOLBAR_HEIGHT, EMPTY_TOOLBAR_WIDTH, EMPTY_TOP_AREA_HEIGHT, EMPTY_TOP_AREA_WIDTH, SHOW_LOCATION_PARAMETER_FULL_SCREEN, SHOW_LOCATION_PARAMETER_HEIGHT, SHOW_LOCATION_PARAMETER_WIDTH, SHOW_LOCATION_PARAMETER_X, SHOW_LOCATION_PARAMETER_Y
 
Constructor Summary
LyStrutsViewManager(LyEnvironment environment)
          Constructor.
 
Method Summary
 void addReloadDiv(java.lang.String frame, java.lang.String divId, LyWebObject content)
          Adds reload of a DIV in a frame.
 boolean areViewManagerCompatible(LyViewManager otherViewManager)
          Check if this view manager is compatible with the given view manager
 LyViewComponent buildInternalView(LyComponent component)
          (non-Javadoc).
 void copyToClipboard(java.lang.String text)
          Copy a given text to the system clipboard.
 java.lang.String encodeUrl(java.lang.String url)
          Encode the given URL by replacing unauthorized characters.
 void exit(int code)
          (non-Javadoc).
 void free()
          (non-Javadoc).
 void freeImage(java.lang.Object image)
          Free the resources of the image if not in the cache.
 java.lang.String getAbsoluteURL(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand)
          Get the absolute URL for a context relative url.
 java.lang.String getActionAbsoluteUrl(java.lang.String action, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand)
          Method that builds an absolute URL to a leonardi action configured in the current struts module.
 java.lang.String getActionPartialUrl(java.lang.String action, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand)
          Method that builds an partial URL to a leonardi action configured in the current struts module.
 java.lang.String getActionURL(java.lang.String action)
          Method that builds a server relative URL for an action path.
 java.util.Vector<java.lang.String> getAdditionalRefreshScripts(boolean clearScripts)
          (non-Javadoc).
 java.lang.Object getColor(LyColor color)
          (non-Javadoc).
static java.awt.Frame getDefaultFrame()
          Creates and gets the default frame.
 java.lang.Object getDefaultImage()
          Construct a default image.
 java.lang.String getDisplayedViewPage(LySession session, java.lang.String targetWindow)
           
 java.lang.String getDownloadAction()
          Return the action that allow to download temporary resources but dependant from the viewer type (for ex: url / partial url for web).
 java.lang.Object getFont(LyFont font)
          (non-Javadoc).
 java.lang.String getMessageAnswerURL()
          Returns the URL that must be used to answer messages.
 org.apache.struts.config.ModuleConfig getModuleConfig()
          Gets the current struts module configuration.
 java.lang.String getPartialURL(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand)
          Get the partial URL for a context relative url.
 java.lang.String getPopupFrameAbsoluteUrl()
          Method that builds an absolute URL to the leonardi popup action configured in the current struts module.
 java.util.HashMap<java.lang.String,LyWebObject> getReloadDivs()
          Returns the list of HTML division that needs to be reloaded.
 java.lang.Object getScaledInstance(java.lang.Object image, int width, int height)
          Creates a scaled version of the given image.
 java.lang.String getScriptsDir()
          Returns the url of the directory that contains the Javascript files.
 java.lang.String getScriptsDocDir()
          Returns the path of the directory that contains the Javascript files.
 javax.servlet.ServletContext getServletContext()
          Gets the current servlet context.
 int[] getSizes(java.lang.Object image)
          Gets images sizes.
 java.lang.String getSlaveSessionClassName()
          Returns the name of the Java class that must be used to instanciate a new slave session.
 int getStringWidth(LyFont font, java.lang.String text)
          (non-Javadoc).
 java.io.File getTemporaryFile(java.lang.String fileDesc)
           
 boolean isPushModeActivated()
          Indicates whether push mode is activated or not.
 boolean isSameImage(java.lang.Object image1, java.lang.Object image2)
          Compare two images pixel by pixel.
 java.lang.Object loadImageFromStream(java.lang.Object component, java.io.InputStream resource)
          Retrieves an image from a Stream.
 boolean needsUpdate()
          Indicates whether the client needs an update.
static void removeDefaultFrame()
          Removes the default frame.
 void setClose(LyWebPageWriter pageWriter, boolean close)
          If the current page writer is not the given page writer,
if close=true
and if the page writer window is a pop up window
then adds a script to hide the pop up view
Else if close=true
and if the given page writer's window is null
then adds the current target frame to the list of frame to reload and adds the current thread to associations between thread and close requests.
 void setContextUrl(java.lang.String contextUrl)
          Set the context Url
 void setModuleConfig(org.apache.struts.config.ModuleConfig config)
          This methods is used by the LyStrutsSessionBean to intialize the struts module configuration at startup.
 void setPopupMenu(LyPopupMenu popup, java.lang.String popupMenuDivId)
          Sets the popup menu with the given value.
 void setServletContext(javax.servlet.ServletContext context)
          This methods is used by the LyStrutsSessionBean to intialize the WEB application configuration at startup.
 void showLocation(LyComponent source, java.lang.String location, boolean newWindow, java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
          Shows a location to the user.
 void swapSession(java.lang.Object newSession, java.lang.Object oldSession, java.lang.String applicationId)
          Swap two sessions.
 void updateControllersStackList(java.util.Hashtable<java.lang.String,java.util.Stack<LyViewController>> controllersStackList)
          Updates the _controllerStackList parameter with the count of controllers from the controllersStackList parameter. controllersStackList must contain names of controller stacks as keys and stack of controllers as values.
 void waitForLoading(java.lang.Object component, java.lang.Object image)
          Waits for the image loading if the headless mode is null or set to true.
 
Methods inherited from class leon.view.web.LyWebViewManager
activateAdditionalRefreshScriptsBuffer, addAdditionalRefreshScripts, addAdditionalRefreshScripts, addNewWindowScript, addPageWriter, addPopupViewMapping, addRefreshingView, addReloadFrame, addReloadFrame, answerMessage, answerMessage, askQuestion, buildWebDecoration, clearAdditionalRefreshScripts, clearRefreshingView, clearReloadFrame, clearReloadFrames, clearTemporaryResources, encodeImage, encodeString, forceScrolling, generateScriptsInclusion, getAdditionalRefreshScripts, getBrowser, getBrowserVersion, getClose, getCurrentWindowName, getDecoration, getDefaultPageResource, getLastPopupViewController, getMainTargetFrame, getMessage, getMessage, getMessage, getMobileStartURL, getNewWindowScripts, getPageWriter, getPageWriter, getPopupViewMapping, getPropertiesFromContext, getRefreshRate, getReloadFrames, getRootURL, getTargetCode, getTemporaryLocation, hideView, isBrowserSupported, isMultipleSession, isMultiSession, isReload, messageActionPerformed, removeMessageAnswer, removePageWriter, setBrowser, setCurrentWindowName, setDecoration, setMessage, setMessage, setMessageAnswerUrl, setMobileStartURL, setPageWriter, setReload, setRootURL, setTargetCode, setWaiting, showError, showFile, showLocation, showMessage, showPDFPreview, showView, showWarning, useCacheForImage, usePopupView, writeDivs
 
Methods inherited from class leon.view.LyViewManager
addDemandListener, addView, beep, buildChartConverter, buildErrorImage, buildInternalView, buildInternalView, containsView, execGui, execGui, findDefinition, getControllerStackSize, getDelay, getDemandTransmitter, getEnvironment, getMaxScreenSize, getMaxWindowSize, getPdfPrintManager, getPluginId, getPrintManager, getScreenSize, getTemporaryDir, getView, getView, getViewCount, getWaitingCounter, hasPerspective, hasProperty, isPortletMode, isRtlMode, isShared, loadDefinitions, loadDefinitions, moveCursor, prepareGui, processDemand, raiseError, registerDefinition, removeDemandListener, removeView, replay, repostGuiEvents, setPluginId, shareSession, showComments, showPerspective, startGui, stopGui, takeSnapshot, takeSnapshot, unregisterDefinition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

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

WAIT_COUNTER

public static int WAIT_COUNTER
The wait counter.


_frame

public static java.awt.Frame _frame
Default Frame used in some parts of the code when a default AWT component is needed (for example to create an image).


USE_ABSOLUTE_ROOT_URL

public static boolean USE_ABSOLUTE_ROOT_URL
Indicates whether an absolute URL must be used as a root url.


DHTML_POPUP_VIEW

public static boolean DHTML_POPUP_VIEW
Enable/Disable popup views.

Constructor Detail

LyStrutsViewManager

public LyStrutsViewManager(LyEnvironment environment)
Constructor.

Parameters:
environment - the application environment
Method Detail

getDefaultFrame

public static java.awt.Frame getDefaultFrame()
Creates and gets the default frame.

Returns:
The default frame.

removeDefaultFrame

public static void removeDefaultFrame()
Removes the default frame.


getDisplayedViewPage

public java.lang.String getDisplayedViewPage(LySession session,
                                             java.lang.String targetWindow)

setClose

public void setClose(LyWebPageWriter pageWriter,
                     boolean close)
If the current page writer is not the given page writer,
if close=true
and if the page writer window is a pop up window
then adds a script to hide the pop up view
Else if close=true
and if the given page writer's window is null
then adds the current target frame to the list of frame to reload and adds the current thread to associations between thread and close requests.

Overrides:
setClose in class LyWebViewManager
Parameters:
pageWriter - the page writer to close.
close - if true, indicates that the page of the page writer has to be closed
See Also:
LyWebViewManager.getClose()

updateControllersStackList

public void updateControllersStackList(java.util.Hashtable<java.lang.String,java.util.Stack<LyViewController>> controllersStackList)
Updates the _controllerStackList parameter with the count of controllers from the controllersStackList parameter. controllersStackList must contain names of controller stacks as keys and stack of controllers as values. _controllerStackList must contain names of controller stacks as keys and stack of controllers as values.

Overrides:
updateControllersStackList in class LyWebViewManager
Parameters:
controllersStackList -

encodeUrl

public java.lang.String encodeUrl(java.lang.String url)
Encode the given URL by replacing unauthorized characters.

Parameters:
url - the URL to encode
Returns:
the URL with only authorized characters

free

public void free()
(non-Javadoc).

Specified by:
free in interface LyViewManagerInterface
Overrides:
free in class LyWebViewManager
See Also:
LyViewManagerInterface.free()

getScriptsDir

public java.lang.String getScriptsDir()
Returns the url of the directory that contains the Javascript files.

Overrides:
getScriptsDir in class LyWebViewManager
Returns:
the url of the directory that contains the Javascript files.

getScriptsDocDir

public java.lang.String getScriptsDocDir()
Returns the path of the directory that contains the Javascript files.

Overrides:
getScriptsDocDir in class LyWebViewManager
Returns:
the path of the directory that contains the Javascript files.

getAbsoluteURL

public java.lang.String getAbsoluteURL(java.lang.String url,
                                       java.util.Map<java.lang.String,java.lang.String> parameters,
                                       boolean encodeAmpersand)
                                throws java.net.MalformedURLException
Get the absolute URL for a context relative url.

Parameters:
url - A context relative URL.
parameters - The parameters used to build the query String.
encodeAmpersand - Tells if the "&" character should be encoded.
Returns:
an absolute URL (scheme + server + port + context path + url + "?" + param1=value1 + "&" + param2=value2, etc...).
Throws:
java.net.MalformedURLException - if the URL is not well formed

getPartialURL

public java.lang.String getPartialURL(java.lang.String url,
                                      java.util.Map<java.lang.String,java.lang.String> parameters,
                                      boolean encodeAmpersand)
                               throws java.net.MalformedURLException
Get the partial URL for a context relative url.

Parameters:
url - A context relative URL.
parameters - The parameters used to build the query String.
encodeAmpersand - Tells if the "&" character should be encoded.
Returns:
an absolute URL (scheme + server + port + context path + url + "?" + param1=value1 + "&" + param2=value2, etc...).
Throws:
java.net.MalformedURLException - if the URL is not well formed

getActionAbsoluteUrl

public java.lang.String getActionAbsoluteUrl(java.lang.String action,
                                             java.util.Map<java.lang.String,java.lang.String> parameters,
                                             boolean encodeAmpersand)
Method that builds an absolute URL to a leonardi action configured in the current struts module.
This is a shortcut to the use of :
String path = getActionPath(MyLeonardiAction.class.getName());
String relativeUrl = getActionURL(path);
String absoluteUrl = getAbsoluteURL(relativeUrl, parameters, encodeAmpersand);

Parameters:
action - An action path relative to the context.
parameters - The parameters used to build the query String. (may be null).
encodeAmpersand - Tells if the "&" character should be encoded.
Returns:
an absolute URL on the current server with the query string

getActionPartialUrl

public java.lang.String getActionPartialUrl(java.lang.String action,
                                            java.util.Map<java.lang.String,java.lang.String> parameters,
                                            boolean encodeAmpersand)
Method that builds an partial URL to a leonardi action configured in the current struts module.
This is a shortcut to the use of :
String path = getActionPath(MyLeonardiAction.class.getName());
String relativeUrl = getActionURL(path);
String absoluteUrl = getAbsoluteURL(relativeUrl, parameters, encodeAmpersand);

Parameters:
action - An action path relative to the context.
parameters - The parameters used to build the query String. (may be null).
encodeAmpersand - Tells if the "&" character should be encoded.
Returns:
an absolute URL on the current server with the query string

getPopupFrameAbsoluteUrl

public java.lang.String getPopupFrameAbsoluteUrl()
Method that builds an absolute URL to the leonardi popup action configured in the current struts module.


getActionURL

public java.lang.String getActionURL(java.lang.String action)
Method that builds a server relative URL for an action path.
It takes a context relative URL and add the URL pattern in order to generate an URL that matches the current ActionServlet mapping.
Example:
if action is /myaction and the current ActionServlet URL pattern is *.do, then the result is /myaction.do.

Parameters:
action - An action path relative to the context.
Returns:
an URL that matches the current ActionServlet mapping.

getMessageAnswerURL

public java.lang.String getMessageAnswerURL()
Returns the URL that must be used to answer messages.

Overrides:
getMessageAnswerURL in class LyWebViewManager
Returns:
the URL that must answer to the user messages.

showLocation

public void showLocation(LyComponent source,
                         java.lang.String location,
                         boolean newWindow,
                         java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
Description copied from class: LyViewManager
Shows a location to the user.

Overrides:
showLocation in class LyWebViewManager
Parameters:
source - view element which raises the location
location - location
newWindow - indicates whether a new window must be opened
parameters - list of parameters

getSlaveSessionClassName

public java.lang.String getSlaveSessionClassName()
Returns the name of the Java class that must be used to instanciate a new slave session.

Overrides:
getSlaveSessionClassName in class LyViewManager
Returns:
null if default session class must be used, a full java path otherwise.

swapSession

public void swapSession(java.lang.Object newSession,
                        java.lang.Object oldSession,
                        java.lang.String applicationId)
Swap two sessions.

Overrides:
swapSession in class LyViewManager
Parameters:
newSession - the new session
oldSession - the old session
applicationId - the application id

getModuleConfig

public org.apache.struts.config.ModuleConfig getModuleConfig()
Gets the current struts module configuration.

Returns:
the current struts module configuration
See Also:
setModuleConfig(ModuleConfig)

setModuleConfig

public void setModuleConfig(org.apache.struts.config.ModuleConfig config)
This methods is used by the LyStrutsSessionBean to intialize the struts module configuration at startup.

Parameters:
config - The struts module configuration to set.
See Also:
getModuleConfig()

setContextUrl

public void setContextUrl(java.lang.String contextUrl)
Set the context Url

Parameters:
contextUrl - the context url

getServletContext

public javax.servlet.ServletContext getServletContext()
Gets the current servlet context.

Returns:
the current servlet context
See Also:
setServletContext(ServletContext)

setServletContext

public void setServletContext(javax.servlet.ServletContext context)
This methods is used by the LyStrutsSessionBean to intialize the WEB application configuration at startup.

Parameters:
context - The Servlet context to set.
See Also:
getServletContext()

getTemporaryFile

public java.io.File getTemporaryFile(java.lang.String fileDesc)

getDownloadAction

public java.lang.String getDownloadAction()
Return the action that allow to download temporary resources but dependant from the viewer type (for ex: url / partial url for web).

Specified by:
getDownloadAction in class LyViewManager

buildInternalView

public LyViewComponent buildInternalView(LyComponent component)
(non-Javadoc).

Overrides:
buildInternalView in class LyWebViewManager
See Also:
LyViewManager.buildInternalView(leon.view.LyComponent)

getAdditionalRefreshScripts

public java.util.Vector<java.lang.String> getAdditionalRefreshScripts(boolean clearScripts)
(non-Javadoc).

Overrides:
getAdditionalRefreshScripts in class LyWebViewManager
Parameters:
clearScripts - indicates whether additional refresh scripts must be cleared.
Returns:
the list of additional refresh scripts
See Also:
LyWebViewManager.getAdditionalRefreshScripts(boolean)

addReloadDiv

public void addReloadDiv(java.lang.String frame,
                         java.lang.String divId,
                         LyWebObject content)
Adds reload of a DIV in a frame.

Parameters:
frame - frame which will need to be refreshed next time
divId - the identifier of the div tag wich needs refresh
content - the HTML content for replacement

getReloadDivs

public java.util.HashMap<java.lang.String,LyWebObject> getReloadDivs()
Returns the list of HTML division that needs to be reloaded.


needsUpdate

public boolean needsUpdate()
Indicates whether the client needs an update.

Overrides:
needsUpdate in class LyWebViewManager

setPopupMenu

public void setPopupMenu(LyPopupMenu popup,
                         java.lang.String popupMenuDivId)
Sets the popup menu with the given value.

Parameters:
popup - the new popup menu

getColor

public java.lang.Object getColor(LyColor color)
(non-Javadoc).

Specified by:
getColor in interface LyViewManagerInterface
Specified by:
getColor in class LyViewManager
Parameters:
color - The leonardi color.
Returns:
A reference to the requested color, or null if it could not be found.
See Also:
LyViewManagerInterface.getColor(leon.misc.LyColor)

getFont

public java.lang.Object getFont(LyFont font)
(non-Javadoc).

Specified by:
getFont in interface LyViewManagerInterface
Specified by:
getFont in class LyViewManager
Parameters:
font - The leonardi font.
Returns:
A reference to the requested font, or null if it could not be found.
See Also:
LyViewManagerInterface.getFont(leon.misc.LyFont)

getStringWidth

public int getStringWidth(LyFont font,
                          java.lang.String text)
(non-Javadoc).

Specified by:
getStringWidth in interface LyViewManagerInterface
Specified by:
getStringWidth in class LyViewManager
Parameters:
font - The leonardi font.
text - The string value.
Returns:
The width of given string for given font.
See Also:
LyViewManagerInterface.getStringWidth(leon.misc.LyFont, java.lang.String)

getDefaultImage

public java.lang.Object getDefaultImage()
Construct a default image.

Specified by:
getDefaultImage in interface LyViewManagerInterface
Specified by:
getDefaultImage in class LyViewManager
Returns:
the built default image
See Also:
LyImageUtils.getDefaultImage(), LyViewManagerInterface.getDefaultImage()

getSizes

public int[] getSizes(java.lang.Object image)
Gets images sizes.

Specified by:
getSizes in interface LyViewManagerInterface
Specified by:
getSizes in class LyViewManager
Parameters:
image - the image
Returns:
Image size (table with 2 entries).
See Also:
LyImageUtils.getSizes(Image), LyViewManagerInterface.getSizes(Object)

getScaledInstance

public java.lang.Object getScaledInstance(java.lang.Object image,
                                          int width,
                                          int height)
Creates a scaled version of the given image.

Specified by:
getScaledInstance in interface LyViewManagerInterface
Specified by:
getScaledInstance in class LyViewManager
Parameters:
image - The image to scale.
width - The width to which to scale the image.
height - The height to which to scale the image.
Returns:
A scaled version of the image.
See Also:
LyImageUtils.getScaledInstance(Image, int, int), LyViewManagerInterface.getScaledInstance(Object, int, int)

waitForLoading

public void waitForLoading(java.lang.Object component,
                           java.lang.Object image)
                    throws java.lang.InterruptedException
Waits for the image loading if the headless mode is null or set to true.

Specified by:
waitForLoading in interface LyViewManagerInterface
Specified by:
waitForLoading in class LyViewManager
Parameters:
component - The image loading client
image - Image to load.
Throws:
java.lang.InterruptedException - if the wait is interruptued
See Also:
LyImageUtils.waitForLoading(Component, Image), LyViewManagerInterface.waitForLoading(Object, Object)

loadImageFromStream

public java.lang.Object loadImageFromStream(java.lang.Object component,
                                            java.io.InputStream resource)
                                     throws java.io.IOException
Retrieves an image from a Stream.

Specified by:
loadImageFromStream in interface LyViewManagerInterface
Specified by:
loadImageFromStream in class LyViewManager
Parameters:
component - The client of the image creation.
resource - stream inputStream to the image data
Returns:
the image or null if an error occurs
Throws:
java.io.IOException - if something is wrong during the process
See Also:
LyImageUtils.loadImageFromStream(Component, InputStream), LyViewManagerInterface.loadImageFromStream(Object, InputStream)

isSameImage

public boolean isSameImage(java.lang.Object image1,
                           java.lang.Object image2)
                    throws java.lang.InterruptedException
Compare two images pixel by pixel.

Specified by:
isSameImage in class LyViewManager
Parameters:
image1 - first image to compare
image2 - second image to compare
Returns:
true if images are identical.
Throws:
java.lang.InterruptedException - exception if problems on grabber or loading.
See Also:
LyImageUtils.isSameImage(Image, Image), LyViewManager.isSameImage(java.lang.Object, java.lang.Object)

freeImage

public void freeImage(java.lang.Object image)
Free the resources of the image if not in the cache.

Specified by:
freeImage in interface LyViewManagerInterface
Specified by:
freeImage in class LyViewManager
Parameters:
image - The image that must be freed.
See Also:
LyImageUtils.freeImage(Image), LyViewManagerInterface.freeImage(java.lang.Object)

exit

public void exit(int code)
(non-Javadoc).

Specified by:
exit in interface LyViewManagerInterface
Overrides:
exit in class LyWebViewManager
Parameters:
code - exit code of the application.
See Also:
LyViewManagerInterface.exit(int)

copyToClipboard

public void copyToClipboard(java.lang.String text)
Copy a given text to the system clipboard.

Specified by:
copyToClipboard in class LyViewManager
Parameters:
text - the text to be copied to the clipboard.

areViewManagerCompatible

public boolean areViewManagerCompatible(LyViewManager otherViewManager)
Check if this view manager is compatible with the given view manager

Overrides:
areViewManagerCompatible in class LyViewManager
Parameters:
otherViewManager - the other view manager
Returns:
true if both view manager are compatible

isPushModeActivated

public boolean isPushModeActivated()
Indicates whether push mode is activated or not. Result depends on the LY_WEB_PUSH_MODE resource.

Returns:
true is push mode is activated, false otherwise.

(c) January 2013 - W4 S.A.

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