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
package com.temp.client.foundation.widget.accordiontable;

import com.google.gwt.user.client.ui.*;
import com.temp.client.foundation.widget.*;
import com.temp.client.foundation.widget.AccordionVerticalPairPanel.*;

/**
 * Accordion Table is a Composite containing
 * Accordion Pair panel and provides the table headers,
 * table borders and corresponding styles
 *
 * @author palla
 */

public class AccordionTable extends Composite {

    final private HorizontalPanel tableHeader = new HorizontalPanel();
    final private AccordionVerticalPairPanel rows = new AccordionVerticalPairPanel();

    private static final String TABLE_HEADER_CSS = "converter-table-header";
    private static final String TABLE_CONTAINER_CSS = "converter-table-container";
    private static final String TITLE_HEADER_STYLE_NAME = "dataTable-table-header";
    private static final String TITLE_HEADER_PANEL_STYLE_NAME = "dataTable-table-header-panel";

    public AccordionTable( String title ) {

        VerticalPanel rowContainer = new VerticalPanel();
        rowContainer.setStyleName( TABLE_CONTAINER_CSS );
        rowContainer.add( tableHeader );
        rowContainer.add( rows );

        VerticalPanel panel = new VerticalPanel();
        if ( title != null ) {
            panel.add( createTitlePanel( title ) );
        }
        panel.add( rowContainer );

        tableHeader.setStyleName( TABLE_HEADER_CSS );

        initWidget( panel );
    }

    public void clear() {
        rows.clear();
    }

    public void add( WidgetPair pair ) {
        rows.add( pair );
    }

    public AccordionVerticalPairPanel getRows() {
        return rows;
    }

    public void setTableHeader( AccordionTablePrimaryRow header ) {
        tableHeader.add( header );
    }

    private DockPanel createTitlePanel( String title ) {
        DockPanel titlePanel = new DockPanel();
        titlePanel.setWidth( "100%" );
        titlePanel.setStylePrimaryName( TITLE_HEADER_PANEL_STYLE_NAME );
        Label titleLabel = new Label();
        titleLabel.setText( title );
        titleLabel.setStylePrimaryName( TITLE_HEADER_STYLE_NAME );
        titlePanel.add( titleLabel, DockPanel.WEST );
        titlePanel.setCellWidth( titleLabel, "85%" );
        return titlePanel;
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/accordiontable/AccordionTable.java

Diff revisions: vs.
Revision Author Commited Message
948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

626 GeorgeS picture GeorgeS Wed 11 Apr, 2012 19:39:41 +0000