org.olat.core.gui.components
Class Component

java.lang.Object
  extended by org.olat.core.gui.components.Component
Direct Known Subclasses:
Choice, Container, DateComponent, DelegatingComponent, DisplayOrDownloadComponent, DownloadComponent, FolderComponent, Form, FormBaseComponentImpl, HtmlHeaderComponent, HtmlStaticPageComponent, ImageComponent, IQComponent, JSAndCSSComponent, Link, MenuTree, ProgressBar, RatingComponent, SelectionTree, Table, TextComponent, TunnelComponent, ValidateForwardComponent, WeeklyCalendarComponent, WikiMarkupComponent

public abstract class Component
extends java.lang.Object

Description:

Author:
Felix Jost

Constructor Summary
Component(java.lang.String name)
           
Component(java.lang.String name, Translator translator)
           
 
Method Summary
 void addListener(Controller controller)
           
 java.util.List<Controller> debuginfoGetListeners()
           
 void dispatchRequest(UserRequest ureq)
           
 Event getAndClearLatestFiredEvent()
          only for debugging reasons!!!
 java.lang.String getComponentName()
           
 long getDispatchID()
           
 java.lang.String getExtendedDebugInfo()
           
abstract  ComponentRenderer getHTMLRendererSingleton()
           
 Controller getLatestDispatchedController()
          only for debug purposes!!!
 java.lang.String getListenerInfo()
           
 Container getParent()
           
 boolean getSpanAsDomReplaceable()
           
 int getTimestamp()
          to be used by Window.java to detect browser back in ajax-mode
 Translator getTranslator()
           
 boolean isDirty()
           
 boolean isDirtyForUser()
          used by the screenreader feature to determine whether the component has changed from a user's perspective.
 boolean isDomReplaceable()
           
 boolean isEnabled()
          true by default: The componet gets rendered and actions get dispatched if false: e.g.
 boolean isVisible()
           
 void setDirty(boolean dirty)
           
 void setDomReplaceable(boolean domReplaceable)
          if set to true(default), then this component can be swapped out in the browser dom tree if that capability is enabled
 void setEnabled(boolean enabled)
           
 void setSpanAsDomReplaceable(boolean spanReplaceable)
           
 void setVisible(boolean visible)
          True by default: The component gets rendered
false: The componet gets not rendered.
 java.lang.String toString()
           
 void validate(UserRequest ureq, ValidationResult vr)
          called just before the rendering of the -whole tree- takes place, so e.g.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Component

public Component(java.lang.String name)
Parameters:
name - the name of this component

Component

public Component(java.lang.String name,
                 Translator translator)
Parameters:
name - the name of this component
translator - the translator
Method Detail

getComponentName

public java.lang.String getComponentName()
Returns:
String

isVisible

public boolean isVisible()
Returns:
boolean

setVisible

public void setVisible(boolean visible)
True by default: The component gets rendered
false: The componet gets not rendered. Sets the visible.

Parameters:
visible - The visible to set

dispatchRequest

public void dispatchRequest(UserRequest ureq)

getHTMLRendererSingleton

public abstract ComponentRenderer getHTMLRendererSingleton()

validate

public void validate(UserRequest ureq,
                     ValidationResult vr)
called just before the rendering of the -whole tree- takes place, so e.g. lazy fetching can be implemented, or issueing a request for a new moduleUri (e.g. for CPComponent, so that the browser loads images correctly). only called when the component is visible


debuginfoGetListeners

public java.util.List<Controller> debuginfoGetListeners()
Returns:
a list of the controllers listening (normally only one)

addListener

public void addListener(Controller controller)
Parameters:
controller -

getTranslator

public Translator getTranslator()
Returns:
Translator

getDispatchID

public long getDispatchID()
Returns:
long the dispatchid (which is assigned at construction time of the component and never changes)

getExtendedDebugInfo

public java.lang.String getExtendedDebugInfo()
Returns:
the extended debuginfo

getListenerInfo

public java.lang.String getListenerInfo()
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

isEnabled

public boolean isEnabled()
true by default: The componet gets rendered and actions get dispatched if false: e.g. @see Link the link gets rendered but is not clickable

Returns:
Returns the enabled.

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - The enabled to set.

getLatestDispatchedController

public Controller getLatestDispatchedController()
only for debug purposes!!!

Returns:
Returns the latestDispatchedController.

getAndClearLatestFiredEvent

public Event getAndClearLatestFiredEvent()
only for debugging reasons!!!

Returns:
Returns the latestFiredEvent.

isDirty

public boolean isDirty()
Returns:
returns whether the component needs to be rerendered or not

isDirtyForUser

public boolean isDirtyForUser()
used by the screenreader feature to determine whether the component has changed from a user's perspective. normally this is the same as isDirty(), but may differ, e.g. for a MenuTree (expanding the tree: true; activating a link: false)

Returns:
whether the component has changed from a user's perspective.
See Also:
MenuTree

setDirty

public void setDirty(boolean dirty)
Parameters:
dirty - The dirty to set.

isDomReplaceable

public boolean isDomReplaceable()
Returns:
Returns the domReplaceable.

setDomReplaceable

public void setDomReplaceable(boolean domReplaceable)
if set to true(default), then this component can be swapped out in the browser dom tree if that capability is enabled

Parameters:
domReplaceable - The domReplaceable to set.

setSpanAsDomReplaceable

public void setSpanAsDomReplaceable(boolean spanReplaceable)

getSpanAsDomReplaceable

public boolean getSpanAsDomReplaceable()

getParent

public Container getParent()
Returns:

getTimestamp

public int getTimestamp()
to be used by Window.java to detect browser back in ajax-mode

Returns:
Returns the timestamp.