Changeset 4831

Show
Ignore:
Timestamp:
06/10/08 09:51:08 (4 months ago)
Author:
magi@…
Message:

Merged [4815] from trunk to 5.2 branch: margins + component spacings for formlayout, removed obsolete comment

Location:
branches/5.2
Files:
4 modified

Legend:

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

    r4627 r4831  
    88        text-align:right; 
    99} 
     10 
     11.i-formlayout-spacing .i-formlayout-row .i-formlayout-captioncell,  
     12.i-formlayout-spacing .i-formlayout-row .i-formlayout-contentcell, 
     13.i-formlayout-spacing .i-formlayout-row .i-formlayout-errorcell { 
     14        padding-top: 8px; 
     15} 
     16 
     17.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-captioncell,  
     18.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-contentcell, 
     19.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-errorcell { 
     20        padding-top: 0; 
     21} 
     22 
     23.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-captioncell,  
     24.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-contentcell, 
     25.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-errorcell { 
     26        padding-top: 15px; 
     27} 
     28.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-captioncell, 
     29.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-contentcell, 
     30.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-errorcell { 
     31        padding-bottom: 15px; 
     32} 
     33.i-formlayout-margin-left .i-formlayout-captioncell { 
     34        padding-left: 18px; 
     35}  
     36.i-formlayout-margin-right .i-formlayout-contentcell { 
     37        padding-right: 18px; 
     38} 
     39 
     40/* form */ 
     41 
    1042.i-form-errormessage { 
    1143        background: transparent url(../icons/16/error.png) no-repeat top left; 
  • branches/5.2/WebContent/ITMILL/themes/default/styles.css

    r4830 r4831  
    509509        text-align:right; 
    510510} 
     511 
     512.i-formlayout-spacing .i-formlayout-row .i-formlayout-captioncell,  
     513.i-formlayout-spacing .i-formlayout-row .i-formlayout-contentcell, 
     514.i-formlayout-spacing .i-formlayout-row .i-formlayout-errorcell { 
     515        padding-top: 8px; 
     516} 
     517 
     518.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-captioncell,  
     519.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-contentcell, 
     520.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-errorcell { 
     521        padding-top: 0; 
     522} 
     523 
     524.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-captioncell,  
     525.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-contentcell, 
     526.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-errorcell { 
     527        padding-top: 15px; 
     528} 
     529.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-captioncell, 
     530.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-contentcell, 
     531.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-errorcell { 
     532        padding-bottom: 15px; 
     533} 
     534.i-formlayout-margin-left .i-formlayout-captioncell { 
     535        padding-left: 18px; 
     536}  
     537.i-formlayout-margin-right .i-formlayout-contentcell { 
     538        padding-right: 18px; 
     539} 
     540 
     541/* form */ 
     542 
    511543.i-form-errormessage { 
    512544        background: transparent url(icons/16/error.png) no-repeat top left; 
  • branches/5.2/src/com/itmill/toolkit/terminal/gwt/client/ui/IFormLayout.java

    r4664 r4831  
    1818import com.itmill.toolkit.terminal.gwt.client.ErrorMessage; 
    1919import com.itmill.toolkit.terminal.gwt.client.Paintable; 
     20import com.itmill.toolkit.terminal.gwt.client.StyleConstants; 
    2021import com.itmill.toolkit.terminal.gwt.client.UIDL; 
    2122import com.itmill.toolkit.terminal.gwt.client.Util; 
     
    2627public class IFormLayout extends FlexTable implements Container { 
    2728 
     29    private final static String CLASSNAME = "i-formlayout"; 
     30 
    2831    HashMap componentToCaption = new HashMap(); 
    2932    private ApplicationConnection client; 
     
    3639            return; 
    3740        } 
     41 
     42        final MarginInfo margins = new MarginInfo(uidl 
     43                .getIntAttribute("margins")); 
     44 
     45        Element margin = getElement(); 
     46        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP, 
     47                margins.hasTop()); 
     48        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT, 
     49                margins.hasRight()); 
     50        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_BOTTOM, 
     51                margins.hasBottom()); 
     52        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_LEFT, 
     53                margins.hasLeft()); 
     54 
     55        setStyleName(margin, CLASSNAME + "-" + "spacing", uidl 
     56                .hasAttribute("spacing")); 
    3857 
    3958        int i = 0; 
     
    6079                setWidget(i, 2, (Widget) p); 
    6180            } 
    62             getCellFormatter().setStyleName(i, 0, "i-formlayout-captioncell"); 
     81            getCellFormatter().setStyleName(i, 2, CLASSNAME + "-contentcell"); 
     82            getCellFormatter().setStyleName(i, 0, CLASSNAME + "-captioncell"); 
    6383            setWidget(i, 0, caption); 
    6484 
    65             getCellFormatter().setStyleName(i, 1, "i-formlayout-errorcell"); 
     85            getCellFormatter().setStyleName(i, 1, CLASSNAME + "-errorcell"); 
    6686            setWidget(i, 1, error); 
    6787 
    6888            p.updateFromUIDL(childUidl, client); 
     89 
     90            String rowstyles = CLASSNAME + "-row"; 
     91            if (i == 0) { 
     92                rowstyles += " " + CLASSNAME + "-firstrow"; 
     93            } 
     94            if (!it.hasNext()) { 
     95                rowstyles += " " + CLASSNAME + "-lastrow"; 
     96            } 
     97 
     98            getRowFormatter().setStyleName(i, rowstyles); 
    6999 
    70100        } 
  • branches/5.2/src/com/itmill/toolkit/terminal/gwt/client/ui/IGridLayout.java

    r4794 r4831  
    4646                .getIntAttribute("margins")); 
    4747 
    48         // 1572 
    4948        Element margin = getElement(); 
    5049        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP,