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

java.lang.Object
  extended byorg.objectweb.jac.aspects.gui.web.AbstractView
      extended byorg.objectweb.jac.aspects.gui.web.AbstractPage
          extended byorg.objectweb.jac.aspects.gui.web.Dialog
All Implemented Interfaces:
DialogListener, DialogView, HTMLViewer, View, ViewIdentity, WindowListener, WindowView

public class Dialog
extends AbstractPage
implements DialogView, DialogListener

An HTML page containing a View, and an OK and a close Button


Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractPage
view
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
Dialog(ViewFactory factory, DisplayContext context, View view, Object parent, String title, String description)
           
 
Method Summary
 void genBody(PrintWriter out)
          Override this method to generate the body of an HTML page.
 void genHTML(PrintWriter out)
          Generate the HTML code for the editor.
 View getContentView()
          Returns the content view of the window
 JacRequest getRequest()
          Gets the current JacRequest of this dialog
 HttpServletResponse getResponse()
          Gets the current HttpServletResponse of this dialog
 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 restoreContext()
          Restore context attributes memorized at creation time
 boolean waitForClose()
          Waits until the dialog is closed or timeout iccurs.
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractPage
close
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
closeForm, equalsView, equalsView, eventURL, eventURL, 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, setContext, 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.View
close, getContext, getDescription, getFactory, getLabel, getMessage, getParentView, getRootView, getStyle, getViewBorder, isClosed, isDescendantOf, setContext, 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
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLViewer
setStyleSheet
 

Constructor Detail

Dialog

public Dialog(ViewFactory factory,
              DisplayContext context,
              View view,
              Object parent,
              String title,
              String description)
Parameters:
view - the view to embed in the dialog
parent - the parent window of the dialog
title - the title
description - description of the view
Method Detail

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

waitForClose

public boolean waitForClose()
                     throws TimeoutException
Description copied from interface: DialogView
Waits until the dialog is closed or timeout iccurs.

Specified by:
waitForClose in interface DialogView
Returns:
true if the dialog was validated with the OK button by the user, false otherwise
Throws:
TimeoutException

getContentView

public View getContentView()
Description copied from interface: WindowView
Returns the content view of the window

Specified by:
getContentView in interface WindowView
Overrides:
getContentView in class AbstractPage

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 AbstractPage
Throws:
IOException

genBody

public void genBody(PrintWriter out)
             throws IOException
Description copied from class: AbstractView
Override this method to generate the body of an HTML page.

Overrides:
genBody in class AbstractView
Throws:
IOException
See Also:
AbstractView.genPage(PrintWriter)

restoreContext

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

Specified by:
restoreContext in interface DialogView

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