public abstract class IlvPopupMenuServletSupport extends Object
Subclasses must override all getters.
| Modifier and Type | Field and Description |
|---|---|
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 pop-up 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 and Description |
|---|
IlvPopupMenuServletSupport()
Creates a new
IlvPopupMenuServletSupport instance. |
| Modifier and Type | Method and Description |
|---|---|
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 Rogue Wave 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 dynamically generates 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 pop-up 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 pop-up 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 generates the pop-up menu.
|
void |
setServletContext(javax.servlet.ServletContext context)
Sets the servlet context used by this support.
|
public static final String SERVLET_ACTION_NAME
public static final String REQUEST_TYPE
public static final String MENU_SESSION_KEY
public IlvPopupMenuServletSupport()
IlvPopupMenuServletSupport instance.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 pop-up menu.request - the current Http request.response - the Http response.true if the request was processed, false if an error occurred.IOExceptionjavax.servlet.ServletExceptionprotected 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 factory.graphicObject - The graphic component.selectedObject - The selected object.menuModelId - The menu model ID.javax.servlet.ServletException@Deprecated 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.ServletExceptionprotected 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.ServletExceptionprotected abstract Object getSelectedObject(javax.servlet.http.HttpServletRequest request, int x, int y) throws javax.servlet.ServletException
request - The HTTP request.x - 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.ServletExceptionprotected 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.© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.