org.objectweb.jac.aspects.gui.web
Class EditorContainer

java.lang.Object
  |
  +--org.objectweb.jac.aspects.gui.web.AbstractView
        |
        +--org.objectweb.jac.aspects.gui.web.AbstractCompositeView
              |
              +--org.objectweb.jac.aspects.gui.web.Container
                    |
                    +--org.objectweb.jac.aspects.gui.web.EditorContainer
All Implemented Interfaces:
CompositeView, DialogListener, EditorContainer, HTMLViewer, View, ViewIdentity, WindowListener

public class EditorContainer
extends Container
implements EditorContainer, DialogListener


Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, description, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
EditorContainer(boolean showButtons)
           
 
Method Summary
 void addEditor(Object editor)
          Add an editor to the container.
 void genHTML(PrintWriter out)
          Generate the HTML code for the editor.
 List getEditors()
          Get the list of all editors of this container.
 JacRequest getRequest()
          Gets the current JacRequest of this dialog
 HttpServletResponse getResponse()
          Gets the current HttpServletResponse of this dialog
 boolean hasEnabledEditor()
          Returns true if at least one editor is enabled.
 void onCancel()
          Called when the Cancel button was pressed by the user.
 void onOK(JacRequest request)
          Called when the OK button was pressed by the user.
 void onRefresh(JacRequest request)
          Called when the Refresh button was pressed by the user.
 void onValidate(JacRequest request)
          Validates inputs, but creates no HTML.
 void removeEditor(Object editor)
          Remove an editor from the container.
 void restoreContext()
          Restore context attributes stored at creation time
 void setShowButtons(boolean value)
          Sets the showButtons property of the container.
 boolean showButtons()
          Gets the value of showButtons
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.Container
genItemsHTML
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractCompositeView
add, addHorizontalStrut, addVerticalStrut, addView, addView, close, closeAllViews, containsView, genDescription, genMessage, getView, getViews, removeAllViews, removeView, setContext
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
closeForm, equalsView, equalsView, eventURL, eventURL, genBody, genEventAndActionButton, genPage, genStyleSheets, getBaseURL, getCloseBorder, getContext, getDescription, getFactory, getId, getId, getLabel, getMessage, getOpenBorder, getParameters, getParentView, getRootView, getStyle, getType, getViewBorder, iconElement, iconElement, isClosed, isDescendantOf, isInForm, openForm, printAttributes, setAttribute, setColumn, setDescription, setFactory, setFocus, setLabel, setMessage, setParameters, setParentView, setRow, setSize, setStyle, setStyleSheet, setTable, setType, setViewBorder, showButton, showFormButtons, showFormButtons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLViewer
setStyleSheet
 
Methods inherited from interface org.objectweb.jac.aspects.gui.View
getContext, getDescription, getFactory, getLabel, getMessage, getParentView, getRootView, getStyle, getViewBorder, isClosed, isDescendantOf, setDescription, setFactory, setFocus, setLabel, setMessage, setParentView, setSize, setStyle, setViewBorder
 
Methods inherited from interface org.objectweb.jac.aspects.gui.ViewIdentity
equalsView, equalsView, getParameters, getType, setParameters, setType
 

Constructor Detail

EditorContainer

public EditorContainer(boolean showButtons)
Parameters:
showButtons - wether to show an OK and a Cancel button
Method Detail

addEditor

public void addEditor(Object editor)
Description copied from interface: EditorContainer
Add an editor to the container.

Specified by:
addEditor in interface EditorContainer

removeEditor

public void removeEditor(Object editor)
Description copied from interface: EditorContainer
Remove an editor from the container.

Specified by:
removeEditor in interface EditorContainer

getEditors

public List getEditors()
Description copied from interface: EditorContainer
Get the list of all editors of this container.

Specified by:
getEditors in interface EditorContainer

hasEnabledEditor

public boolean hasEnabledEditor()
Description copied from interface: EditorContainer
Returns true if at least one editor is enabled.

Specified by:
hasEnabledEditor in interface EditorContainer

setShowButtons

public void setShowButtons(boolean value)
Description copied from interface: EditorContainer
Sets the showButtons property of the container. If true, it will offer a validation mechanism (typically, some OK/Cancel buttons).

Specified by:
setShowButtons in interface EditorContainer

showButtons

public boolean showButtons()
Description copied from interface: EditorContainer
Gets the value of showButtons

Specified by:
showButtons in interface EditorContainer
See Also:
EditorContainer.setShowButtons(boolean)

genHTML

public void genHTML(PrintWriter out)
             throws IOException
Description copied from interface: HTMLViewer
Generate the HTML code for the editor.

Specified by:
genHTML in interface HTMLViewer
Overrides:
genHTML in class Container
Parameters:
out - the writer where to write the HTML code.
IOException

onOK

public void onOK(JacRequest request)
Description copied from interface: WindowListener
Called when the OK button was pressed by the user. Validates editors and closes the window.

Specified by:
onOK in interface WindowListener
Parameters:
request - the servlet request

onRefresh

public void onRefresh(JacRequest request)
Description copied from interface: WindowListener
Called when the Refresh button was pressed by the user. Validates editors and but does not close the window.

Specified by:
onRefresh in interface WindowListener
Parameters:
request - the servlet request

onValidate

public void onValidate(JacRequest request)
Description copied from interface: WindowListener
Validates inputs, but creates no HTML.

Specified by:
onValidate in interface WindowListener

onCancel

public void onCancel()
Description copied from interface: WindowListener
Called when the Cancel button was pressed by the user. Closes the dialog without validating editors.

Specified by:
onCancel in interface WindowListener

restoreContext

public void restoreContext()
Description copied from interface: DialogListener
Restore context attributes stored at creation time

Specified by:
restoreContext in interface DialogListener

getResponse

public HttpServletResponse getResponse()
Description copied from interface: DialogListener
Gets the current HttpServletResponse of this dialog

Specified by:
getResponse in interface DialogListener

getRequest

public JacRequest getRequest()
Description copied from interface: DialogListener
Gets the current JacRequest of this dialog

Specified by:
getRequest in interface DialogListener