org.exoplatform.forum.common.webui
Class BaseUIForm

java.lang.Object
  extended by org.exoplatform.webui.core.UIComponent
      extended by org.exoplatform.webui.core.UIContainer
          extended by org.exoplatform.webui.form.UIForm
              extended by org.exoplatform.forum.common.webui.BaseUIForm

public class BaseUIForm
extends org.exoplatform.webui.form.UIForm

Base UIForm class that brings several convenience methods for UI operations ( i18n, messages, popups,...)

Version:
$Revision$
Author:
Patrice Lamarque

Nested Class Summary
 
Nested classes/interfaces inherited from class org.exoplatform.webui.core.UIContainer
org.exoplatform.webui.core.UIContainer.SelectTabActionListener
 
Field Summary
protected  org.exoplatform.services.log.Log log
           
 
Fields inherited from class org.exoplatform.webui.form.UIForm
ACTION, SUBCOMPONENT_ID
 
Fields inherited from class org.exoplatform.webui.core.UIComponent
AJAX_ASYNC, config, OBJECTID, UICOMPONENT, uiparent
 
Constructor Summary
BaseUIForm()
           
 
Method Summary
protected  void cancelChildPopupAction()
           
 String getLabel(String labelID)
          Get a label for this form.
 UIFormScrollSelectBox getUIFormScrollSelectBox(String name)
           
 UIForumFilter getUIForumFilter(String name)
           
 String i18n(String key)
          Get a value from the app resource bundle.
protected  void info(String messageKey)
          Sends a info message to ui and ignore ajax update on Portlets
protected  void info(String messageKey, boolean ignoreAJAXUpdateOnPortlets)
          Sends an info message to ui
protected  void info(String messageKey, String arg)
           
protected  void info(String messageKey, String[] args)
           
protected  void info(String messageKey, String[] args, boolean ignoreAJAXUpdateOnPortlets)
          Sends a ninfo message to ui
protected
<T extends org.exoplatform.webui.core.UIComponent>
T
openPopup(org.exoplatform.webui.core.UIContainer parent, Class<T> componentType, int width, int height)
           
protected
<T extends org.exoplatform.webui.core.UIComponent>
T
openPopup(org.exoplatform.webui.core.UIContainer parent, Class<T> componentType, String popupId, int width, int height)
          Opens a popup and creates a component into it.
protected  void throwWarning(String message)
           
protected  void throwWarning(String message, String... args)
          Throws a MessageException in warning level
protected  void warning(String messageKey)
          Sends a warning message to ui and ignore ajax update on Portlets
protected  void warning(String messageKey, boolean ignoreAJAXUpdateOnPortlets)
          Sends a warning message to ui
protected  void warning(String messageKey, String arg)
           
protected  void warning(String messageKey, String[] args)
           
protected  void warning(String messageKey, String[] args, boolean ignoreAJAXUpdateOnPortlets)
          Sends a parameterized warning to ui
 
Methods inherited from class org.exoplatform.webui.form.UIForm
addUIComponentInput, addUIFormInput, addUIFormInput, begin, end, event, event, event, getActions, getLabel, getSubmitAction, getUICheckBoxInput, getUIComponentName, getUIFormCheckBoxInput, getUIFormDateTimeInput, getUIFormInputInfo, getUIFormSelectBox, getUIFormTextAreaInput, getUIInput, getUIStringInput, invokeGetBindingBean, invokeSetBindingBean, isMultipart, processRender, renderField, renderField, reset, setActions, setMultiPart, setSubmitAction, url
 
Methods inherited from class org.exoplatform.webui.core.UIContainer
addChild, addChild, findComponentById, findComponentOfType, findFirstComponentOfType, getChild, getChild, getChildById, getChildren, hasChildren, removeChild, removeChildById, renderChild, renderChild, renderChild, renderChild, renderChildren, renderChildren, renderUIComponent, replaceChild, replaceChild, setChildren, setRenderedChild, setRenderedChild, setRenderedChildrenOfTypes
 
Methods inherited from class org.exoplatform.webui.core.UIComponent
broadcast, createEvent, createUIComponent, createUIComponent, createUIComponent, doAsync, event, getAncestorOfType, getApplicationComponent, getComponentConfig, getId, getName, getParent, getTemplate, getTemplateResourceResolver, isRendered, loadConfirmMesssage, processAction, processDecode, renderEventURL, setComponentConfig, setComponentConfig, setId, setParent, setRendered, setRenderSibling, url, url
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.exoplatform.services.log.Log log
Constructor Detail

BaseUIForm

public BaseUIForm()
Method Detail

i18n

public String i18n(String key)
Get a value from the app resource bundle.

Returns:
the value for the current locale or the key of the application resource bundle if the key was not found

getLabel

public String getLabel(String labelID)
Get a label for this form. Delegates to the getLabel() method but avoid throwing a method

Overrides:
getLabel in class org.exoplatform.webui.form.UIForm
Parameters:
labelID -
Returns:
the value for the current locale in the app resource bundle, labelID otherwise

getUIFormScrollSelectBox

public UIFormScrollSelectBox getUIFormScrollSelectBox(String name)

getUIForumFilter

public UIForumFilter getUIForumFilter(String name)

info

protected void info(String messageKey)
Sends a info message to ui and ignore ajax update on Portlets

Parameters:
messageKey - resource bundle key for the message

info

protected void info(String messageKey,
                    String arg)

info

protected void info(String messageKey,
                    String[] args)

info

protected void info(String messageKey,
                    boolean ignoreAJAXUpdateOnPortlets)
Sends an info message to ui

Parameters:
messageKey - resource bundle key for the message
ignoreAJAXUpdateOnPortlets - as there is need to update only UI components of portal (ie: the components outside portlet windows) are updated by AJAX.

info

protected void info(String messageKey,
                    String[] args,
                    boolean ignoreAJAXUpdateOnPortlets)
Sends a ninfo message to ui

Parameters:
messageKey - resource bundle key for the message
args - arguments of the message
ignoreAJAXUpdateOnPortlets - as there is need to update only UI components of portal (ie: the components outside portlet windows) are updated by AJAX.

warning

protected void warning(String messageKey)
Sends a warning message to ui and ignore ajax update on Portlets

Parameters:
messageKey - resource bundle key for the message

warning

protected void warning(String messageKey,
                       String arg)

warning

protected void warning(String messageKey,
                       String[] args)

warning

protected void warning(String messageKey,
                       boolean ignoreAJAXUpdateOnPortlets)
Sends a warning message to ui

Parameters:
messageKey - resource bundle key for the message
ignoreAJAXUpdateOnPortlets - as there is need to update only UI components of portal (ie: the components outside portlet windows) are updated by AJAX.

warning

protected void warning(String messageKey,
                       String[] args,
                       boolean ignoreAJAXUpdateOnPortlets)
Sends a parameterized warning to ui

Parameters:
messageKey -
args - arguments of the message
ignoreAJAXUpdateOnPortlets - as there is need to update only UI components of portal (ie: the components outside portlet windows) are updated by AJAX.

throwWarning

protected void throwWarning(String message,
                            String... args)
                     throws org.exoplatform.webui.exception.MessageException
Throws a MessageException in warning level

Parameters:
message -
args -
Throws:
org.exoplatform.webui.exception.MessageException

throwWarning

protected void throwWarning(String message)
                     throws org.exoplatform.webui.exception.MessageException
Throws:
org.exoplatform.webui.exception.MessageException
See Also:
throwWarning(String, String...)

openPopup

protected <T extends org.exoplatform.webui.core.UIComponent> T openPopup(org.exoplatform.webui.core.UIContainer parent,
                                                                         Class<T> componentType,
                                                                         String popupId,
                                                                         int width,
                                                                         int height)
                                                              throws Exception
Opens a popup and creates a component into it.

Type Parameters:
T - type of the component to display in the popup
Parameters:
parent - parent above whch the popup should be open
componentType - type of the component to open in the popup
popupId - id for the popup
width - popup width
height - popup height
Returns:
the component inside the popup
Throws:
Exception

openPopup

protected <T extends org.exoplatform.webui.core.UIComponent> T openPopup(org.exoplatform.webui.core.UIContainer parent,
                                                                         Class<T> componentType,
                                                                         int width,
                                                                         int height)
                                                              throws Exception
Throws:
Exception
See Also:
openPopup(UIContainer, Class, String, int, int)

cancelChildPopupAction

protected void cancelChildPopupAction()
                               throws Exception
Throws:
Exception


Copyright © 2013 eXo Platform SAS. All Rights Reserved.