org.xwiki.gwt.user.client.ui
Class HiddenConfig

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.xwiki.gwt.user.client.ui.HiddenConfig
All Implemented Interfaces:
com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, Config

public class HiddenConfig
extends com.google.gwt.user.client.ui.Composite
implements Config

A group of Hidden widgets that can be used to send data to the server when the HTML form is submitted. An Hidden widget can serve two roles. It's either a flag or a parameter.
Flags are global with respect to the host page. Another HiddenConfig can have the same flag. As a consequence the request will have a parameter with the name of the flag. The value of this request parameter will be the list of nameSpace of HiddenConfig that had the flag set when the form was submitted.
Parameters are local with respect to a HiddenConfig. Their names are prefixed by the nameSpace. For each parameter set on a HiddenConfig there will be a request parameter with the same name and the same value.

Version:
$Id: HiddenConfig.java 24888 2009-11-06 02:16:19Z sdumitriu $

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
HiddenConfig()
          Creates a new group of Hidden widgets without specifying the nameSpace.
HiddenConfig(java.lang.String nameSpace)
          Creates a new group of Hidden widgets.
 
Method Summary
 void addFlag(java.lang.String flagName)
          Sets the specified flag.
 java.util.Set<java.lang.String> getFlagNames()
           
 java.lang.String getNameSpace()
           
 java.lang.String getParameter(java.lang.String paramName)
          Returns the value of the specified parameter, defaulting to null if the parameter doesn't exist.
 java.lang.String getParameter(java.lang.String paramName, java.lang.String defaultValue)
          Returns the value of the specified parameter, defaulting to the given value if the parameter doesn't exist.
 java.util.Set<java.lang.String> getParameterNames()
          
 java.lang.String getQualifiedName(java.lang.String paramName)
          The qualified form of a parameter's name is obtained by prefixing the name of the parameter with nameSpace.
 boolean hasFlag(java.lang.String flagName)
          Tests of the specified flag has been set.
 void removeFlag(java.lang.String flagName)
          Removes the specified flag.
 void removeParameter(java.lang.String paramName)
          Removes the specified parameter.
 void setNameSpace(java.lang.String nameSpace)
          Sets the name of this group of Hidden.
 java.lang.String setParameter(java.lang.String paramName, java.lang.String paramValue)
          Sets the value of the specified parameter.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HiddenConfig

public HiddenConfig()
Creates a new group of Hidden widgets without specifying the nameSpace.


HiddenConfig

public HiddenConfig(java.lang.String nameSpace)
Creates a new group of Hidden widgets.

Parameters:
nameSpace - The name of this group.
Method Detail

getParameter

public java.lang.String getParameter(java.lang.String paramName)
Returns the value of the specified parameter, defaulting to null if the parameter doesn't exist.

Specified by:
getParameter in interface Config
Parameters:
paramName - The name of the parameter.
Returns:
The value of the given parameter or null if there's no such parameter.
See Also:
Config.getParameter(String)

getParameter

public java.lang.String getParameter(java.lang.String paramName,
                                     java.lang.String defaultValue)
Returns the value of the specified parameter, defaulting to the given value if the parameter doesn't exist.

Specified by:
getParameter in interface Config
Parameters:
paramName - The name of the parameter.
defaultValue - The default value if the parameter doesn't exist.
Returns:
The value of the given parameter or the specified default value if there's no such parameter.
See Also:
Config.getParameter(String, String)

getParameterNames

public java.util.Set<java.lang.String> getParameterNames()

Specified by:
getParameterNames in interface Config
Returns:
The set of all the parameter names.
See Also:
Config.getParameterNames()

setParameter

public java.lang.String setParameter(java.lang.String paramName,
                                     java.lang.String paramValue)
Sets the value of the specified parameter. If the parameter doesn't exists it is added.

Parameters:
paramName - The name of the parameter.
paramValue - The value of the parameter.
Returns:
The previous value of the given parameter, or null if this parameter is new.

removeParameter

public void removeParameter(java.lang.String paramName)
Removes the specified parameter. It does nothing if the given parameter doesn't exist.

Parameters:
paramName - The name of the parameter to be removed.

addFlag

public void addFlag(java.lang.String flagName)
Sets the specified flag. If the flag doesn't exist then it is added.

Parameters:
flagName - The name of the flag to be set.

hasFlag

public boolean hasFlag(java.lang.String flagName)
Tests of the specified flag has been set.

Parameters:
flagName - The name of the flag to test.
Returns:
true if the given flag has been set.

removeFlag

public void removeFlag(java.lang.String flagName)
Removes the specified flag. It does nothing if the flag doesn't exist.

Parameters:
flagName - The name of the flag to be removed.

getFlagNames

public java.util.Set<java.lang.String> getFlagNames()
Returns:
The set of all flag names set on this object.

getQualifiedName

public java.lang.String getQualifiedName(java.lang.String paramName)
The qualified form of a parameter's name is obtained by prefixing the name of the parameter with nameSpace.

Parameters:
paramName - The name of a parameter.
Returns:
The qualified form of the given parameter name.

getNameSpace

public java.lang.String getNameSpace()
Returns:
The name of this group of Hidden.
See Also:
nameSpace

setNameSpace

public void setNameSpace(java.lang.String nameSpace)
Sets the name of this group of Hidden. As a consequence all flags and parameters are updated.

Parameters:
nameSpace - The new name for this object.


Copyright © 2004-2010 XWiki. All Rights Reserved.