Class LightComposite

    • Constructor Detail

      • LightComposite

        public LightComposite()
    • Method Detail

      • getChildCount

        public int getChildCount()
        Description copied from interface: ILightComposite
        Gets the child count.
        Specified by:
        getChildCount in interface ILightComposite
        Returns:
        the number of direct children of this composite.
      • addChild

        public <T extends ILightControl> T addChild​(T control)
        Description copied from interface: ILightComposite
        Adds the child control to this composite.
        Specified by:
        addChild in interface ILightComposite
        Parameters:
        control - the control to add.
        Returns:
        the control added.
      • addChild

        public <T extends ILightControl> T addChild​(T control,
                                                    int index)
        Description copied from interface: ILightComposite
        Adds the child control to this composite.
        Specified by:
        addChild in interface ILightComposite
        Parameters:
        control - the control to add.
        index - the index to add the control at.
        Returns:
        the control added.
      • addChildAfter

        public <T extends ILightControl> T addChildAfter​(T control,
                                                         ILightControl sibling)
        Description copied from interface: ILightComposite
        Adds the child control to this composite after the given sibling.
        Specified by:
        addChildAfter in interface ILightComposite
        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.
      • paint

        public void paint​(org.eclipse.swt.graphics.GC gc,
                          org.eclipse.swt.graphics.Rectangle rectangle)
        Description copied from interface: ILightControl
        Paints the given rectangle of this control.
        Specified by:
        paint in interface ILightControl
        Parameters:
        gc - the GC to paint on.
        rectangle - the rectangle to paint.
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc,
                                                          int width,
                                                          int height,
                                                          boolean flushCache)
        Description copied from interface: ILightControl
        Computes the size of this control.
        Specified by:
        computeSize in interface ILightControl
        Overrides:
        computeSize in class AbstractLightControl
        Parameters:
        gc - the GC to do measurements with.
        width - the width hint, SWT.DEFAULT to compute the preferred width.
        height - the height hint, SWT.DEFAULT to compute the preferred height.
        flushCache - the flush cache flag, instructs the associated layout to reset all its caches, if any.
        Returns:
        the computed size.
      • setActiveControl

        public void setActiveControl​(ILightControl control)
        Description copied from interface: ILightComposite
        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.
        Specified by:
        setActiveControl in interface ILightComposite
        Parameters:
        control - the new active control.
      • traverse

        public boolean traverse​(ILightControl control,
                                TraverseDirection direction)
        Description copied from interface: ILightComposite
        Traverses this composite starting at the given control in the given direction.
        Specified by:
        traverse in interface ILightComposite
        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.
      • traverse

        public boolean traverse​(TraverseDirection direction)
        Description copied from interface: ILightComposite
        Traverses this composite in the given direction.
        Specified by:
        traverse in interface ILightComposite
        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.
      • layout

        public void layout​(org.eclipse.swt.graphics.GC gc)
        Description copied from interface: ILightComposite
        Layouts this composite using its layout, if any.
        Specified by:
        layout in interface ILightComposite
        Parameters:
        gc - the GC to do the measurements with.
      • layout

        public void layout()
      • controlFromPoint

        public ILightControl controlFromPoint​(int x,
                                              int y)
        Description copied from interface: ILightComposite
        Finds the control under the given point.
        Specified by:
        controlFromPoint in interface ILightComposite
        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

        public org.eclipse.swt.graphics.Point translatePointFromControl​(ILightControl child,
                                                                        org.eclipse.swt.graphics.Point point)
        Description copied from interface: ILightComposite
        Translate the point in the given child control coordinates to the coordinates of this composite.
        Specified by:
        translatePointFromControl in interface ILightComposite
        Parameters:
        child - 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

        public org.eclipse.swt.graphics.Rectangle translateRectangleFromControl​(ILightControl child,
                                                                                org.eclipse.swt.graphics.Rectangle rectangle)
        Description copied from interface: ILightComposite
        Translate the rectangle in the given child control coordinates to the coordinates of this composite.
        Specified by:
        translateRectangleFromControl in interface ILightComposite
        Parameters:
        child - 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

        public org.eclipse.swt.graphics.Point translatePointToControl​(ILightControl child,
                                                                      org.eclipse.swt.graphics.Point point)
        Description copied from interface: ILightComposite
        Translate the point in the coordinates of this composite to the coordinates of the given child control.
        Specified by:
        translatePointToControl in interface ILightComposite
        Parameters:
        child - 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

        public org.eclipse.swt.graphics.Rectangle translateRectangleToControl​(ILightControl child,
                                                                              org.eclipse.swt.graphics.Rectangle rectangle)
        Description copied from interface: ILightComposite
        Translate the rectangle in the coordinates of this composite to the coordinates of the given child control.
        Specified by:
        translateRectangleToControl in interface ILightComposite
        Parameters:
        child - 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

        public void revealRectangle​(org.eclipse.swt.graphics.Rectangle rectangle,
                                    boolean partial,
                                    boolean recursive)
        Specified by:
        revealRectangle in interface ILightComposite