cuba-platform / documentation

CUBA Platform Documentation
https://www.cuba-platform.com
Creative Commons Attribution 4.0 International
25 stars 45 forks source link

Improper code formatting in setStyleProvider paragraph #716

Closed Flaurite closed 4 years ago

Flaurite commented 4 years ago

Environment

Description of the bug or enhancement

Expected result

@Subscribe
protected void onInit(InitEvent event) {
    customersTable.setStyleProvider((customer, property) -> {
        if (property == null) {
            // style for row
            if (hasComplaints(customer)) {
                return "unsatisfied-customer";
            }
        } else if (property.equals("grade")) {
            // style for column "grade"
            switch (customer.getGrade()) {
                case PREMIUM: return "premium-grade";
                case HIGH: return "high-grade";
                case MEDIUM: return "medium-grade";
                default: return null;
            }
        }
        return null;
    });
}

Actual result

@Subscribe
protected void onInit(InitEvent event) {
    customersTable.setStyleProvider((customer, property) -> {
        if (property == null) {
        // style for row
        if (hasComplaints(customer)) {
            return "unsatisfied-customer";
        }
    } else if (property.equals("grade")) {
        // style for column "grade"
        switch (customer.getGrade()) {
            case PREMIUM: return "premium-grade";
            case HIGH: return "high-grade";
            case MEDIUM: return "medium-grade";
            default: return null;
        }
    }
        return null;
    });
}