Changeset 4788

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

Merged [4744] from trunk to 5.2 branch: fixes #1775 (CustomLayout? does not remove component from an emptied slot)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/5.2/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java

    r3935 r4788  
    66 
    77import java.util.HashMap; 
     8import java.util.HashSet; 
    89import java.util.Iterator; 
     10import java.util.Set; 
    911 
    1012import com.google.gwt.user.client.DOM; 
     
    137139 
    138140        iLayout(); 
     141 
     142        Set oldWidgets = new HashSet(); 
     143        oldWidgets.addAll(locationToWidget.values()); 
    139144 
    140145        // For all contained widgets 
     
    151156                    // If no location is found, this component is not visible 
    152157                } 
     158                oldWidgets.remove(child); 
     159            } 
     160        } 
     161        for (Iterator iterator = oldWidgets.iterator(); iterator.hasNext();) { 
     162            Widget oldWidget = (Widget) iterator.next(); 
     163            if (oldWidget.isAttached()) { 
     164                // slot of this widget is emptied, remove it 
     165                remove(oldWidget); 
    153166            } 
    154167        }