Changeset 4808

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

Merged [4802] from trunk to 5.2 branch: fixes #1782 (Components should not be moved to new layout when replacing layout)

Location:
branches/5.2
Files:
3 modified

Legend:

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

    r4794 r4808  
    529529        padding-top:15px; 
    530530} 
     531 
    531532.i-gridlayout-spacing .i-gridlayout-firstcol { 
    532533        padding-left: 0; 
     
    820821} 
    821822 
     823.i-progressindicator-disabled { 
     824        background: #dfe2e4 url(progressindicator/img/disabled.gif); 
     825        height: 9px; 
     826        border: 1px solid #b6bbbc; 
     827        overflow: hidden; /* for IE6 */ 
     828} 
     829 
    822830.i-progressindicator div { 
    823831        background: #f7f9f9 url(progressindicator/img/progress.png); 
     
    828836.i-progressindicator-indeterminate { 
    829837        background: #dfe2e4 url(common/img/ajax-loader-medium.gif); 
     838        height: 16px; 
     839        width: 16px; 
     840        overflow: hidden; /* for IE6 */ 
     841} 
     842.i-progressindicator-disabled-indeterminate { 
     843        background: #dfe2e4 url(common/img/blank.gif); 
    830844        height: 16px; 
    831845        width: 16px; 
  • branches/5.2/build/VERSION.properties

    r4730 r4808  
    1 version=5.2.1 
     1version=5.2.2 
  • branches/5.2/src/com/itmill/toolkit/ui/Panel.java

    r4620 r4808  
    109109 
    110110    /** 
    111      * Sets the layout of the panel. All the components are moved to new layout. 
    112      *  
    113      * @param layout 
     111     * Sets the layout of the panel. 
     112     *  
     113     * If given layout is null, an OrderedLayout is used as a default. 
     114     *  
     115     * Components from old layout are not moved to new layout by default 
     116     * (changed in 5.2.2). Use function in Layout interface manually. 
     117     *  
     118     * @param newLayout 
    114119     *                the New layout of the panel. 
    115120     */ 
    116     public void setLayout(Layout layout) { 
     121    public void setLayout(Layout newLayout) { 
    117122 
    118123        // Only allow non-null layouts 
    119         if (layout == null) { 
    120             layout = new OrderedLayout(); 
     124        if (newLayout == null) { 
     125            newLayout = new OrderedLayout(); 
    121126            // Force margins by default 
    122             layout.setMargin(true); 
    123         } 
    124  
    125         if (layout == this.layout) { 
     127            newLayout.setMargin(true); 
     128        } 
     129 
     130        if (newLayout == layout) { 
    126131            // don't set the same layout twice 
    127132            return; 
    128133        } 
    129134 
     135        // detach old layout if present 
     136        if (layout != null) { 
     137            layout.setParent(null); 
     138            layout 
     139                    .removeListener((ComponentContainer.ComponentAttachListener) this); 
     140            layout 
     141                    .removeListener((ComponentContainer.ComponentDetachListener) this); 
     142        } 
     143 
    130144        // Sets the panel to be parent for the layout 
    131         layout.setParent(this); 
    132  
    133         // If panel already contains a layout, move the contents to new one 
    134         // and detach old layout from the panel 
    135         if (this.layout != null) { 
    136             layout.moveComponentsFrom(this.layout); 
    137             this.layout.setParent(null); 
    138         } 
    139  
    140         // Removes the event listeners from the old layout 
    141         if (this.layout != null) { 
    142             this.layout 
    143                     .removeListener((ComponentContainer.ComponentAttachListener) this); 
    144             this.layout 
    145                     .removeListener((ComponentContainer.ComponentDetachListener) this); 
    146         } 
     145        newLayout.setParent(this); 
    147146 
    148147        // Sets the new layout 
    149         this.layout = layout; 
     148        layout = newLayout; 
    150149 
    151150        // Adds the event listeners for new layout 
    152         layout.addListener((ComponentContainer.ComponentAttachListener) this); 
    153         layout.addListener((ComponentContainer.ComponentDetachListener) this); 
     151        newLayout 
     152                .addListener((ComponentContainer.ComponentAttachListener) this); 
     153        newLayout 
     154                .addListener((ComponentContainer.ComponentDetachListener) this); 
    154155    } 
    155156