Interface ILightComposite

    • Method Detail

      • getChildCount

        int getChildCount()
        Gets the child count.
        Returns:
        the number of direct children of this composite.
      • getChildren

        Iterable<ILightControl> getChildren()
        Gets the children.
        Returns:
        the direct children of this composite.
      • addChild

        <T extends ILightControl> T addChild​(T control)
        Adds the child control to this composite.
        Parameters:
        control - the control to add.
        Returns:
        the control added.
      • addChild

        <T extends ILightControl> T addChild​(T control,
                                             int index)
        Adds the child control to this composite.
        Parameters:
        control - the control to add.
        index - the index to add the control at.
        Returns:
        the control added.
      • addChildAfter

        <T extends ILightControl> T addChildAfter​(T control,
                                                  ILightControl sibling)
        Adds the child control to this composite after the given sibling.
        Parameters:
        control - the control to add.
        sibling - the sibling to add the control after, null to prepend the control to the children.
        Returns:
        the control added.
      • removeChild

        void removeChild​(ILightControl control)
        Removes the child control.
        Parameters:
        control - the control to remove.
      • setActiveControl

        void setActiveControl​(ILightControl control)
        Sets the active control for this composite. The given control may be the indirect child of this composite. This composite should not try to change the focus as the focus may be already set.
        Parameters:
        control - the new active control.
      • traverse

        boolean traverse​(TraverseDirection direction)
        Traverses this composite in the given direction.
        Parameters:
        direction - the direction to traverse in.
        Returns:
        true if traversal was successful and the focus was set to one of the child controls, false otherwise.
      • traverse

        boolean traverse​(ILightControl control,
                         TraverseDirection direction)
        Traverses this composite starting at the given control in the given direction.
        Parameters:
        control - the control to start from.
        direction - the direction to traverse in.
        Returns:
        true if traversal was successful and the focus was set to one of the child controls, false otherwise.
      • getLayout

        ILightLayout getLayout()
        Gets the layout of this composite.
        Returns:
        the associated layout or null if no layout is set.
      • setLayout

        void setLayout​(ILightLayout layout)
        Sets the layout of this composite.
        Parameters:
        layout - the new layout.
      • layout

        void layout​(org.eclipse.swt.graphics.GC gc)
        Layouts this composite using its layout, if any.
        Parameters:
        gc - the GC to do the measurements with.
      • controlFromPoint

        ILightControl controlFromPoint​(int x,
                                       int y)
        Finds the control under the given point.
        Parameters:
        x - the x coordinate of the point.
        y - the y coordinate of the point.
        Returns:
        found child control, this composite or null if nothing found under the point and this composite is transparent for the mouse events.
      • translatePointFromControl

        org.eclipse.swt.graphics.Point translatePointFromControl​(ILightControl control,
                                                                 org.eclipse.swt.graphics.Point point)
        Translate the point in the given child control coordinates to the coordinates of this composite.
        Parameters:
        control - the child control to translate the point from or this composite.
        point - the point to translate.
        Returns:
        the translated point or null if the given child control is neither a child of this composite nor this composite.
      • translateRectangleFromControl

        org.eclipse.swt.graphics.Rectangle translateRectangleFromControl​(ILightControl control,
                                                                         org.eclipse.swt.graphics.Rectangle rectangle)
        Translate the rectangle in the given child control coordinates to the coordinates of this composite.
        Parameters:
        control - the child to translate the rectangle from or this composite.
        rectangle - the rectangle to translate.
        Returns:
        the translated rectangle or null if the given child is neither a child of this composite nor this composite.
      • translatePointToControl

        org.eclipse.swt.graphics.Point translatePointToControl​(ILightControl control,
                                                               org.eclipse.swt.graphics.Point point)
        Translate the point in the coordinates of this composite to the coordinates of the given child control.
        Parameters:
        control - the child to translate the point to or this composite.
        point - the point to translate.
        Returns:
        the translated point or null if the given child is neither a child of this composite nor this composite.
      • translateRectangleToControl

        org.eclipse.swt.graphics.Rectangle translateRectangleToControl​(ILightControl control,
                                                                       org.eclipse.swt.graphics.Rectangle rectangle)
        Translate the rectangle in the coordinates of this composite to the coordinates of the given child control.
        Parameters:
        control - the child to translate the point to or this composite.
        rectangle - the rectangle to translate.
        Returns:
        the translated rectangle or null if the given child is neither a child of this composite nor this composite.
      • revealRectangle

        void revealRectangle​(org.eclipse.swt.graphics.Rectangle rectangle,
                             boolean partial,
                             boolean recursive)