Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package com.temp.foundation.client.widget.dialog;

import com.google.gwt.dom.client.Style.*;
import com.google.gwt.user.cellview.client.*;
import com.google.gwt.user.client.ui.*;
import com.temp.foundation.client.widget.table.*;

import java.util.*;

@SuppressWarnings("rawtypes")
public class DataTableDialogBox<R extends DataRow<F>, F> extends PopUpDialogBox {
    private static final int DEFAULT_WIDTH_IN_PX = 700;
    CachedDataTable<R, F> dataTable = new CachedDataTable<R, F>();

    /**
     * Adds a column
     *
     * @param fields - the column / "field" definitions
     */
    public <FIELD extends DataRowField> void addColumns( FIELD... fields ) {
        dataTable.addColumns( fields );
    }

    /**
     * Adds a column
     *
     * @param field - the column or "field" definition
     */
    public <FIELD extends DataRowField> void addColumn( FIELD field ) {
        dataTable.addColumn( field );
    }

    /**
     * Adds a column
     *
     * @param column - the column
     * @param field  - the column definition "field"
     */
    public <FIELD extends DataRowField> void addColumn( Column<R, ?> column, FIELD field ) {
        dataTable.addColumn( column, field );
    }

    /**
     * Adds a column
     *
     * @param field      - the column or "field" definition
     * @param comparator - the comparator
     */
    public <FIELD extends DataRowField> void addColumn( FIELD field, Comparator comparator ) {
        dataTable.addColumn( field, comparator );
    }

    /**
     * Adds a column
     *
     * @param column     - the column
     * @param field      - the column definition "field"
     * @param comparator - the comparator
     */
    public <FIELD extends DataRowField> void addColumn( Column<R, ?> column, FIELD field, Comparator comparator ) {
        dataTable.addColumn( column, field, comparator );
    }

    public void addColumn( Column<R, ?> column, String columnHeader, String fieldName ) {
        dataTable.addColumn( column, columnHeader, fieldName );
    }

    public void addColumn( Column<R, ?> column, String columnHeader, String fieldName, int width, Unit widthUnit ) {
        dataTable.addColumn( column, columnHeader, fieldName, width, widthUnit );
    }

    public void addColumn( Column<R, ?> column, String columnHeader, String fieldName, Comparator comparator ) {
        dataTable.addColumn( column, columnHeader, fieldName, comparator );
    }

    public void addColumn( Column<R, ?> column, String columnHeader, String fieldName, Comparator comparator, int width, Unit widthUnit ) {
        dataTable.addColumn( column, columnHeader, fieldName, comparator, width, widthUnit );
    }

    public void show( String title, List<R> dataList ) {
        show( title, dataList, DEFAULT_WIDTH_IN_PX );
    }

    public void show( String title, List<R> dataList, Integer widthInPx ) {
        dataTable.setData( dataList );

        if ( widthInPx != null ) {
            dataTable.setWidth( "" + widthInPx + "px" );
        }
        List<Widget> contents = new ArrayList<Widget>();
        contents.add( dataTable );
        setContentsAndShow( title, contents );
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/foundation/client/widget/dialog/DataTableDialogBox.java

Diff revisions: vs.
Revision Author Commited Message
965 GeorgeS picture GeorgeS Fri 01 Aug, 2014 03:20:35 +0000

!