Changeset 4771

Show
Ignore:
Timestamp:
06/06/08 08:40:32 (6 months ago)
Author:
marc.englund@…
Message:

Fixed multiple bugs in ProgressIndicator?: polled even if disabled or invisible (#1581), had no isIndeterminate(), did not call requestRepaint() when changing polling interval or indeterminate mode.

Location:
trunk
Files:
1 added
3 modified

Legend:

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

    r3259 r4771  
    11.i-progressindicator { 
    22        background: #dfe2e4 url(img/base.gif); 
     3        height: 9px; 
     4        border: 1px solid #b6bbbc; 
     5        overflow: hidden; /* for IE6 */ 
     6} 
     7 
     8.i-progressindicator-disabled { 
     9        background: #dfe2e4 url(img/disabled.gif); 
    310        height: 9px; 
    411        border: 1px solid #b6bbbc; 
     
    1825        overflow: hidden; /* for IE6 */ 
    1926} 
     27.i-progressindicator-disabled-indeterminate { 
     28        background: #dfe2e4 url(../common/img/blank.gif); 
     29        height: 16px; 
     30        width: 16px; 
     31        overflow: hidden; /* for IE6 */ 
     32} 
  • trunk/src/com/itmill/toolkit/terminal/gwt/client/ui/IProgressIndicator.java

    r3258 r4771  
    4242        indeterminate = uidl.getBooleanAttribute("indeterminate"); 
    4343 
     44        String style = CLASSNAME; 
     45        if (uidl.getBooleanAttribute("disabled")) { 
     46            style += "-disabled"; 
     47        } 
     48 
    4449        if (indeterminate) { 
    45             this.setStyleName(CLASSNAME + "-indeterminate"); 
     50            this.setStyleName(style + "-indeterminate"); 
    4651        } else { 
     52            setStyleName(style); 
    4753            try { 
    4854                final float f = Float.parseFloat(uidl 
     
    5359            } 
    5460        } 
    55         poller.scheduleRepeating(uidl.getIntAttribute("pollinginterval")); 
     61 
     62        if (!uidl.getBooleanAttribute("disabled")) { 
     63            poller.scheduleRepeating(uidl.getIntAttribute("pollinginterval")); 
     64        } 
     65    } 
     66 
     67    public void setVisible(boolean visible) { 
     68        super.setVisible(visible); 
     69        if (!visible) { 
     70            poller.cancel(); 
     71        } 
    5672    } 
    5773 
  • trunk/src/com/itmill/toolkit/ui/ProgressIndicator.java

    r3162 r4771  
    215215 
    216216    /** 
    217      * Sets the ProgressIndicator to indeterminate mode. 
     217     * Sets wheter or not the ProgressIndicator is indeterminate. 
    218218     *  
    219219     * @param newValue 
     
    222222    public void setIndeterminate(boolean newValue) { 
    223223        indeterminate = newValue; 
     224        requestRepaint(); 
     225    } 
     226 
     227    /** 
     228     * Gets whether or not the ProgressIndicator is indeterminate. 
     229     *  
     230     * @return true to set to indeterminate mode. 
     231     */ 
     232    public boolean isIndeterminate() { 
     233        return indeterminate; 
    224234    } 
    225235 
     
    232242    public void setPollingInterval(int newValue) { 
    233243        pollingInterval = newValue; 
     244        requestRepaint(); 
    234245    } 
    235246