Class VAbsoluteLayout

  • 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 VAbsoluteLayout
    extends com.google.gwt.user.client.ui.ComplexPanel
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  VAbsoluteLayout.AbsoluteWrapper
      Internal wrapper for wrapping widgets in the Absolute layout
      • 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
      protected com.google.gwt.dom.client.Element canvas  
      static String CLASSNAME
      Class name, prefix in styling
      static String TAGNAME
      Tag name for widget creation
      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      VAbsoluteLayout()
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(com.google.gwt.user.client.ui.Widget child)  
      void cleanupWrappers()
      Cleanup old wrappers which have been left empty by other inner layouts moving the widget from the wrapper into their own hierarchy.
      boolean contains​(com.google.gwt.user.client.ui.Widget widget)
      Does this layout contain a widget
      protected VAbsoluteLayout.AbsoluteWrapper getChildWrapper​(com.google.gwt.user.client.ui.Widget child)
      Get the wrapper for a widget
      com.google.gwt.user.client.ui.Widget getWidget​(int index)  
      VCaption getWidgetCaption​(com.google.gwt.user.client.ui.Widget child)
      Get the caption for a widget
      int getWidgetCount()  
      int getWidgetIndex​(com.google.gwt.user.client.ui.Widget child)  
      int getWidgetSlotHeight​(com.google.gwt.user.client.ui.Widget child)
      Get the pixel height of an slot in the layout
      int getWidgetSlotWidth​(com.google.gwt.user.client.ui.Widget child)
      Get the pixel width of an slot in the layout
      void layoutHorizontally()
      Performs an horizontal layout.
      void layoutVertically()
      Performs a vertical layout of the layout.
      boolean remove​(com.google.gwt.user.client.ui.Widget w)  
      void setStyleName​(String style)  
      void setStylePrimaryName​(String style)  
      void setWidgetCaption​(com.google.gwt.user.client.ui.Widget child, VCaption caption)
      Sets a caption for a contained widget
      void setWidgetPosition​(com.google.gwt.user.client.ui.Widget child, String position)
      Set the position of the widget in the layout.
      void setWidgetWrapperStyleNames​(com.google.gwt.user.client.ui.Widget widget, String... stylenames)
      Sets style names for the wrapper wrapping the widget in the layout.
      protected void updateStylenames​(String primaryStyleName)
      Updates all style names contained in the layout
      • Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel

        add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidgetIndex, insert, insert, iterator, remove
      • Methods inherited from class com.google.gwt.user.client.ui.Panel

        add, adopt, clear, 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, onBrowserEvent, onDetach, 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, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
    • Field Detail

      • canvas

        protected final com.google.gwt.dom.client.Element canvas
    • Constructor Detail

      • VAbsoluteLayout

        public VAbsoluteLayout()
        Default constructor
    • Method Detail

      • add

        public void add​(com.google.gwt.user.client.ui.Widget child)
        Specified by:
        add in interface com.google.gwt.user.client.ui.HasWidgets
        Overrides:
        add in class com.google.gwt.user.client.ui.Panel
      • remove

        public boolean remove​(com.google.gwt.user.client.ui.Widget w)
        Specified by:
        remove in interface com.google.gwt.user.client.ui.HasWidgets
        Overrides:
        remove in class com.google.gwt.user.client.ui.ComplexPanel
      • contains

        public boolean contains​(com.google.gwt.user.client.ui.Widget widget)
        Does this layout contain a widget
        Parameters:
        widget - The widget to check
        Returns:
        Returns true if the widget is in this layout, false if not
      • getWidget

        public com.google.gwt.user.client.ui.Widget getWidget​(int index)
        Specified by:
        getWidget in interface com.google.gwt.user.client.ui.IndexedPanel
        Overrides:
        getWidget in class com.google.gwt.user.client.ui.ComplexPanel
      • getWidgetCount

        public int getWidgetCount()
        Specified by:
        getWidgetCount in interface com.google.gwt.user.client.ui.IndexedPanel
        Overrides:
        getWidgetCount in class com.google.gwt.user.client.ui.ComplexPanel
      • getWidgetIndex

        public int getWidgetIndex​(com.google.gwt.user.client.ui.Widget child)
        Specified by:
        getWidgetIndex in interface com.google.gwt.user.client.ui.IndexedPanel
        Overrides:
        getWidgetIndex in class com.google.gwt.user.client.ui.ComplexPanel
      • setWidgetCaption

        public void setWidgetCaption​(com.google.gwt.user.client.ui.Widget child,
                                     VCaption caption)
        Sets a caption for a contained widget
        Parameters:
        child - The child widget to set the caption for
        caption - The caption of the widget
      • setWidgetPosition

        public void setWidgetPosition​(com.google.gwt.user.client.ui.Widget child,
                                      String position)
        Set the position of the widget in the layout. The position is a CSS property string using properties such as top,left,right,top
        Parameters:
        child - The child widget to set the position for
        position - The position string
      • getWidgetCaption

        public VCaption getWidgetCaption​(com.google.gwt.user.client.ui.Widget child)
        Get the caption for a widget
        Parameters:
        child - The child widget to get the caption of
      • getWidgetSlotWidth

        public int getWidgetSlotWidth​(com.google.gwt.user.client.ui.Widget child)
        Get the pixel width of an slot in the layout
        Parameters:
        child - The widget in the layout.
        Returns:
        Returns the size in pixels, or 0 if child is not in the layout
      • getWidgetSlotHeight

        public int getWidgetSlotHeight​(com.google.gwt.user.client.ui.Widget child)
        Get the pixel height of an slot in the layout
        Parameters:
        child - The widget in the layout
        Returns:
        Returns the size in pixels, or 0 if the child is not in the layout
      • getChildWrapper

        protected VAbsoluteLayout.AbsoluteWrapper getChildWrapper​(com.google.gwt.user.client.ui.Widget child)
        Get the wrapper for a widget
        Parameters:
        child - The child to get the wrapper for
        Returns:
      • setStylePrimaryName

        public void setStylePrimaryName​(String style)
        Overrides:
        setStylePrimaryName in class com.google.gwt.user.client.ui.UIObject
      • setStyleName

        public void setStyleName​(String style)
        Overrides:
        setStyleName in class com.google.gwt.user.client.ui.UIObject
      • updateStylenames

        protected void updateStylenames​(String primaryStyleName)
        Updates all style names contained in the layout
        Parameters:
        primaryStyleName - The style name to use as primary
      • layoutVertically

        public void layoutVertically()
        Performs a vertical layout of the layout. Should be called when a widget is added or removed
      • layoutHorizontally

        public void layoutHorizontally()
        Performs an horizontal layout. Should be called when a widget is add or removed
      • cleanupWrappers

        public void cleanupWrappers()
        Cleanup old wrappers which have been left empty by other inner layouts moving the widget from the wrapper into their own hierarchy. This usually happens when a call to setWidget(widget) is done in an inner layout which automatically detaches the widget from the parent, in this case the wrapper, and re-attaches it somewhere else. This has to be done in the layout phase since the order of the hierarchy events are not defined.
      • setWidgetWrapperStyleNames

        public void setWidgetWrapperStyleNames​(com.google.gwt.user.client.ui.Widget widget,
                                               String... stylenames)
        Sets style names for the wrapper wrapping the widget in the layout. The style names will be prefixed with v-absolutelayout-wrapper.
        Parameters:
        widget - The widget which wrapper we want to add the stylenames to
        stylenames - The style names that should be added to the wrapper