Package muntjac :: Package ui :: Module custom_component :: Class CustomComponent
[hide private]
[frames] | no frames]

Class CustomComponent

source code

                             object --+                    
                                      |                    
                    util.IEventListener --+                
                                          |                
              terminal.paintable.IPaintable --+            
                                              |            
                                 object --+   |            
                                          |   |            
     terminal.variable_owner.IVariableOwner --+            
                                              |            
                                 object --+   |            
                                          |   |            
                terminal.sizeable.ISizeable --+            
                                              |            
                           component.IComponent --+        
                                                  |        
                                     object --+   |        
                                              |   |        
   event.method_event_source.IMethodEventSource --+        
                                                  |        
               abstract_component.AbstractComponent --+    
                                                      |    
                             object --+               |    
                                      |               |    
                    util.IEventListener --+           |    
                                          |           |    
              terminal.paintable.IPaintable --+       |    
                                              |       |    
                                 object --+   |       |    
                                          |   |       |    
     terminal.variable_owner.IVariableOwner --+       |    
                                              |       |    
                                 object --+   |       |    
                                          |   |       |    
                terminal.sizeable.ISizeable --+       |    
                                              |       |    
                           component.IComponent --+   |    
                                                  |   |    
            component_container.IComponentContainer --+    
                                                      |    
abstract_component_container.AbstractComponentContainer --+
                                                          |
                                                         CustomComponent
Known Subclasses:

Custom component provides simple implementation of Component interface for creation of new UI components by composition of existing components.

The component is used by inheriting the CustomComponent class and setting composite root inside the Custom component. The composite root itself can contain more components, but their interfaces are hidden from the users.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, compositionRoot=None)
Constructs a new custom component.
source code
 
getCompositionRoot(self)
Returns the composition root.
source code
 
setCompositionRoot(self, compositionRoot)
Sets the compositions root.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
getComponentType(self)
Gets the component type.
source code
 
setComponentType(self, componentType)
Sets the component type.
source code
 
getComponentIterator(self)
Gets an iterator to the collection of contained components.
source code
 
getComponentCount(self)
Gets the number of contained components.
source code
 
replaceComponent(self, oldComponent, newComponent)
This method is not supported by CustomComponent.
source code
 
addComponent(self, c)
This method is not supported by CustomComponent.
source code
 
moveComponentsFrom(self, source)
This method is not supported by CustomComponent.
source code
 
removeAllComponents(self)
This method is not supported by CustomComponent.
source code
 
removeComponent(self, c)
This method is not supported by CustomComponent.
source code

Inherited from abstract_component_container.AbstractComponentContainer: addCallback, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, getInvalidSizedChildren, removeCallback, removeListener, repaintChangedChildTrees, repaintChildTrees, requestRepaintAll, setEnabled, setHeight, setWidth

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, changeVariables, childRequestedRepaint, 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, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, 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)

Inherited from 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, compositionRoot=None)
(Constructor)

source code 

Constructs a new custom component.

The component is implemented by wrapping the methods of the composition root component given as parameter. The composition root must not be null and can not be changed after the composition.

Parameters:
  • compositionRoot - the root of the composition component tree.
Overrides: object.__init__

getCompositionRoot(self)

source code 

Returns the composition root.

Returns:
the Component Composition root.

setCompositionRoot(self, compositionRoot)

source code 

Sets the compositions root.

The composition root must be set to non-null value before the component can be used. The composition root can only be set once.

Parameters:
  • compositionRoot - the root of the composition component tree.

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: abstract_component.AbstractComponent.paintContent
(inherited documentation)

getComponentType(self)

source code 

Gets the component type.

The component type is textual type of the component. This is included in the UIDL as component tag attribute.

Returns:
the component type.

Deprecated: not more useful as the whole tag system has been removed

setComponentType(self, componentType)

source code 

Sets the component type.

The component type is textual type of the component. This is included in the UIDL as component tag attribute.

Parameters:
  • componentType - the componentType to set.

Deprecated: not more useful as the whole tag system has been removed

getComponentIterator(self)

source code 

Gets an iterator to the collection of contained components. Using this iterator it is possible to step through all components contained in this container.

Returns:
the component iterator.
Overrides: component_container.IComponentContainer.getComponentIterator
(inherited documentation)

getComponentCount(self)

source code 

Gets the number of contained components. Consistent with the iterator returned by getComponentIterator.

Returns:
the number of contained components (zero or one)

replaceComponent(self, oldComponent, newComponent)

source code 

This method is not supported by CustomComponent.

Parameters:
  • oldComponent - the old component that will be replaced.
  • newComponent - the new component to be replaced.
Overrides: component_container.IComponentContainer.replaceComponent

See Also: ComponentContainer.replaceComponent()

addComponent(self, c)

source code 

This method is not supported by CustomComponent. Use CustomComponent.setCompositionRoot to set CustomComponents "child".

Parameters:
  • c - the component to be added.
Overrides: component_container.IComponentContainer.addComponent

moveComponentsFrom(self, source)

source code 

This method is not supported by CustomComponent.

Parameters:
  • source - the container which contains the components that are to be moved to this container.
Overrides: component_container.IComponentContainer.moveComponentsFrom

removeAllComponents(self)

source code 

This method is not supported by CustomComponent.

Overrides: component_container.IComponentContainer.removeAllComponents

removeComponent(self, c)

source code 

This method is not supported by CustomComponent.

Parameters:
  • c - the component to be removed.
Overrides: component_container.IComponentContainer.removeComponent