Changeset 4794

Show
Ignore:
Timestamp:
06/09/08 07:19:19 (3 months ago)
Author:
magi@…
Message:

Merged [4769] from trunk to 5.2 branch: #1572 (GridLayout? : setMargin(true) nor setComponentSpacing(true) does nothing in non-sized grid): updated test case and spacing implementation

Location:
branches/5.2
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/5.2/WebContent/ITMILL/themes/default/gridlayout/gridlayout.css

    r4792 r4794  
    1111        padding-right: 18px; 
    1212} 
     13 
     14.i-gridlayout-grid { 
     15        margin:0; 
     16        padding:0; 
     17        border-collapse: collapse; 
     18        border:0; 
     19} 
     20 
     21.i-gridlayout-cell { 
     22        margin:0; 
     23        padding:0; 
     24} 
     25 
     26.i-gridlayout-spacing .i-gridlayout-cell { 
     27        padding-left: 15px; 
     28        padding-top:15px; 
     29} 
     30 
     31.i-gridlayout-spacing .i-gridlayout-firstcol { 
     32        padding-left: 0; 
     33} 
     34.i-gridlayout-spacing .i-gridlayout-firstrow { 
     35        padding-top: 0; 
     36} 
  • branches/5.2/WebContent/ITMILL/themes/default/styles.css

    r4792 r4794  
    513513} 
    514514 
     515.i-gridlayout-grid { 
     516        margin:0; 
     517        padding:0; 
     518        border-collapse: collapse; 
     519        border:0; 
     520} 
     521 
     522.i-gridlayout-cell { 
     523        margin:0; 
     524        padding:0; 
     525} 
     526 
     527.i-gridlayout-spacing .i-gridlayout-cell { 
     528        padding-left: 15px; 
     529        padding-top:15px; 
     530} 
     531.i-gridlayout-spacing .i-gridlayout-firstcol { 
     532        padding-left: 0; 
     533} 
     534.i-gridlayout-spacing .i-gridlayout-firstrow { 
     535        padding-top: 0; 
     536} 
     537 
    515538.i-Notification { 
    516539        font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif; 
  • branches/5.2/src/com/itmill/toolkit/terminal/gwt/client/ui/IGridLayout.java

    r4792 r4794  
    5757                margins.hasLeft()); 
    5858 
     59        setStyleName(margin, CLASSNAME + "-" + "spacing", uidl 
     60                .hasAttribute("spacing")); 
     61 
    5962        grid.updateFromUIDL(uidl, client); 
    6063    } 
     
    7982        public Grid() { 
    8083            super(); 
    81             setStyleName(CLASSNAME); 
     84            setStyleName(CLASSNAME + "-grid"); 
    8285        } 
    8386 
     
    133136                            } 
    134137 
    135                             getCellFormatter() 
    136                                     .setAlignment(row, column, ha, va); 
     138                            FlexCellFormatter formatter = (FlexCellFormatter) getCellFormatter(); 
     139 
     140                            formatter.setAlignment(row, column, ha, va); 
    137141 
    138142                            // set col span 
    139                             ((FlexCellFormatter) getCellFormatter()) 
    140                                     .setColSpan(row, column, w); 
     143                            formatter.setColSpan(row, column, w); 
     144 
     145                            String styleNames = CLASSNAME + "-cell"; 
     146                            if (column == 0) { 
     147                                styleNames += " " + CLASSNAME + "-firstcol"; 
     148                            } 
     149                            if (row == 0) { 
     150                                styleNames += " " + CLASSNAME + "-firstrow"; 
     151                            } 
     152                            formatter.setStyleName(row, column, styleNames); 
    141153 
    142154                            // Set cell height 
  • branches/5.2/src/com/itmill/toolkit/tests/tickets/Ticket1572.java

    r4792 r4794  
    4747 
    4848        Button b2 = new Button("next spacing state"); 
    49         b.addListener(new Button.ClickListener() { 
     49        b2.addListener(new Button.ClickListener() { 
    5050            public void buttonClick(ClickEvent event) { 
    5151                nextSpacingState(); 
     
    102102    } 
    103103 
     104    private boolean spacing = true; 
     105 
    104106    private void nextSpacingState() { 
    105         spacingstate.setValue("        // TODO Auto-generated method stub"); 
     107        spacing = !spacing; 
     108        if (spacing) { 
     109            gl.setSpacing(true); 
     110            spacingstate.setValue("Spacing on"); 
     111        } else { 
     112            gl.setSpacing(false); 
     113            spacingstate.setValue("Spacing off"); 
     114        } 
    106115    } 
    107116