Class AppLayout

    • Constructor Detail

      • AppLayout

        public AppLayout()
    • Method Detail

      • getI18n

        public AppLayout.AppLayoutI18n getI18n()
        Gets the internationalization object previously set for this component.

        Note: updating the i18n object that is returned from this method will not update the the component, unless it is set again using setI18n(AppLayoutI18n)

        Returns:
        the i18n object. It will be null, if the i18n properties are not set.
      • setI18n

        public void setI18n​(AppLayout.AppLayoutI18n i18n)
        Sets the internationalization properties for this component.
        Parameters:
        i18n - the internationalized properties, not null
      • onAttach

        protected void onAttach​(AttachEvent attachEvent)
        Description copied from class: Component
        Called when the component is attached to a UI.

        The default implementation does nothing.

        This method is invoked before the AttachEvent is fired for the component.

        Overrides:
        onAttach in class Component
        Parameters:
        attachEvent - the attach event
      • setPrimarySection

        public void setPrimarySection​(AppLayout.Section primarySection)
        Defines whether navbar or drawer will come first visually.
        Parameters:
        primarySection - new value for the primarySection property. Not null.
        Throws:
        NullPointerException - if primarySection is null.
      • isDrawerOpened

        @Synchronize("drawer-opened-changed")
        public boolean isDrawerOpened()
        Whether the drawer is opened (visible) or not. Its default value depends on the viewport:
        • true for desktop size views
        • false for mobile size views
        Returns:
        true if the drawer is opened (visible). false otherwise.
      • isOverlay

        @Synchronize("overlay-changed")
        public boolean isOverlay()
        Note: This property is controlled via CSS and can not be changed directly.
        Returns:
        true if drawer is an overlay on top of the content. false otherwise.
      • getContent

        public Component getContent()
        Returns:
        the displayed content
      • setContent

        public void setContent​(Component content)
        Sets the displayed content.
        Parameters:
        content - Component to display in the content area
      • addToDrawer

        public void addToDrawer​(Component... components)
        Adds the components to the drawer slot of this AppLayout.
        Parameters:
        components - Components to add to the drawer slot.
        Throws:
        NullPointerException - if any of the components is null or if the components array is null.
      • addToNavbar

        public void addToNavbar​(Component... components)
        Adds the components to the navbar slot of this AppLayout.
        Parameters:
        components - Components to add to the navbar slot.
        Throws:
        NullPointerException - if any of the components is null or if the components array is null.
      • addToNavbar

        public void addToNavbar​(boolean touchOptimized,
                                Component... components)
        Adds the components to the navbar slot of this AppLayout.
        Parameters:
        touchOptimized - if true, the components will be moved to the bottom navbar area on mobile devices.
        components - Components to add to the navbar slot.
        Throws:
        NullPointerException - if any of the components is null or if the components array is null.
      • remove

        public void remove​(Component... components)
        Removes the child components from the parent. Components can be in any slot or be the main content.
        Parameters:
        components - Components to remove.
      • afterNavigation

        protected void afterNavigation()
        Called after a navigation event. The default behaviour is to close the drawer on mobile devices after a navigation event.