|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.LyViewManager
leon.view.web.LyWebViewManager
leon.view.web.struts.LyStrutsViewManager
public class LyStrutsViewManager
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. |
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 java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static int WAIT_COUNTER
public static java.awt.Frame _frame
public static boolean USE_ABSOLUTE_ROOT_URL
public static boolean DHTML_POPUP_VIEW
Constructor Detail |
---|
public LyStrutsViewManager(LyEnvironment environment)
environment
- the application environmentMethod Detail |
---|
public static java.awt.Frame getDefaultFrame()
public static void removeDefaultFrame()
public java.lang.String getDisplayedViewPage(LySession session, java.lang.String targetWindow)
public void setClose(LyWebPageWriter pageWriter, boolean close)
close=true
close=true
setClose
in class LyWebViewManager
pageWriter
- the page writer to close.close
- if true, indicates that the page of the page writer has to be closedLyWebViewManager.getClose()
public void updateControllersStackList(java.util.Hashtable<java.lang.String,java.util.Stack<LyViewController>> controllersStackList)
updateControllersStackList
in class LyWebViewManager
controllersStackList
- public java.lang.String encodeUrl(java.lang.String url)
url
- the URL to encode
public void free()
free
in interface LyViewManagerInterface
free
in class LyWebViewManager
LyViewManagerInterface.free()
public java.lang.String getScriptsDir()
getScriptsDir
in class LyWebViewManager
public java.lang.String getScriptsDocDir()
getScriptsDocDir
in class LyWebViewManager
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
url
- A context relative URL.parameters
- The parameters used to build the query String.encodeAmpersand
- Tells if the "&" character should be encoded.
java.net.MalformedURLException
- if the URL is not well formedpublic java.lang.String getPartialURL(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand) throws java.net.MalformedURLException
url
- A context relative URL.parameters
- The parameters used to build the query String.encodeAmpersand
- Tells if the "&" character should be encoded.
java.net.MalformedURLException
- if the URL is not well formedpublic java.lang.String getActionAbsoluteUrl(java.lang.String action, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand)
String path = getActionPath(MyLeonardiAction.class.getName());
String relativeUrl = getActionURL(path);
String absoluteUrl = getAbsoluteURL(relativeUrl, parameters, encodeAmpersand);
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.
public java.lang.String getActionPartialUrl(java.lang.String action, java.util.Map<java.lang.String,java.lang.String> parameters, boolean encodeAmpersand)
String path = getActionPath(MyLeonardiAction.class.getName());
String relativeUrl = getActionURL(path);
String absoluteUrl = getAbsoluteURL(relativeUrl, parameters, encodeAmpersand);
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.
public java.lang.String getPopupFrameAbsoluteUrl()
public java.lang.String getActionURL(java.lang.String action)
/myaction
and the current ActionServlet URL pattern is
*.do
, then the result is /myaction.do
.
action
- An action path relative to the context.
public java.lang.String getMessageAnswerURL()
getMessageAnswerURL
in class LyWebViewManager
public void showLocation(LyComponent source, java.lang.String location, boolean newWindow, java.util.Hashtable<java.lang.Short,java.lang.String> parameters)
LyViewManager
showLocation
in class LyWebViewManager
source
- view element which raises the locationlocation
- locationnewWindow
- indicates whether a new window must be openedparameters
- list of parameterspublic java.lang.String getSlaveSessionClassName()
getSlaveSessionClassName
in class LyViewManager
public void swapSession(java.lang.Object newSession, java.lang.Object oldSession, java.lang.String applicationId)
swapSession
in class LyViewManager
newSession
- the new sessionoldSession
- the old sessionapplicationId
- the application idpublic org.apache.struts.config.ModuleConfig getModuleConfig()
setModuleConfig(ModuleConfig)
public void setModuleConfig(org.apache.struts.config.ModuleConfig config)
config
- The struts module configuration to set.getModuleConfig()
public void setContextUrl(java.lang.String contextUrl)
contextUrl
- the context urlpublic javax.servlet.ServletContext getServletContext()
setServletContext(ServletContext)
public void setServletContext(javax.servlet.ServletContext context)
context
- The Servlet context to set.getServletContext()
public java.io.File getTemporaryFile(java.lang.String fileDesc)
public java.lang.String getDownloadAction()
getDownloadAction
in class LyViewManager
public LyViewComponent buildInternalView(LyComponent component)
buildInternalView
in class LyWebViewManager
LyViewManager.buildInternalView(leon.view.LyComponent)
public java.util.Vector<java.lang.String> getAdditionalRefreshScripts(boolean clearScripts)
getAdditionalRefreshScripts
in class LyWebViewManager
clearScripts
- indicates whether additional refresh scripts must be cleared.
LyWebViewManager.getAdditionalRefreshScripts(boolean)
public void addReloadDiv(java.lang.String frame, java.lang.String divId, LyWebObject content)
frame
- frame which will need to be refreshed next timedivId
- the identifier of the div tag wich needs refreshcontent
- the HTML content for replacementpublic java.util.HashMap<java.lang.String,LyWebObject> getReloadDivs()
public boolean needsUpdate()
needsUpdate
in class LyWebViewManager
public void setPopupMenu(LyPopupMenu popup, java.lang.String popupMenuDivId)
popup
- the new popup menupublic java.lang.Object getColor(LyColor color)
getColor
in interface LyViewManagerInterface
getColor
in class LyViewManager
color
- The leonardi color.
LyViewManagerInterface.getColor(leon.misc.LyColor)
public java.lang.Object getFont(LyFont font)
getFont
in interface LyViewManagerInterface
getFont
in class LyViewManager
font
- The leonardi font.
LyViewManagerInterface.getFont(leon.misc.LyFont)
public int getStringWidth(LyFont font, java.lang.String text)
getStringWidth
in interface LyViewManagerInterface
getStringWidth
in class LyViewManager
font
- The leonardi font.text
- The string value.
LyViewManagerInterface.getStringWidth(leon.misc.LyFont, java.lang.String)
public java.lang.Object getDefaultImage()
getDefaultImage
in interface LyViewManagerInterface
getDefaultImage
in class LyViewManager
LyImageUtils.getDefaultImage()
,
LyViewManagerInterface.getDefaultImage()
public int[] getSizes(java.lang.Object image)
getSizes
in interface LyViewManagerInterface
getSizes
in class LyViewManager
image
- the image
LyImageUtils.getSizes(Image)
,
LyViewManagerInterface.getSizes(Object)
public java.lang.Object getScaledInstance(java.lang.Object image, int width, int height)
getScaledInstance
in interface LyViewManagerInterface
getScaledInstance
in class LyViewManager
image
- The image to scale.width
- The width to which to scale the image.height
- The height to which to scale the image.
LyImageUtils.getScaledInstance(Image, int, int)
,
LyViewManagerInterface.getScaledInstance(Object, int, int)
public void waitForLoading(java.lang.Object component, java.lang.Object image) throws java.lang.InterruptedException
waitForLoading
in interface LyViewManagerInterface
waitForLoading
in class LyViewManager
component
- The image loading clientimage
- Image to load.
java.lang.InterruptedException
- if the wait is interruptuedLyImageUtils.waitForLoading(Component, Image)
,
LyViewManagerInterface.waitForLoading(Object, Object)
public java.lang.Object loadImageFromStream(java.lang.Object component, java.io.InputStream resource) throws java.io.IOException
loadImageFromStream
in interface LyViewManagerInterface
loadImageFromStream
in class LyViewManager
component
- The client of the image creation.resource
- stream inputStream to the image data
java.io.IOException
- if something is wrong during the processLyImageUtils.loadImageFromStream(Component, InputStream)
,
LyViewManagerInterface.loadImageFromStream(Object, InputStream)
public boolean isSameImage(java.lang.Object image1, java.lang.Object image2) throws java.lang.InterruptedException
isSameImage
in class LyViewManager
image1
- first image to compareimage2
- second image to compare
java.lang.InterruptedException
- exception if problems on grabber or loading.LyImageUtils.isSameImage(Image, Image)
,
LyViewManager.isSameImage(java.lang.Object, java.lang.Object)
public void freeImage(java.lang.Object image)
freeImage
in interface LyViewManagerInterface
freeImage
in class LyViewManager
image
- The image that must be freed.LyImageUtils.freeImage(Image)
,
LyViewManagerInterface.freeImage(java.lang.Object)
public void exit(int code)
exit
in interface LyViewManagerInterface
exit
in class LyWebViewManager
code
- exit code of the application.LyViewManagerInterface.exit(int)
public void copyToClipboard(java.lang.String text)
copyToClipboard
in class LyViewManager
text
- the text to be copied to the clipboard.public boolean areViewManagerCompatible(LyViewManager otherViewManager)
areViewManagerCompatible
in class LyViewManager
otherViewManager
- the other view manager
public boolean isPushModeActivated()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |