Subversion Repositories SmartDukaan

Rev

Rev 37782 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37782 Rev 37805
Line 226... Line 226...
226
    public String getColorNatural() {
226
    public String getColorNatural() {
227
        return this.color;
227
        return this.color;
228
    }
228
    }
229
 
229
 
230
    public void setColor(String color) {
230
    public void setColor(String color) {
-
 
231
        this.color = normalizeColor(color);
-
 
232
    }
-
 
233
 
-
 
234
    /** Also drops a space after the f_ prefix: an uploaded "f_ Black" reads " Black" everywhere. */
-
 
235
    public static String normalizeColor(String color) {
231
        this.color = com.spice.profitmandi.common.util.StringUtils.normalizeWhitespace(color);
236
        color = com.spice.profitmandi.common.util.StringUtils.normalizeWhitespace(color);
-
 
237
        if (color != null && (color.startsWith("f_") || color.startsWith("F_"))) {
-
 
238
            return color.substring(0, 2) + color.substring(2).trim();
-
 
239
        }
-
 
240
        return color;
232
    }
241
    }
233
 
242
 
234
    public ItemType getType() {
243
    public ItemType getType() {
235
        return type;
244
        return type;
236
    }
245
    }