Class WContainer

    • Constructor Detail

      • WContainer

        public WContainer()
    • Method Detail

      • add

        public void add​(WComponent component)
        Adds the given component as a "shared" child of this component.
        Specified by:
        add in interface MutableContainer
        Parameters:
        component - the component to add.
      • getChildAt

        public WComponent getChildAt​(int index)
        Retrieves a child component by its index.
        Specified by:
        getChildAt in interface Container
        Parameters:
        index - the index of the child component to be retrieved.
        Returns:
        the child component at the given index.
      • getChildCount

        public int getChildCount()
        Specified by:
        getChildCount in interface Container
        Returns:
        the number of child components currently contained within this component.
      • getChildren

        public List<WComponent> getChildren()
        Description copied from interface: Container
        Retrieves a list of this Container's.
        Specified by:
        getChildren in interface Container
        Returns:
        an immutable list of this Container.
      • remove

        public void remove​(WComponent child)
        Removes the given component from this components "shared" list of children.
        Specified by:
        remove in interface MutableContainer
        Parameters:
        child - the child component to remove
      • removeAll

        public void removeAll()
        Removes all the "shared" children from this component.
        Specified by:
        removeAll in interface MutableContainer
      • getIndexOfChild

        public int getIndexOfChild​(WComponent childComponent)
        Retrieves the index of the given child.
        Specified by:
        getIndexOfChild in interface Container
        Parameters:
        childComponent - the child component to retrieve the index for.
        Returns:
        the index of the given child component, or -1 if the component is not a child of this component.
      • setTemplate

        @Deprecated
        public void setTemplate​(Class clazz)
        Deprecated.
        Associates a velocity template with this component. A simple mapping is applied to the given class to derive the name of a velocity template.

        For instance, com.github.bordertech.wcomponents.WTextField would map to the template com/github/bordertech/wcomponents/WTextField.vm

        Parameters:
        clazz - the class to use to retrieve the template.
      • isNamingContext

        public boolean isNamingContext()
        A naming context is only considered active if an Id name has been set.
        Specified by:
        isNamingContext in interface NamingContextable
        Returns:
        true if active naming context.