Package muntjac :: Package addon :: Package refresher :: Module refresher :: Class Refresher
[hide private]
[frames] | no frames]

Class Refresher

source code

                          object --+                
                                   |                
                 util.IEventListener --+            
                                       |            
           terminal.paintable.IPaintable --+        
                                           |        
                              object --+   |        
                                       |   |        
  terminal.variable_owner.IVariableOwner --+        
                                           |        
                              object --+   |        
                                       |   |        
             terminal.sizeable.ISizeable --+        
                                           |        
                     ui.component.IComponent --+    
                                               |    
                                  object --+   |    
                                           |   |    
event.method_event_source.IMethodEventSource --+    
                                               |    
         ui.abstract_component.AbstractComponent --+
                                                   |
                                                  Refresher

A Refresher is an non-visual component that polls the server for GUI updates.

This makes asynchronous UI changes possible, that will be rendered even if the user doesn't initiate a server-cycle explicitly.

@author Henrik Paul

Instance Methods [hide private]
 
__init__(self)
Creates a new Refresher instance, with a default refresh interval of Refresher.DEFAULT_REFRESH_INTERVAL.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
setRefreshInterval(self, intervalInMillis)
Define a refresh interval.
source code
 
getRefreshInterval(self)
Get the currently used refreshing interval.
source code
 
changeVariables(self, source, variables)
Called when one or more variables handled by the implementing class are changed.
source code
 
fireRefreshEvents(self) source code
 
addListener(self, listener, iface=None)
Add a listener that will be triggered whenever this instance refreshes itself
source code
 
removeListener(self, listener, iface=None)
Removes a RefreshListener from this instance.
source code

Inherited from ui.abstract_component.AbstractComponent: __getstate__, __setstate__, addCallback, addStyleName, attach, childRequestedRepaint, detach, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, focus, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, parseStringSize, registerCallback, registerListener, removeCallback, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidthUnits, withdrawCallback, withdrawListener

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CLIENT_WIDGET = None
hash(x)
  TYPE_MAPPING = 'com.github.wolfie.refresher.Refresher'
  _DEFAULT_REFRESH_INTERVAL = 1000

Inherited from ui.abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Creates a new Refresher instance, with a default refresh interval of Refresher.DEFAULT_REFRESH_INTERVAL.

Overrides: object.__init__

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: ui.abstract_component.AbstractComponent.paintContent
(inherited documentation)

setRefreshInterval(self, intervalInMillis)

source code 

Define a refresh interval.

Parameters:
  • intervalInMillis - The desired refresh interval in milliseconds. An interval of zero or less temporarily inactivates the refresh.

getRefreshInterval(self)

source code 

Get the currently used refreshing interval.

Returns:
The refresh interval in milliseconds. A result of zero or less means that the refresher is currently inactive.

changeVariables(self, source, variables)

source code 

Called when one or more variables handled by the implementing class are changed.

Parameters:
  • source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
  • variables - the Mapping from variable names to new variable values.
Overrides: terminal.variable_owner.IVariableOwner.changeVariables
(inherited documentation)

addListener(self, listener, iface=None)

source code 

Add a listener that will be triggered whenever this instance refreshes itself

Parameters:
  • listener - the listener
Returns:
True if the adding was successful. False if the adding was unsuccessful, or listener is None.
Raises:
  • ValueError - unless method has a match in object
Overrides: event.method_event_source.IMethodEventSource.addListener

removeListener(self, listener, iface=None)

source code 

Removes a RefreshListener from this instance.

Parameters:
  • listener - the listener to be removed.
Returns:
True if removal was successful. A False most often means that listener wasn't added to this instance to begin with.
Overrides: event.method_event_source.IMethodEventSource.removeListener