com.vaadin.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.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.HasVisibility, 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, Iterable<com.google.gwt.user.client.ui.Widget>

    public class VCustomLayout
    extends com.google.gwt.user.client.ui.ComplexPanel

    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.HasWidgets

        com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
      • Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel

        com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
    • Field Summary

      Fields
      Modifier and Type Field Description
      static String CLASSNAME

      The default classname for this widget.

      ApplicationConnection client

      For internal use only.

      String pid

      Paintable ID of this paintable.

      String scripts

      Unexecuted scripts loaded from the template.

      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors
      Constructor Description
      VCustomLayout()

      Constructs a widget for a custom layout.

    • Method Summary

      All Methods
      Modifier and Type Method Description
      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.

      static void eval​(String script)

      Evaluate given script in browser document.

      String getLocation​(com.google.gwt.user.client.ui.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​(String template, String themeUri)

      Initialize HTML-layout.

      void notifyChildrenOfSizeChange()

      Deprecated.

      this method has done absolutely nothing since Vaadin 7.0 and should not be used, before that forced a recursive re-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 setStyleName​(String style)  
      void setWidget​(com.google.gwt.user.client.ui.Widget widget, String location)

      Sets widget to given location.

      void updateCaption​(ComponentConnector childConnector)

      Update caption for the given child connector.

      • Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel

        add, 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, 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, unsinkEvents
      • 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, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
    • Field Detail

      • scripts

        public String scripts

        Unexecuted scripts loaded from the template.

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

      • pid

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

        Constructs a widget for a custom layout.

    • Method Detail

      • setStyleName

        public void setStyleName​(String style)

        Overrides:

        setStyleName in class com.google.gwt.user.client.ui.UIObject

      • setWidget

        public void setWidget​(com.google.gwt.user.client.ui.Widget widget,
                              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:

        IllegalArgumentException - if no such location is found in the layout.

      • initializeHTML

        public void initializeHTML​(String template,
                                   String themeUri)

        Initialize HTML-layout.

        Parameters:

        template - original HTML-template

        themeUri - URI to the current theme

      • hasTemplate

        public boolean hasTemplate()

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

        Returns:

        true if has template contents, false otherwise

      • eval

        public static void eval​(String script)

        Evaluate given script in browser document.

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

        Parameters:

        script - the script to evaluate

      • updateCaption

        public void updateCaption​(ComponentConnector childConnector)

        Update caption for the given child connector.

        Parameters:

        childConnector - the child connector whose caption should be updated

      • getLocation

        public String getLocation​(com.google.gwt.user.client.ui.Widget w)

        Get the location of an widget.

        Parameters:

        w - the widget whose location to check

        Returns:

        location name, or null if not found

      • remove

        public boolean remove​(com.google.gwt.user.client.ui.Widget w)

        Removes given widget from the layout.

        Specified by:

        remove in interface com.google.gwt.user.client.ui.HasWidgets

        Overrides:

        remove in class com.google.gwt.user.client.ui.ComplexPanel

      • add

        public void add​(com.google.gwt.user.client.ui.Widget w)

        Adding widget without specifying location is not supported.

        Specified by:

        add in interface com.google.gwt.user.client.ui.HasWidgets

        Overrides:

        add in class com.google.gwt.user.client.ui.Panel

      • clear

        public void clear()

        Clear all widgets from the layout.

        Specified by:

        clear in interface com.google.gwt.user.client.ui.HasWidgets

        Overrides:

        clear in class com.google.gwt.user.client.ui.Panel

      • notifyChildrenOfSizeChange

        @Deprecated
        public void notifyChildrenOfSizeChange()
        Deprecated.
        this method has done absolutely nothing since Vaadin 7.0 and should not be used, before that forced a recursive re-layout

        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 class com.google.gwt.user.client.ui.Widget

      • 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 it. 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 - The first element of the layout

        Returns:

        true if layout function exists and was run successfully, else false.

      • onBrowserEvent

        public void onBrowserEvent​(com.google.gwt.user.client.Event event)

        Specified by:

        onBrowserEvent in interface com.google.gwt.user.client.EventListener

        Overrides:

        onBrowserEvent in class com.google.gwt.user.client.ui.Widget