Changeset 4815

Show
Ignore:
Timestamp:
06/09/08 12:19:14 (6 months ago)
Author:
matti.tahvonen@…
Message:

margins + component spacings for formlayout, removed obsolete comment

Location:
trunk
Files:
4 modified

Legend:

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

    r4627 r4815  
    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; 
  • trunk/WebContent/ITMILL/themes/default/styles.css

    r4813 r4815  
    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; 
  • trunk/src/com/itmill/toolkit/terminal/gwt/client/ui/IFormLayout.java

    r4805 r4815  
    1717import com.itmill.toolkit.terminal.gwt.client.Container; 
    1818import com.itmill.toolkit.terminal.gwt.client.Paintable; 
     19import com.itmill.toolkit.terminal.gwt.client.StyleConstants; 
    1920import com.itmill.toolkit.terminal.gwt.client.UIDL; 
    2021import com.itmill.toolkit.terminal.gwt.client.Util; 
     
    2526public class IFormLayout extends FlexTable implements Container { 
    2627 
     28    private final static String CLASSNAME = "i-formlayout"; 
     29 
    2730    HashMap componentToCaption = new HashMap(); 
    2831    private ApplicationConnection client; 
     
    3538            return; 
    3639        } 
     40 
     41        final MarginInfo margins = new MarginInfo(uidl 
     42                .getIntAttribute("margins")); 
     43 
     44        Element margin = getElement(); 
     45        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP, 
     46                margins.hasTop()); 
     47        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT, 
     48                margins.hasRight()); 
     49        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_BOTTOM, 
     50                margins.hasBottom()); 
     51        setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_LEFT, 
     52                margins.hasLeft()); 
     53 
     54        setStyleName(margin, CLASSNAME + "-" + "spacing", uidl 
     55                .hasAttribute("spacing")); 
    3756 
    3857        int i = 0; 
     
    5978                setWidget(i, 2, (Widget) p); 
    6079            } 
    61             getCellFormatter().setStyleName(i, 0, "i-formlayout-captioncell"); 
     80            getCellFormatter().setStyleName(i, 2, CLASSNAME + "-contentcell"); 
     81            getCellFormatter().setStyleName(i, 0, CLASSNAME + "-captioncell"); 
    6282            setWidget(i, 0, caption); 
    6383 
    64             getCellFormatter().setStyleName(i, 1, "i-formlayout-errorcell"); 
     84            getCellFormatter().setStyleName(i, 1, CLASSNAME + "-errorcell"); 
    6585            setWidget(i, 1, error); 
    6686 
    6787            p.updateFromUIDL(childUidl, client); 
     88 
     89            String rowstyles = CLASSNAME + "-row"; 
     90            if (i == 0) { 
     91                rowstyles += " " + CLASSNAME + "-firstrow"; 
     92            } 
     93            if (!it.hasNext()) { 
     94                rowstyles += " " + CLASSNAME + "-lastrow"; 
     95            } 
     96 
     97            getRowFormatter().setStyleName(i, rowstyles); 
    6898 
    6999        } 
  • trunk/src/com/itmill/toolkit/terminal/gwt/client/ui/IGridLayout.java

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