Author: jalkanen
Date: Sat May 31 11:07:50 2008
New Revision: 662056
URL: http://svn.apache.org/viewvc?rev=662056&view=rev
Log:
Javadoc fixes. Also removed some public fields from use which should not have
been public (I doubt anyone was using them anyway, as there were accessors as
well.)
Modified:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormClose.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormElement.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInfo.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInput.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOpen.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOutput.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSelect.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSet.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormTextarea.java
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormClose.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormClose.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormClose.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormClose.java Sat May
31 11:07:50 2008
@@ -37,6 +37,8 @@
/**
* Builds a Form close tag. Removes any information on the form from
* the WikiContext.
+ *
+ * [EMAIL PROTECTED]
*/
public String execute( WikiContext ctx, Map params )
throws PluginException
@@ -52,7 +54,7 @@
if( info.hide() )
{
ResourceBundle rb =
ctx.getBundle(WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE);
- return( "<p>" + rb.getString( "formclose.noneedtoshow" ) +
"</p>" );
+ return "<p>" + rb.getString( "formclose.noneedtoshow" ) +
"</p>";
}
}
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormElement.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormElement.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormElement.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormElement.java Sat
May 31 11:07:50 2008
@@ -45,7 +45,9 @@
*/
public static final String FORM_VALUES_CARRIER = "nbpf_values";
- // Show values:
+ /**
+ * Show values. Value is <tt>[EMAIL PROTECTED]</tt>.
+ */
public static final String HIDE_SUCCESS = "onsuccess";
// Parameter names:
@@ -83,6 +85,9 @@
/**
* Utility method stores a FormInfo object into the WikiContext.
+ *
+ * @param ctx The Context to store it in
+ * @param info The FormInfo to store.
*/
protected void storeFormInfo( WikiContext ctx, FormInfo info )
{
@@ -92,6 +97,9 @@
/**
* Attempts to retrieve information on the currently handled
* form from the WikiContext.
+ *
+ * @param ctx The Context
+ * @return The FormInfo from the context
*/
protected FormInfo getFormInfo( WikiContext ctx )
{
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInfo.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInfo.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInfo.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInfo.java Sat May
31 11:07:50 2008
@@ -35,90 +35,168 @@
{
private static final long serialVersionUID = 0L;
+ /** State: Form is executed. */
public static final int EXECUTED = 1;
+
+ /** State: Form is OK. */
public static final int OK = 0;
+
+ /** State: There was an error. */
public static final int ERROR = -1;
- public int m_status;
- public boolean m_hide;
- public String m_action;
- public String m_name;
- public String m_handler;
- public String m_result;
- public String m_error;
- //public PluginParameters submission;
- public Map m_submission;
+ private int m_status;
+ private boolean m_hide;
+ private String m_action;
+ private String m_name;
+ private String m_handler;
+ private String m_result;
+ private String m_error;
+ private Map<?, ?> m_submission;
+ /**
+ * Creates a new FormInfo with status == OK.
+ *
+ */
public FormInfo()
{
m_status = OK;
}
+ /**
+ * Set the status of the Form processing.
+ *
+ * @param val EXECUTED, OK or ERROR.
+ */
public void setStatus( int val )
{
m_status = val;
}
+ /**
+ * Return the status.
+ *
+ * @return The status.
+ */
public int getStatus()
{
return m_status;
}
+ /**
+ * Set the hide parameter.
+ *
+ * @param val True or false.
+ */
public void setHide( boolean val )
{
m_hide = val;
}
+ /**
+ * Returns true, if the form is supposed to be hidden.
+ *
+ * @return True or false.
+ */
public boolean hide()
{
return m_hide;
}
+ /**
+ * Set the value of the action parameter.
+ *
+ * @param val A value parameter.
+ */
public void setAction( String val )
{
m_action = val;
}
+ /**
+ * Get the action set in [EMAIL PROTECTED] #setAction(String)}.
+ *
+ * @return An Action.
+ */
public String getAction()
{
return m_action;
}
+ /**
+ * Sets the name of the form.
+ *
+ * @param val The name of the form.
+ */
public void setName( String val )
{
m_name = val;
}
+ /**
+ * Return the name of the form.
+ *
+ * @return The name of the form.
+ */
public String getName()
{
return m_name;
}
+ /**
+ * Set the name of the handler class.
+ *
+ * @param val The name of the class.
+ */
public void setHandler( String val )
{
m_handler = val;
}
+ /**
+ * Return the name of the handler class.
+ *
+ * @return The name of the class.
+ */
public String getHandler()
{
return m_handler;
}
+ /**
+ * Set the result.
+ *
+ * @param val The result.
+ */
public void setResult( String val )
{
m_result = val;
}
+ /**
+ * Return the result.
+ *
+ * @return The result.
+ */
public String getResult()
{
return m_result;
}
+ /**
+ * Set an error string.
+ *
+ * @param val An error string.
+ */
public void setError( String val )
{
m_error = val;
}
+ /**
+ * Return the error.
+ *
+ * @return The error.
+ */
public String getError()
{
return m_error;
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInput.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInput.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInput.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormInput.java Sat May
31 11:07:50 2008
@@ -34,11 +34,16 @@
public class FormInput
extends FormElement
{
+ /** Parameter name for setting the type. Value is <tt>[EMAIL
PROTECTED]</tt>. */
public static final String PARAM_TYPE = "type";
+
+ /** Parameter name for setting the size of the input field. Value is
<tt>[EMAIL PROTECTED]</tt>. */
public static final String PARAM_SIZE = "size";
/**
* Generates a dynamic form element on the WikiPage.
+ *
+ * [EMAIL PROTECTED]
*/
public String execute( WikiContext ctx, Map params )
throws PluginException
@@ -61,7 +66,7 @@
{
if( info.hide() )
{
- return( "<p>" + rb.getString( "forminput.noneedtoshow" ) +
"</p>" );
+ return "<p>" + rb.getString( "forminput.noneedtoshow" ) +
"</p>";
}
previousValues = info.getSubmission();
}
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOpen.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOpen.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOpen.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOpen.java Sat May
31 11:07:50 2008
@@ -71,9 +71,11 @@
private static org.apache.log4j.Logger log =
org.apache.log4j.Logger.getLogger( FormOpen.class );
+ /** Parameter name for setting the method (GET or POST). Value is
<tt>[EMAIL PROTECTED]</tt>. */
public static final String PARAM_METHOD = "method";
/**
+ * [EMAIL PROTECTED]
*/
public String execute( WikiContext ctx, Map params )
throws PluginException
@@ -115,7 +117,7 @@
info.getStatus() == FormInfo.EXECUTED )
{
info.setHide( true );
- return( "<p>" + rb.getString( "formopen.noneedtoshow" ) +
"</p>" );
+ return "<p>" + rb.getString( "formopen.noneedtoshow" ) +
"</p>";
}
}
else
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOutput.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOutput.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOutput.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormOutput.java Sat May
31 11:07:50 2008
@@ -49,6 +49,11 @@
* <p>
* Should there be no HTTP request associated with this request,
* the method will return immediately with an empty string.
+ *
+ * @param ctx [EMAIL PROTECTED]
+ * @param params [EMAIL PROTECTED]
+ * @return [EMAIL PROTECTED]
+ * @throws [EMAIL PROTECTED]
*/
public String execute( WikiContext ctx, Map params )
throws PluginException
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSelect.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSelect.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSelect.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSelect.java Sat May
31 11:07:50 2008
@@ -31,11 +31,16 @@
import org.apache.ecs.xhtml.select;
/**
+ * Creates a Form select field.
+ *
* @author ebu
*/
public class FormSelect
extends FormElement
{
+ /**
+ * [EMAIL PROTECTED]
+ */
public String execute( WikiContext ctx, Map params )
throws PluginException
{
@@ -146,7 +151,7 @@
int indicated = -1;
options[i] = options[i].trim();
- if( options[i].startsWith( optionSelector ) )
+ if( optionSelector != null && options[i].startsWith(
optionSelector ) )
{
options[i] = options[i].substring( optionSelector.length() );
indicated = i;
@@ -171,6 +176,6 @@
if( previouslySelected > -1 )
optionElements[previouslySelected].setSelected(true);
select field = new select( HANDLERPARAM_PREFIX + inputName,
optionElements );
- return( field );
+ return field;
}
}
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSet.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSet.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSet.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormSet.java Sat May 31
11:07:50 2008
@@ -59,6 +59,9 @@
public class FormSet
implements WikiPlugin
{
+ /**
+ * [EMAIL PROTECTED]
+ */
public String execute( WikiContext ctx, Map params )
throws PluginException
{
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormTextarea.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormTextarea.java?rev=662056&r1=662055&r2=662056&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormTextarea.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/forms/FormTextarea.java Sat
May 31 11:07:50 2008
@@ -30,14 +30,24 @@
import org.apache.ecs.xhtml.textarea;
/**
+ * Creates a Form text area element. You may specify the size of the
textarea
+ * by using the [EMAIL PROTECTED] #PARAM_COLS} and [EMAIL PROTECTED]
#PARAM_ROWS} to signify the width
+ * and height of the area.
+ *
* @author ebu
*/
public class FormTextarea
extends FormElement
{
+ /** Parameter name for setting the rows value. Value is <tt>[EMAIL
PROTECTED]</tt>. */
public static final String PARAM_ROWS = "rows";
+
+ /** Parameter name for setting the columns value. Value is <tt>[EMAIL
PROTECTED]</tt>. */
public static final String PARAM_COLS = "cols";
+ /**
+ * [EMAIL PROTECTED]
+ */
public String execute( WikiContext ctx, Map params )
throws PluginException
{