com.vaadin.terminal.gwt.client.ui.
Class VCustomLayout
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.vaadin.terminal.gwt.client.ui.VCustomLayout
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, Container, ContainerResizedListener, Paintable, Iterable<com.google.gwt.user.client.ui.Widget>
- extends com.google.gwt.user.client.ui.ComplexPanel
- implements Paintable, Container, ContainerResizedListener
public class VCustomLayout
Custom Layout implements complex layout defined with HTML template.
Author:
Vaadin Ltd
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel |
---|
com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
---|
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget |
Field Summary | |
---|---|
static String |
CLASSNAME
|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
VCustomLayout()
|
Method Summary | |
---|---|
void |
add(com.google.gwt.user.client.ui.Widget w)
Adding widget without specifying location is not supported |
void |
clear()
Clear all widgets from the layout |
RenderSpace |
getAllocatedSpace(com.google.gwt.user.client.ui.Widget child)
Returns the size currently allocated for the child component. |
String |
getLocation(com.google.gwt.user.client.ui.Widget w)
Get the location of an widget |
boolean |
hasChildComponent(com.google.gwt.user.client.ui.Widget component)
Does this layout contain given child |
void |
iLayout()
This function is run when container box has been resized. |
void |
notifyChildrenOfSizeChange()
This method is published to JS side with the same name into first DOM node of custom layout. |
void |
onBrowserEvent(com.google.gwt.user.client.Event event)
|
void |
onDetach()
|
boolean |
remove(com.google.gwt.user.client.ui.Widget w)
Removes given widget from the layout |
void |
replaceChildComponent(com.google.gwt.user.client.ui.Widget from,
com.google.gwt.user.client.ui.Widget to)
Replace child components |
boolean |
requestLayout(Set<Paintable> child)
Called when a child components size has been updated in the rendering phase. |
void |
setHeight(String height)
|
void |
setWidget(com.google.gwt.user.client.ui.Widget widget,
String location)
Sets widget to given location. |
void |
setWidth(String width)
|
void |
updateCaption(Paintable component,
UIDL uidl)
Update caption for given widget |
void |
updateFromUIDL(UIDL uidl,
ApplicationConnection client)
Update the layout from UIDL |
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
---|
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, remove |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
CLASSNAME
public static final String CLASSNAME
See Also:
Constructor Detail |
---|
VCustomLayout
public VCustomLayout()
Method Detail |
---|
setWidget
public void setWidget(com.google.gwt.user.client.ui.Widget widget,
String location)
- Parameters:
widget
- Widget to be set into location.location
- location name where widget will be added- Throws:
IllegalArgumentException
- if no such location is found in the layout.
Sets widget to given location. If location already contains a widget it will be removed.
updateFromUIDL
public void updateFromUIDL(UIDL uidl,
ApplicationConnection client)
- Specified by:
updateFromUIDL
in interfacePaintable
Update the layout from UIDL
replaceChildComponent
public void replaceChildComponent(com.google.gwt.user.client.ui.Widget from,
com.google.gwt.user.client.ui.Widget to)
- Specified by:
replaceChildComponent
in interfaceContainer
- Parameters:
from
- Child to be replacedto
- Child that replaces the oldComponent
Replace child components
hasChildComponent
public boolean hasChildComponent(com.google.gwt.user.client.ui.Widget component)
- Specified by:
hasChildComponent
in interfaceContainer
- Parameters:
component
- Component to test.- Returns:
- true iff component is a child of this layout.
Does this layout contain given child
updateCaption
public void updateCaption(Paintable component,
UIDL uidl)
- Specified by:
updateCaption
in interfaceContainer
- Parameters:
component
- Child component for which service is requested.uidl
- UIDL of the child component.
Update caption for given widget
getLocation
public String getLocation(com.google.gwt.user.client.ui.Widget w)
Get the location of an widget
remove
public boolean remove(com.google.gwt.user.client.ui.Widget w)
- Specified by:
remove
in interfacecom.google.gwt.user.client.ui.HasWidgets
- Overrides:
remove
in classcom.google.gwt.user.client.ui.ComplexPanel
Removes given widget from the layout
add
public void add(com.google.gwt.user.client.ui.Widget w)
- Specified by:
add
in interfacecom.google.gwt.user.client.ui.HasWidgets
- Overrides:
add
in classcom.google.gwt.user.client.ui.Panel
Adding widget without specifying location is not supported
clear
public void clear()
- Specified by:
clear
in interfacecom.google.gwt.user.client.ui.HasWidgets
- Overrides:
clear
in classcom.google.gwt.user.client.ui.Panel
Clear all widgets from the layout
iLayout
public void iLayout()
- Specified by:
iLayout
in interfaceContainerResizedListener
Description copied from interface: ContainerResizedListener
This function is run when container box has been resized. Object implementing ContainerResizedListener is responsible to call the same function on its ancestors that implement NeedsLayout in case their container has resized. runAnchestorsLayout(HasWidgets parent) function from Util class may be a good helper for this.
notifyChildrenOfSizeChange
public void notifyChildrenOfSizeChange()
This method is published to JS side with the same name into first DOM node of custom layout. This way if one implements some resizeable containers in custom layout he/she can notify children after resize.
onDetach
public void onDetach()
- Overrides:
onDetach
in classcom.google.gwt.user.client.ui.Widget
requestLayout
public boolean requestLayout(Set<Paintable> child)
- Specified by:
requestLayout
in interfaceContainer
- Parameters:
child
- Set of child widgets whose size have changed- Returns:
- true if the size of the Container remains the same, false if the event need to be propagated to the Containers parent
Description copied from interface: Container
Called when a child components size has been updated in the rendering phase.
getAllocatedSpace
public RenderSpace getAllocatedSpace(com.google.gwt.user.client.ui.Widget child)
- Specified by:
getAllocatedSpace
in interfaceContainer
- Returns:
Description copied from interface: Container
Returns the size currently allocated for the child component.
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
- Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Widget
setHeight
public void setHeight(String height)
- Overrides:
setHeight
in classcom.google.gwt.user.client.ui.UIObject
setWidth
public void setWidth(String width)
- Overrides:
setWidth
in classcom.google.gwt.user.client.ui.UIObject