Home | Trees | Indices | Help |
|
---|
|
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 --+ | object --+ | | | event.layout_events.ILayoutClickNotifier --+ | CssLayout
CssLayout is a layout component that can be used in browser environment only. It simply renders components and their captions into a same div element. Component layout can then be adjusted with css.
In comparison to HorizontalLayout and VerticalLayout
With CustomLayout one can often achieve similar results (good looking layouts with web technologies), but with CustomLayout developer needs to work with fixed templates.
By extending CssLayout one can also inject some css rules straight to child components using getCss.
(*) Relative sizes (set from server side) are treated bit differently than in other layouts in Muntjac. In cssLayout the size is calculated relatively to CSS layouts content area which is pretty much as in html and css. In other layouts the size of component is calculated relatively to the "slot" given by layout.
Also note that client side framework in Muntjac modifies inline style properties width and height. This happens on each update to component. If one wants to set component sizes with CSS, component must have undefined size on server side (which is not the default for all components) and the size must be defined with class styles - not by directly injecting width and height.
|
|||
CLIENT_WIDGET = None hash(x) |
|||
_CLICK_EVENT =
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
Constructs a new component container.
|
Add a component into this container. The component is added to the right/under the previous component or into indexed position in this container.
|
Adds a component into this container. The component is added to the left or on top of the other components.
|
Removes the component from this container.
|
Gets the component container iterator for going trough all the components in the container.
|
Gets the number of contained components. Consistent with the iterator returned by getComponentIterator.
|
Paints the content of this component.
|
Returns styles to be applied to given component. Override this method to inject custom style rules to components. Note that styles are injected over previous styles before actual child rendering. Previous styles are not cleared, but overridden. Note that one most often achieves better code style, by separating styling to theme (with custom theme and addStyleName. With own custom styles it is also very easy to break browser compatibility.
|
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.
|
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)
|
|
Removes a previously registered component event listener from this component.
|
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jul 6 19:32:55 2013 | http://epydoc.sourceforge.net |