com.vaadin.client.ui
Class VCustomLayout

java.lang.Object
  extended by ComplexPanel
      extended by com.vaadin.client.ui.VCustomLayout

public class VCustomLayout
extends ComplexPanel

Custom Layout implements complex layout defined with HTML template.

Author:
Vaadin Ltd

Field Summary
static java.lang.String CLASSNAME
           
 ApplicationConnection client
          For internal use only.
 java.lang.String pid
          Paintable ID of this paintable.
 java.lang.String scripts
          Unexecuted scripts loaded from the template.
 
Constructor Summary
VCustomLayout()
           
 
Method Summary
 void add(Widget w)
          Adding widget without specifying location is not supported
 void clear()
          Clear all widgets from the layout
static void eval(java.lang.String script)
          Evaluate given script in browser document.
 java.lang.String getLocation(Widget w)
          Get the location of an widget
 boolean hasTemplate()
          For internal use only.
 boolean iLayoutJS(com.google.gwt.user.client.Element el)
          In custom layout one may want to run layout functions made with JavaScript.
 void initializeHTML(java.lang.String template, java.lang.String themeUri)
          Initialize HTML-layout.
 void notifyChildrenOfSizeChange()
          This method is published to JS side with the same name into first DOM node of custom layout.
 void onBrowserEvent(Event event)
           
 void onDetach()
           
 boolean remove(Widget w)
          Removes given widget from the layout
 void setStyleName(java.lang.String style)
           
 void setWidget(Widget widget, java.lang.String location)
          Sets widget to given location.
 void updateCaption(ComponentConnector paintable)
          Update caption for given widget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
See Also:
Constant Field Values

scripts

public java.lang.String scripts
Unexecuted scripts loaded from the template.

For internal use only. May be removed or replaced in the future.


pid

public java.lang.String pid
Paintable ID of this paintable.

For internal use only. May be removed or replaced in the future.


client

public ApplicationConnection client
For internal use only. May be removed or replaced in the future.

Constructor Detail

VCustomLayout

public VCustomLayout()
Method Detail

setStyleName

public void setStyleName(java.lang.String style)

setWidget

public void setWidget(Widget widget,
                      java.lang.String location)
Sets widget to given location. If location already contains a widget it will be removed.

Parameters:
widget - Widget to be set into location.
location - location name where widget will be added
Throws:
java.lang.IllegalArgumentException - if no such location is found in the layout.

initializeHTML

public void initializeHTML(java.lang.String template,
                           java.lang.String themeUri)
Initialize HTML-layout.


hasTemplate

public boolean hasTemplate()
For internal use only. May be removed or replaced in the future.


eval

public static void eval(java.lang.String script)
Evaluate given script in browser document.

For internal use only. May be removed or replaced in the future.


updateCaption

public void updateCaption(ComponentConnector paintable)
Update caption for given widget


getLocation

public java.lang.String getLocation(Widget w)
Get the location of an widget


remove

public boolean remove(Widget w)
Removes given widget from the layout


add

public void add(Widget w)
Adding widget without specifying location is not supported


clear

public void clear()
Clear all widgets from the layout


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()

iLayoutJS

public boolean iLayoutJS(com.google.gwt.user.client.Element el)
In custom layout one may want to run layout functions made with JavaScript. This function tests if one exists (with name "iLayoutJS" in layouts first DOM node) and runs et. Return value is used to determine if children needs to be notified of size changes.

Note! When implementing a JS layout function you most likely want to call notifyChildrenOfSizeChange() function on your custom layouts main element. That method is used to control whether child components layout functions are to be run.

For internal use only. May be removed or replaced in the future.

Parameters:
el -
Returns:
true if layout function exists and was run successfully, else false.

onBrowserEvent

public void onBrowserEvent(Event event)


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.