Package muntjac :: Package ui :: Module abstract_split_panel :: Class AbstractSplitPanel
[hide private]
[frames] | no frames]

Class AbstractSplitPanel

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 --+    
                                                          |    
                             object --+                   |    
                                      |                   |    
                    util.IEventListener --+               |    
                                          |               |    
              terminal.paintable.IPaintable --+           |    
                                              |           |    
                                 object --+   |           |    
                                          |   |           |    
     terminal.variable_owner.IVariableOwner --+           |    
                                              |           |    
                                 object --+   |           |    
                                          |   |           |    
                terminal.sizeable.ISizeable --+           |    
                                              |           |    
                           component.IComponent --+       |    
                                                  |       |    
            component_container.IComponentContainer --+   |    
                                                      |   |    
                                         layout.ILayout --+    
                                                          |    
                                             object --+   |    
                                                      |   |    
                                  layout.IMarginHandler --+    
                                                          |    
                             abstract_layout.AbstractLayout --+
                                                              |
                                                             AbstractSplitPanel
Known Subclasses:

AbstractSplitPanel is base class for a component container that can contain two components. The comopnents are split by a divider element.


Author: Vaadin Ltd.

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self)
Constructs a new component container.
source code
 
addComponent(self, c)
Add a component into this container.
source code
 
setFirstComponent(self, c) source code
 
setSecondComponent(self, c) source code
 
getFirstComponent(self)
Returns: the first component of this SplitPanel.
source code
 
getSecondComponent(self)
Returns: the second component of this SplitPanel.
source code
 
removeComponent(self, c)
Removes the component from this container.
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
 
paintContent(self, target)
Paints the content of this component.
source code
 
replaceComponent(self, oldComponent, newComponent)
Replaces the component in the container with another one without changing position.
source code
 
setSplitPosition(self, *args)
Moves the position of the splitter.
source code
 
getSplitPosition(self)
Returns the current position of the splitter, in getSplitPositionUnit units.
source code
 
getSplitPositionUnit(self)
Returns the unit of position of the splitter
source code
 
setLocked(self, locked)
Lock the SplitPanels position, disabling the user from dragging the split handle.
source code
 
isLocked(self)
Is the SplitPanel handle locked (user not allowed to change split position by dragging).
source code
 
changeVariables(self, source, variables)
Called when one or more variables handled by the implementing class are changed.
source code
 
fireClick(self, parameters)
Fire a layout click event.
source code
 
addListener(self, listener, iface=None)
Registers a new (generic) component event listener for the component:
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Removes a previously registered component event listener from this component.
source code
 
removeCallback(self, callback, eventType=None) source code

Inherited from abstract_layout.AbstractLayout: getMargin, setMargin

Inherited from abstract_component_container.AbstractComponentContainer: attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, getInvalidSizedChildren, moveComponentsFrom, removeAllComponents, repaintChangedChildTrees, repaintChildTrees, requestRepaintAll, setEnabled, setHeight, setWidth

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, 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]
  _SPLITTER_CLICK_EVENT = 'sp_click'

Inherited from abstract_layout.AbstractLayout (private): _CLICK_EVENT

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

Instance Variables [hide private]
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructs a new component container.

Overrides: object.__init__
(inherited documentation)

addComponent(self, c)

source code 

Add a component into this container. The component is added to the right or under the previous component.

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

getFirstComponent(self)

source code 
Returns:
the first component of this SplitPanel.

getSecondComponent(self)

source code 
Returns:
the second component of this SplitPanel.

removeComponent(self, c)

source code 

Removes the component from this container.

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

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, one or two)

paintContent(self, target)

source code 

Paints the content of this component.

Parameters:
  • target - the Paint Event.
Raises:
Overrides: abstract_component.AbstractComponent.paintContent

replaceComponent(self, oldComponent, newComponent)

source code 

Replaces the component in the container with another one without changing position.

This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. IComponent attach and detach events should be taken care as with add and remove.

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

setSplitPosition(self, *args)

source code 

Moves the position of the splitter.

Parameters:
  • args - tuple of the form
    • (pos)
      1. the new size of the region in the unit that was last used (default is percentage)
    • (pos, reverse)
      1. size of the first region
      2. if set to true the split splitter position is measured by the second region else it is measured by the first region
    • (pos, unit, reverse)
      1. size of the first region
      2. the unit (from Sizeable) in which the size is given.
      3. if set to true the split splitter position is measured by the second region else it is measured by the first region
    • (pos, unit, repaintNotNeeded)
      1. size of the first region
      2. the unit (from Sizeable) in which the size is given.
      3. true if client side needs to be updated. Use false if the position info has come from the client side, thus it already knows the position.

getSplitPosition(self)

source code 

Returns the current position of the splitter, in getSplitPositionUnit units.

Returns:
position of the splitter

getSplitPositionUnit(self)

source code 

Returns the unit of position of the splitter

Returns:
unit of position of the splitter

setLocked(self, locked)

source code 

Lock the SplitPanels position, disabling the user from dragging the split handle.

Parameters:
  • locked - Set True if locked, False otherwise.

isLocked(self)

source code 

Is the SplitPanel handle locked (user not allowed to change split position by dragging).

Returns:
True if locked, False otherwise.

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)

fireClick(self, parameters)

source code 

Fire a layout click event.

Note that this method is only used by the subclasses that implement LayoutClickNotifier, and can be overridden for custom click event firing.

Parameters:
  • parameters - The parameters received from the client side implementation
Overrides: abstract_layout.AbstractLayout.fireClick
(inherited documentation)

addListener(self, listener, iface=None)

source code 

Registers a new (generic) component event listener for the component:

 class Listening(CustomComponent, IListener):

     # Stored for determining the source of an event
     ok = None

     status = None  # For displaying info about the event

     def __init__(self):
         layout = VerticalLayout()

         # Some miscellaneous component
         name = TextField("Say it all here")
         name.addListener(self)
         name.setImmediate(true)
         layout.addComponent(name)

         # Handle button clicks as generic events instead
         # of Button.ClickEvent events
         ok = new Button("OK")
         ok.addListener(self)
         layout.addComponent(ok)

         # For displaying information about an event
         status = new Label("")
         layout.addComponent(status)

         setCompositionRoot(layout)


     def componentEvent(event):
         # Act according to the source of the event
         if (event.getSource() == ok):
             getWindow().showNotification("Click!")

         status.setValue("Event from " +
                 event.getSource().__class__.__name__
                 + ": " + event.__class__.__name__)


 listening = Listening()
 layout.addComponent(listening)
Parameters:
  • listener - the new IListener to be registered.
Raises:
  • ValueError - unless method has a match in object
Overrides: event.method_event_source.IMethodEventSource.addListener
(inherited documentation)

addCallback(self, callback, eventType=None, *args)

source code 
Overrides: terminal.paintable.IPaintable.addCallback

removeListener(self, listener, iface=None)

source code 

Removes a previously registered component event listener from this component.

Parameters:
  • listener - the listener to be removed.
Overrides: event.method_event_source.IMethodEventSource.removeListener
(inherited documentation)

removeCallback(self, callback, eventType=None)

source code 
Overrides: terminal.paintable.IPaintable.removeCallback