|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.util.servlet.IlvPopupMenuServletSupport
public abstract class IlvPopupMenuServletSupport
This abstract class defines a servlet support used handle dynamic popup menu request requests.
Subclasses must override all getters.
| Field Summary | |
|---|---|
static String |
MENU_SESSION_KEY
The session key for the current menu handled by this servlet support. |
static String |
REQUEST_TYPE
The request type of a dynamic popup menu request. |
static String |
SERVLET_ACTION_NAME
The action name of the builtin action listener that is responsible for translating the servlet event into a suitable event for a menu item listener. |
| Constructor Summary | |
|---|---|
IlvPopupMenuServletSupport()
Creates a new IlvPopupMenuServletSupport instance. |
|
| Method Summary | |
|---|---|
protected IlvMenu |
createMenu(javax.servlet.http.HttpServletRequest request,
IlvMenuFactory factory,
Object graphicObject,
Object selectedObject,
String menuModelId)
Calls the menu factory to return the menu model. |
protected IlvMenu |
createMenu(IlvMenuFactory factory,
Object graphicObject,
Object selectedObject,
String menuModelId)
Deprecated. Beginning with ILOG JViews 8.0 use createMenu(HttpServletRequest, IlvMenuFactory, Object, Object, String) instead. |
protected abstract Object |
getGraphicComponent(javax.servlet.http.HttpServletRequest request)
Returns the graphic component displayed by the linked servlet. |
protected IlvPopupMenuEncoder |
getMenuEncoder(javax.servlet.http.HttpServletRequest request)
Returns the menu encoder responsible for encoding the root IlvMenu
into a code comprehensible for the client. |
protected IlvMenuFactory |
getMenuFactory(javax.servlet.http.HttpServletRequest request)
Returns the factory that will dynamically generate the menu depending on: The graphic component. |
protected abstract String |
getMenuModelId(javax.servlet.http.HttpServletRequest request)
Returns the menu model ID from the request. |
protected IlvMenu |
getPopupMenuFromSession(javax.servlet.http.HttpServletRequest request)
Retrieve menu model stored in the session with the MENU_SESSION_KEY key. |
protected abstract Object |
getSelectedObject(javax.servlet.http.HttpServletRequest request,
int x,
int y)
Returns the object selected by the user when he triggered the popup menu. |
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context. |
boolean |
handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Responds to HTTP requests. |
abstract void |
installListeners()
Installs the server action listeners to properly handle popup actions. |
protected void |
prepareComponent(javax.servlet.http.HttpServletRequest request,
Object graphicComponent)
Configures the graphic component to be in a correct state before the selected object is picked. |
abstract void |
removeListeners()
Removes the server action previously installed with installListeners. |
protected void |
savePopupMenuModelInSession(javax.servlet.http.HttpServletRequest request,
IlvMenu root)
Saves the generated menu in session using the MENU_SESSION_KEY key. |
void |
setMenuFactory(IlvMenuFactory menuFactory)
Sets the menu factory that will generate the popup menu. |
void |
setServletContext(javax.servlet.ServletContext context)
Sets the servlet context used by this support. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SERVLET_ACTION_NAME
public static final String REQUEST_TYPE
public static final String MENU_SESSION_KEY
| Constructor Detail |
|---|
public IlvPopupMenuServletSupport()
IlvPopupMenuServletSupport instance.
| Method Detail |
|---|
public abstract void installListeners()
public abstract void removeListeners()
installListeners.
public boolean handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException,
javax.servlet.ServletException
false
if the request is not a request recognized by this servlet.
If the request is correct generate in the output stream the
Javascript Code used by the client to display the popup menu.
request - the current Http request.response - the Http response.
true if the request was processed, false if an error occurred.
IOException
javax.servlet.ServletException
protected void prepareComponent(javax.servlet.http.HttpServletRequest request,
Object graphicComponent)
throws javax.servlet.ServletException
request - The http request.graphicComponent - The graphic component.
javax.servlet.ServletException - If an error occurs during configuration.
protected IlvMenu createMenu(javax.servlet.http.HttpServletRequest request,
IlvMenuFactory factory,
Object graphicObject,
Object selectedObject,
String menuModelId)
throws javax.servlet.ServletException
request - The http servlet request.factory - The menu factorygraphicObject - The graphic componentselectedObject - The selected objectmenuModelId - The menu model ID.
javax.servlet.ServletException
protected IlvMenu createMenu(IlvMenuFactory factory,
Object graphicObject,
Object selectedObject,
String menuModelId)
throws javax.servlet.ServletException
createMenu(HttpServletRequest, IlvMenuFactory, Object, Object, String) instead.
factory - The menu factorygraphicObject - The graphic componentselectedObject - The selected objectmenuModelId - The menu model ID.
javax.servlet.ServletException
protected void savePopupMenuModelInSession(javax.servlet.http.HttpServletRequest request,
IlvMenu root)
MENU_SESSION_KEY key.
request - The Http request.root - The root menu of the menu model.protected IlvMenu getPopupMenuFromSession(javax.servlet.http.HttpServletRequest request)
MENU_SESSION_KEY key.
request - The Http request.
protected abstract Object getGraphicComponent(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
request - The Http request.
javax.servlet.ServletException
protected abstract Object getSelectedObject(javax.servlet.http.HttpServletRequest request,
int x,
int y)
throws javax.servlet.ServletException
request - The Http requestx - x coordinate in image view coordinate system.y - y coordinate in image view coordinate system.
javax.servlet.ServletExceptiongetGraphicComponent(HttpServletRequest)
protected IlvMenuFactory getMenuFactory(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
setmenuFactory
method.
request - The Http request.
javax.servlet.ServletExceptionpublic void setMenuFactory(IlvMenuFactory menuFactory)
menuFactory - The menu factory.
protected abstract String getMenuModelId(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
request - The Http request.
javax.servlet.ServletException
protected IlvPopupMenuEncoder getMenuEncoder(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
IlvMenu
into a code comprehensible for the client.IlvPopupMenuEncoder instance.
request - The Http request.
javax.servlet.ServletExceptionpublic javax.servlet.ServletContext getServletContext()
public void setServletContext(javax.servlet.ServletContext context)
init() of the servlet.
context - The servlet context.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||