Class ResizableGridRowLayout


  • public class ResizableGridRowLayout
    extends GridRowLayout
    ResizableGridRowLayout works with HeaderLayout to implement column resizing semantics for CompositeTable UIs.

    Use a ResizableGridRowLayout when you have used a ResizableGridHeaderLayout on the Header object. ResizableGridRowLayout gets all of its layout settings from the ResizableGridHeaderLayout object, so there is no need to set any additional layout information on the ResizableGridRowLayout itself.

    • Field Detail

      • columnOrder

        private int[] columnOrder
      • control

        private org.eclipse.swt.widgets.Composite control
    • Constructor Detail

      • ResizableGridRowLayout

        public ResizableGridRowLayout()
        Constructor ResizableGridRowLayout. Create a ResizableGridRowLayout object. Since a ResizableGridRowLayout object will automatically find the associated HeaderLayout, no properties need to be set on a ResizableGridRowLayout.
    • Method Detail

      • computeSize

        protected org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.widgets.Composite composite,
                                                             int wHint,
                                                             int hHint,
                                                             boolean flushCache)
        Overrides:
        computeSize in class AbstractGridRowLayout
      • layout

        protected void layout​(org.eclipse.swt.widgets.Composite composite,
                              boolean flushCache)
        Overrides:
        layout in class AbstractGridRowLayout
      • getWeights

        public int[] getWeights()
        Description copied from class: AbstractGridRowLayout
        Method getWeights. If isFittingHorizontally, returns an array representing the percentage of the total width each column is allocated or null if no weights have been specified.

        If !isFittingHorizontally, returns an array where each element is the minimum width in pixels of the corresponding column.

        Overrides:
        getWeights in class AbstractGridRowLayout
        Returns:
        the current weights array or null if no weights have been specified.
      • setWeights

        public AbstractGridRowLayout setWeights​(int[] weights)
        Description copied from class: AbstractGridRowLayout
        Method setWeights. If isFittingHorizontally, specifies an array representing the percentage of the total width each column is allocated or null if no weights have been specified.

        If !isFittingHorizontally, specifies an array where each element is the minimum width in pixels of the corresponding column.

        This property is ignored if the programmer has set a layout manager on the header and/or the row prototype objects.

        The number of elements in the array must match the number of columns and if isFittingHorizontally, the sum of all elements must equal 100. If either of these constraints is not true, this property will be ignored and all columns will be created equal in width.

        Overrides:
        setWeights in class AbstractGridRowLayout
        Parameters:
        weights - the weights to use if the CompositeTable is automatically laying out controls.
        Returns:
        this
      • isFittingHorizontally

        public boolean isFittingHorizontally()
        Description copied from class: AbstractGridRowLayout
        Method isFittingHorizontally. Returns if the CompositeTable control will scale the widths of all columns so that they all fit into the available space. The default value is false.
        Overrides:
        isFittingHorizontally in class AbstractGridRowLayout
        Returns:
        Returns true if the table's actual width is set to equal the visible width; false otherwise.
      • setFittingHorizontally

        public AbstractGridRowLayout setFittingHorizontally​(boolean fittingHorizontally)
        Description copied from class: AbstractGridRowLayout
        Method setFittingHorizontally. Sets if the CompositeTable control will scale the widths of all columns so that they all fit into the available space. The default value is false.
        Overrides:
        setFittingHorizontally in class AbstractGridRowLayout
        Parameters:
        fittingHorizontally - true if the table's actual width is set to equal the visible width; false otherwise.
        Returns:
        this
      • getColumnAt

        protected org.eclipse.swt.widgets.Widget getColumnAt​(org.eclipse.swt.widgets.Composite rowOrHeader,
                                                             int offset)
        Description copied from class: AbstractGridRowLayout
        Return the SWT Widget representing the specified column.
        Overrides:
        getColumnAt in class GridRowLayout
        Parameters:
        rowOrHeader - The header or row object
        offset - The column's offset.
        Returns:
        The SWT Widget.
      • getLayoutDelegate

        private CompositeTableLayout getLayoutDelegate​(org.eclipse.swt.widgets.Composite composite)
      • createNullLayout

        private void createNullLayout​(org.eclipse.swt.widgets.Composite composite)
      • findHeader

        private void findHeader​(org.eclipse.swt.widgets.Composite row)
      • addListenersToDelegate

        private void addListenersToDelegate​(org.eclipse.swt.widgets.Composite row,
                                            HeaderLayout delegate)