BestSolution.at public p2 repository
XGrid
at.bestsolution.framework.grid

Interface XGrid<R,CP extends XGridContentProvider<R>>

  • Type Parameters:
    R - the row type
    CP - the content provider type
    All Known Subinterfaces:
    XGridTable<R>
    All Known Implementing Classes:
    SWTGridTable


    public interface XGrid<R,CP extends XGridContentProvider<R>>
    Base interface of grid
    Since:
    1.0
    • Property Detail

      • defaultSort

        @NonNull Property<java.util.Comparator<R>> defaultSortProperty
        The default sort.

        Default null

      • locale

        @NonNull Property<java.util.Locale> localeProperty
        The current locale used by the grid

        Default Locale.getDefault()

      • selection

        @NonNull Property<XSelection<R>> selectionProperty
        The selection property

        Default an empty selection

      • elementComparer

        @NonNull Property<ElementComparer<R>> elementComparerProperty
        The element comparer property

        Default implementation provides #hashCode() and #equals(Object) of R

      • metaDataFunction

        @NonNull Property<RowMetaDataFunction<R>> metaDataFunctionProperty
        Function consulted to retrieve row meta data

        Property value is initialized with a default function who returns no meta data

    • Method Detail

      • createColumn

        <C> @NonNull XGridColumn<R,C> createColumn(java.lang.String id,
                                                   @NonNull java.util.function.Function<R,C> cellValueFunction)
        Create a column
        Type Parameters:
        C - the cell type
        Parameters:
        id - the id of the column
        cellValueFunction - the cell value function
        Returns:
        column instance
        See Also:
        XGridColumn.cellValueFunctionProperty()
      • createCheckedColumn

        @NonNull XGridColumn<R,java.lang.Boolean> createCheckedColumn(java.lang.String id,
                                                                      @NonNull java.util.function.Function<R,java.lang.Boolean> cellValueFunction)
        Create a column which presents boolean values as check box
        Parameters:
        id - the id of the column
        cellValueFunction - the cell value function
        Returns:
        column instance
        See Also:
        XGridColumn.cellValueFunctionProperty()
      • defaultSortProperty

        @NonNull Property<java.util.Comparator<R>> defaultSortProperty()
        The default sort.

        Default null

      • localeProperty

        @NonNull Property<java.util.Locale> localeProperty()
        The current locale used by the grid

        Default Locale.getDefault()

      • contentProviderProperty

        @NonNull Property<CP> contentProviderProperty()
        The default content provider

        Default null

      • selectionProperty

        @NonNull Property<XSelection<R>> selectionProperty()
        The selection property

        Default an empty selection

      • elementComparerProperty

        @NonNull Property<ElementComparer<R>> elementComparerProperty()
        The element comparer property

        Default implementation provides #hashCode() and #equals(Object) of R

      • getColumns

        @NonNull java.util.List<XGridColumn<R,?>> getColumns()
        Returns:
        list of columns
      • metaDataFunctionProperty

        @NonNull Property<RowMetaDataFunction<R>> metaDataFunctionProperty()
        Function consulted to retrieve row meta data

        Property value is initialized with a default function who returns no meta data

      • dispose

        void dispose()
        dispose grid
      • getData

        @NonNull java.lang.Object[][] getData()
        export shown data

        if the content is empty an empty array will be exported

        Returns:
        data