Author: knopp
Date: Thu Apr 23 09:04:22 2009
New Revision: 767864
URL: http://svn.apache.org/viewvc?rev=767864&view=rev
Log:
javadoc
Modified:
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
Modified:
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java?rev=767864&r1=767863&r2=767864&view=diff
==============================================================================
---
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
(original)
+++
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
Thu Apr 23 09:04:22 2009
@@ -60,19 +60,19 @@
* <code>{...@link #setPageCreator(ModalWindow.PageCreator)}</code> method.
* </ul>
* In case the content is a component, it is not rendered until the window is
shown (method
- * <code>{...@link #show(AjaxRequestTarget)})</code>. In case the content is
another page, you can
- * set the desired pagemap name using <code>{...@link
#setPageMapName(String)}</code>. Setting
- * pagemap is only needed when wicket multiwindow support is on.
+ * <code>{...@link #show(AjaxRequestTarget)})</code>. In case the content is
another page, you can set
+ * the desired pagemap name using <code>{...@link
#setPageMapName(String)}</code>. Setting pagemap is
+ * only needed when wicket multiwindow support is on.
* <p>
* The window can be made visible from an ajax handler using
* <code>{...@link #show(AjaxRequestTarget)}</code>.
* <p>
* To close the window there are multiple options. Static method
- * <code>{...@link #close(AjaxRequestTarget)}</code> can be used to close the
window from a handler
- * of ajax link inside the window. By default the close button in the upper
right corner of the
- * window closes it. This behavior can be altered using
- * <code>{...@link
#setCloseButtonCallback(ModalWindow.CloseButtonCallback)}</code>. If you want to
- * be notified when the window is closed (either using the close button or
calling
+ * <code>{...@link #close(AjaxRequestTarget)}</code> can be used to close the
window from a handler of
+ * ajax link inside the window. By default the close button in the upper right
corner of the window
+ * closes it. This behavior can be altered using
+ * <code>{...@link
#setCloseButtonCallback(ModalWindow.CloseButtonCallback)}</code>. If you want
to be
+ * notified when the window is closed (either using the close button or calling
* <code>{...@link #close(AjaxRequestTarget)})</code>, you can use
* <code>{...@link
#setWindowClosedCallback(ModalWindow.WindowClosedCallback)}</code>.
* <p>
@@ -88,26 +88,31 @@
* <li><code>{...@link #setInitialWidth(int)}</code> and <code>{...@link
#setInitialHeight(int)}</code>
* specify the initial width and height of window. If the window is resizable,
the unit of these
* dimensions is always "px". If the window is not resizable, the unit can be
specified using
- * <code>{...@link #setWidthUnit(String)}</code> and <code>{...@link
#setHeightUnit(String)}</code>.
- * If the window is not resizable and the content is a component (not a page),
the initial height
- * value can be ignored and the actual height can be determined from the
height of the content. To
- * enable this behavior use <code>{...@link
#setUseInitialHeight(boolean)}</code>.
+ * <code>{...@link #setWidthUnit(String)}</code> and <code>{...@link
#setHeightUnit(String)}</code>. If
+ * the window is not resizable and the content is a component (not a page),
the initial height value
+ * can be ignored and the actual height can be determined from the height of
the content. To enable
+ * this behavior use <code>{...@link #setUseInitialHeight(boolean)}</code>.
* <li>The window position (and size if the window is resizable) can be stored
in a cookie, so that
* it is preserved when window is close. The name of the cookie is specified
via
- * <code>{...@link #setCookieName(String)}</code>. If the name is
<code>null</code>, position is
- * not stored (initial width and height are always used). Default cookie name
is null (position is
- * not stored).
+ * <code>{...@link #setCookieName(String)}</code>. If the name is
<code>null</code>, position is not
+ * stored (initial width and height are always used). Default cookie name is
null (position is not
+ * stored).
* <li><code>{...@link #setMinimalWidth(int)}</code> and <code>{...@link
#setMinimalHeight(int)}</code>
* set the minimal dimensions of resizable window.
* <li>Modal window can chose between two colors of frame.
* <code>{...@link #setCssClassName(String)}</code> sets the dialog css class,
possible values are
- * <code>{...@link #CSS_CLASS_BLUE}</code> for blue frame and <code>{...@link
#CSS_CLASS_GRAY}</code>
- * for gray frame.
+ * <code>{...@link #CSS_CLASS_BLUE}</code> for blue frame and <code>{...@link
#CSS_CLASS_GRAY}</code> for
+ * gray frame.
* <li>Mask (element that prevents user from interacting the rest of the page)
can be either
* transparent or semitransparent. <code>{...@link
#setMaskType(ModalWindow.MaskType)}</code> alters
* this.
* </ul>
- *
+ * Also it is recommended to put the modal window component in markup before
any component (i.e.
+ * AjaxLink or AjaxButton) that shows it.
+ * <p>
+ * If you want to use form in modal window component make sure that you put
the modal window itself
+ * in another form (nesting forms is legal in Wicket).
+ *
* @see IPageSettings#setAutomaticMultiWindowSupport(boolean)
* @author Matej Knopp
*/
@@ -123,7 +128,7 @@
/**
* Creates a new modal window component.
- *
+ *
* @param id
* Id of component
*/
@@ -142,17 +147,17 @@
/**
* Interface for lazy page creation. The advantage of creating page
using this interface over
- * just passing a page instance is that page created in <code>{...@link
#createPage()}</code>
- * will have the pagemap automatically set to the pagemap specified for
+ * just passing a page instance is that page created in <code>{...@link
#createPage()}</code> will
+ * have the pagemap automatically set to the pagemap specified for
* <code>{...@link ModalWindow}</code>.
- *
+ *
* @author Matej Knopp
*/
public static interface PageCreator extends IClusterable
{
/**
* Creates a new instance of content page.
- *
+ *
* @return new page instance
*/
public Page createPage();
@@ -163,7 +168,7 @@
* clicked. If no callback instance is specified using
* <code>{...@link
#setCloseButtonCallback(ModalWindow.CloseButtonCallback)}</code>, no ajax
* request will be fired. Clicking the button will just close the
window.
- *
+ *
* @author Matej Knopp
*/
public static interface CloseButtonCallback extends IClusterable
@@ -171,10 +176,10 @@
/**
* Methods invoked after the button has been clicked. The
invocation is done using an ajax
* call, so <code>{...@link AjaxRequestTarget}</code> instance
is available.
- *
+ *
* @param target
* <code>{...@link AjaxRequestTarget}</code>
instance bound with the ajax request.
- *
+ *
* @return True if the window can be closed (will close the
window), false otherwise
*/
public boolean onCloseButtonClicked(AjaxRequestTarget target);
@@ -184,14 +189,14 @@
* Callback called after the window has been closed. If no callback
instance is specified using
* {...@link
ModalWindow#setWindowClosedCallback(ModalWindow.WindowClosedCallback)}, no ajax
* request will be fired.
- *
+ *
* @author Matej Knopp
*/
public static interface WindowClosedCallback extends IClusterable
{
/**
* Called after the window has been closed.
- *
+ *
* @param target
* <code>{...@link AjaxRequestTarget}</code>
instance bound with the ajax request.
*/
@@ -201,7 +206,7 @@
/**
* Is this window currently showing.
- *
+ *
* @return the shown
*/
public boolean isShown()
@@ -212,7 +217,7 @@
/**
* Sets the name of the page ma for the content page. This makes only
sense when the content is
* a page, not a component and if wicket multiwindow support is turned
on.
- *
+ *
* @param pageMapName
* Name of the page map
*/
@@ -223,7 +228,7 @@
/**
* Returns the page map name.
- *
+ *
* @return The page map name.
*/
public String getPageMapName()
@@ -232,9 +237,9 @@
}
/**
- * Sets the <code>{...@link PageCreator}</code> instance. The instance
is only used when no
- * custom component has been added to the dialog.
- *
+ * Sets the <code>{...@link PageCreator}</code> instance. The instance
is only used when no custom
+ * component has been added to the dialog.
+ *
* @param creator
* <code>{...@link PageCreator}</code> instance
*/
@@ -246,7 +251,7 @@
/**
* Sets the <code>{...@link CloseButtonCallback}</code> instance.
- *
+ *
* @param callback
* Callback instance
*/
@@ -257,7 +262,7 @@
/**
* Sets the <code>@{link {...@link WindowClosedCallback}</code>
instance.
- *
+ *
* @param callback
* Callback instance
*/
@@ -268,7 +273,7 @@
/**
* Shows the modal window.
- *
+ *
* @param target
* Request target associated with current ajax request.
*/
@@ -287,7 +292,7 @@
* Hides the modal window. This can be called from within the modal
window, however, the modal
* window must have configured WindowClosedCallback. Otherwise use the
* {...@link #close(AjaxRequestTarget)} method.
- *
+ *
* @param target
* Request target associated with current ajax request.
*/
@@ -298,7 +303,7 @@
/**
* Closes the modal window.
- *
+ *
* @param target
* Request target associated with current ajax request.
*/
@@ -334,12 +339,12 @@
/**
* Returns the id of content component.
- *
+ *
* <pre>
* ModalWindow window = new ModalWindow(parent, "window");
* new MyPanel(window, window.getContentId());
* </pre>
- *
+ *
* @return Id of content component.
*/
public String getContentId()
@@ -350,7 +355,7 @@
/**
* Sets the minimal width of window. This value is only used if the
window is resizable. The
* width is specified in pixels and it is the width of entire window
(including frame).
- *
+ *
* @param minimalWidth
* Minimal window width.
*/
@@ -361,7 +366,7 @@
/**
* Returns the minimal width of window (in pixels).
- *
+ *
* @return Minimal width of window
*/
public int getMinimalWidth()
@@ -372,7 +377,7 @@
/**
* Sets the minimal height of window. This value is only used if window
is resizable. The height
* is specified in pixels and it is the height of window content
(without frame).
- *
+ *
* @param minimalHeight
* Minimal height
*/
@@ -383,7 +388,7 @@
/**
* Returns the minimal height of window (in pixels).
- *
+ *
* @return Minimal height of window
*/
public int getMinimalHeight()
@@ -405,7 +410,7 @@
* Sets the CSS class name for this window. This class affects the look
of window frame.
* Possible values (if you don't make your style sheet) are
<code>{...@link #CSS_CLASS_BLUE}</code>
* and <code>{...@link #CSS_CLASS_GRAY}</code>.
- *
+ *
* @param cssClassName
*/
public void setCssClassName(String cssClassName)
@@ -415,7 +420,7 @@
/**
* Returns the CSS class name for this window.
- *
+ *
* @return CSS class name
*/
public String getCssClassName()
@@ -429,7 +434,7 @@
* is not resizable, the unit can be specified using {...@link
#setWidthUnit(String)}. If cookie
* name is set and window is resizable, the initial width may be
ignored in favor of width
* stored in cookie.
- *
+ *
* @param initialWidth
* Initial width of the window
*/
@@ -440,7 +445,7 @@
/**
* Returns the initial width of the window.
- *
+ *
* @return Initial height of the window
*/
public int getInitialWidth()
@@ -451,10 +456,10 @@
/**
* Sets the initial height of the window. The height refers to the
height of window content
* (without frame). If the window is resizable, the height unit is
always "px". If the window is
- * not resizable, the unit can be specified using {...@link
#setHeightUnit(String)}. If cookie
- * name is set and window is resizable, the initial height may be
ignored in favor of height
- * stored in cookie.
- *
+ * not resizable, the unit can be specified using {...@link
#setHeightUnit(String)}. If cookie name
+ * is set and window is resizable, the initial height may be ignored in
favor of height stored
+ * in cookie.
+ *
* @param initialHeight
* Initial height of the window
*/
@@ -465,7 +470,7 @@
/**
* Returns the initial height of the window.
- *
+ *
* @return Initial height of the window
*/
public int getInitialHeight()
@@ -476,7 +481,7 @@
/**
* Sets whether to use initial height or preserve the real content
height. This can only be used
* if the content is a component (not a page) and the window is not
resizable.
- *
+ *
* @param useInitialHeight
* Whether to use initial height instead of preserving
content height instead of
* using initial height
@@ -489,7 +494,7 @@
/**
* Returns true if the initial height should be used (in favor of
preserving real content
* height).
- *
+ *
* @return True if initial height should be used, false is real content
height should be
* preserved (valid only if the window is not resizable and the
content is a component
* (not a page)
@@ -501,7 +506,7 @@
/**
* Sets whether the user will be able to resize the window.
- *
+ *
* @param resizable
* Whether the window is resizable
*/
@@ -512,7 +517,7 @@
/**
* Returns whether the window is resizable.
- *
+ *
* @return True if the window is resizable, false otherwise
*/
public boolean isResizable()
@@ -523,7 +528,7 @@
/**
* Sets the CSS unit used for initial window width. This is only
applicable when the window is
* not resizable.
- *
+ *
* @param widthUnit
* CSS unit for initial window width.
*/
@@ -534,7 +539,7 @@
/**
* Returns the CSS unit for initial window width.
- *
+ *
* @return CSS unit for initial window width.
*/
public String getWidthUnit()
@@ -545,7 +550,7 @@
/**
* Sets the CSS unit used for initial window height. This is only
applicable when the window is
* not resizable.
- *
+ *
* @param heightUnit
* CSS unit for initial window height.
*/
@@ -556,7 +561,7 @@
/**
* Retrns the CSS unit for initial window height.
- *
+ *
* @return CSS unit for initial window height.
*/
public String getHeightUnit()
@@ -567,7 +572,7 @@
/**
* Sets the name of the cookie that is used to remember window position
(and size if the window
* is resizable).
- *
+ *
* @param cookieName
* Name of the cookie
*/
@@ -583,7 +588,7 @@
/**
* Returns the name of cookie that is used to remember window position
(and size if the window
* is resizable).
- *
+ *
* @return Name of the cookie
*/
public String getCookieName()
@@ -594,7 +599,7 @@
/**
* Sets the title of window. If the window is a page, title can be
<code>null</code>. In that
* case it will display the title document inside the window.
- *
+ *
* @param title
* Title of the window
*/
@@ -606,7 +611,7 @@
/**
* Sets the title of window. If the window is a page, title can be
<code>null</code>. In that
* case it will display the title document inside the window.
- *
+ *
* @param title
* Title of the window
*/
@@ -618,7 +623,7 @@
/**
* Returns the title of the window.
- *
+ *
* @return Title of the window
*/
public IModel getTitle()
@@ -633,7 +638,7 @@
* <li><code>{...@link #TRANSPARENT}</code> - the mask is invisible
* <li><code>{...@link #SEMI_TRANSPARENT}</code> - the mask is black
with small opacity (10%)
* </ul>
- *
+ *
* @author Matej Knopp
*/
public static final class MaskType extends EnumeratedType
@@ -653,7 +658,7 @@
/**
* Constructor.
- *
+ *
* @param name
*/
public MaskType(String name)
@@ -664,7 +669,7 @@
/**
* Sets the mask type of the window.
- *
+ *
* @param mask
* The mask type
*/
@@ -675,7 +680,7 @@
/**
* Returns the mask type of the window
- *
+ *
* @return The mask type
*/
public MaskType getMaskType()
@@ -685,7 +690,7 @@
/**
* Creates the page.
- *
+ *
* @return Page instance or null if page couldn't be created.
*/
private Page createPage()
@@ -753,7 +758,7 @@
/**
* Returns a content component. In case user haven't specified any
content component, it returns
* an empty WebMarkupContainer.
- *
+ *
* @return Content component
*/
private Component getContent()
@@ -763,7 +768,7 @@
/**
* Returns true if user has added own component to the window.
- *
+ *
* @return True if user has added own component to the window, false
otherwise.
*/
private boolean isCustomComponent()
@@ -785,7 +790,7 @@
/**
* Sets the content of the modal window.
- *
+ *
* @param component
*/
public void setContent(Component component)
@@ -874,7 +879,7 @@
/**
* Returns the markup id of the component.
- *
+ *
* @return component id
*/
private String getContentMarkupId()
@@ -884,10 +889,10 @@
/**
* Replaces all occurrences of " in string with \".
- *
+ *
* @param string
* String to be escaped.
- *
+ *
* @return escaped string
*/
private String escapeQuotes(String string)
@@ -901,7 +906,7 @@
/**
* Returns the javascript used to open the window.
- *
+ *
* @return javascript that opens the window
*/
private String getWindowOpenJavascript()
@@ -1010,7 +1015,7 @@
/**
* Method that allows tweaking the settings
- *
+ *
* @param settings
* @return settings javascript
*/