@@ -0,0 +1,2223 @@
+package org.commcare.suite.model;%0A%0A/**%0A * Created by willpride on 4/13/16.%0A */%0Apublic class Style %7B%0A%0A    private DisplayFormat displayFormats;%0A    private int fontSize;%0A    private int widthHint;%0A%0A    public Style()%7B%7D%0A%0A    public Style(DetailField detail)%7B%0A        if(detail.getFontSize() != null) %7B%0A            try %7B%0A                setFontSize(Integer.parseInt(detail.getFontSize()));%0A            %7D catch (NumberFormatException nfe) %7B%0A                setFontSize(12);%0A            %7D%0A        %7D%0A        // For width, default to -1 since '0' is reserved for hidden (Search) fiekds%0A        if(detail.getTemplateWidthHint() != null) %7B%0A            try %7B%0A                setWidthHint(Integer.parseInt(detail.getTemplateWidthHint()));%0A            %7D catch (NumberFormatException nfe) %7B%0A                setWidthHint(-1);%0A            %7D%0A        %7D else %7B%0A            setWidthHint(-1);%0A        %7D%0A        setDisplayFormatFromString(detail.getTemplateForm());%0A    %7D%0A%0A    enum DisplayFormat %7B%0A        Image,%0A        Audio,%0A        Text,%0A        Graph%0A    %7D%0A%0A    public DisplayFormat getDisplayFormat() %7B%0A        return displayFormats;%0A    %7D%0A%0A    private void setDisplayFormat(DisplayFormat displayFormats) %7B%0A        this.displayFormats = displayFormats;%0A    %7D%0A%0A    public int getFontSize() %7B%0A        return fontSize;%0A    %7D%0A%0A    private void setFontSize(int fontSize) %7B%0A        this.fontSize = fontSize;%0A    %7D%0A%0A    public int getWidthHint() %7B%0A        return widthHint;%0A    %7D%0A%0A    private void setWidthHint(int widthHint) %7B%0A        this.widthHint = widthHint;%0A    %7D%0A%0A    private void setDisplayFormatFromString(String displayFormat)%7B%0A        switch (displayFormat) %7B%0A            case %22image%22:%0A                setDisplayFormat(DisplayFormat.Image);%0A                break;%0A            case %22audio%22:%0A                setDisplayFormat(DisplayFormat.Audio);%0A                break;%0A            case %22text%22:%0A                setDisplayFormat(DisplayFormat.Text);%0A                break;%0A            case %22graph%22:%0A                setDisplayFormat(DisplayFormat.Graph);%0A                break;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public String toString()%7B%0A        return %22Style: %5BdisplayFormat=%22 + displayFormats + %22, fontSize=%22 + fontSize + %22%5D%22;%0A    %7D%0A%7D%0A

Add Style