// Path: emailclient-tutorial-data/src/main/java/org/vaadin/example/backend/MessageFacade.java
// @Stateless
// public class MessageFacade {
// 
//     public static final String FOLDER_INBOX = "inbox";
//     public static final String FOLDER_DRAFTS = "drafts";
//     public static final String FOLDER_SENT = "sent";
//     public static final String FOLDER_JUNK = "junk";
//     public static final String FOLDER_TRASH = "trash";
//     public static final String FOLDER_FLAGGED = "flagged";
//     public static final List<String> FOLDERS = Arrays.asList(FOLDER_INBOX,
//             FOLDER_DRAFTS, FOLDER_SENT, FOLDER_JUNK, FOLDER_TRASH,
//             FOLDER_FLAGGED);
// 
//     @Inject
//     private MessageRepository repository;
// 
//     public List<Message> getFolderMessages(String folder) {
//         if (FOLDERS.contains(folder)) {
//             if (folder.equals(FOLDER_INBOX)) {
//                 return repository.findAll();
//             } else if (folder.equals(FOLDER_FLAGGED)) {
//                 return repository.findByFlagIsNotNullAndTrashed(false);
//             }
//         }
//         return new ArrayList<>();
//     }
// 
//     public long countAllUnread() {
//         return repository.findByRead(false).count();
// 
//     }
// 
//     public long countFlaggedUnread() {
//         return repository.findByFlagIsNotNullAndRead(false).count();
//     }
// 
//     public void save(Message message) {
//         repository.saveAndFlush(message);
//     }
// }
// 
// Path: emailclient-tutorial-data/src/main/java/org/vaadin/example/ui/themes/mytheme/MyTheme.java
// public class MyTheme {
//     public static final String INDICATOR_STAR_RED = "indicator-star-red";
//     public static final String INDICATOR_CIRCLE = "indicator-circle";
//     public static final String SELECTED = "selected";
// 
//     public static final List<String> MESSAGE_STYLES = Collections
//             .unmodifiableList(Arrays.asList(MyTheme.INDICATOR_CIRCLE,
//                     MyTheme.INDICATOR_STAR_RED));
// }


import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
import javax.annotation.PostConstruct;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import org.vaadin.example.backend.MessageFacade;
import org.vaadin.example.ui.themes.mytheme.MyTheme;
import com.vaadin.cdi.UIScoped;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.UI;
package org.vaadin.example.ui;





/**
 * 
 * Handles the left-side menu and the top toolbar
 */
@UIScoped
public class MainLayout extends MainLayoutDesign {

    @Inject
// Path: emailclient-tutorial-data/src/main/java/org/vaadin/example/backend/MessageFacade.java
// @Stateless
// public class MessageFacade {
// 
//     public static final String FOLDER_INBOX = "inbox";
//     public static final String FOLDER_DRAFTS = "drafts";
//     public static final String FOLDER_SENT = "sent";
//     public static final String FOLDER_JUNK = "junk";
//     public static final String FOLDER_TRASH = "trash";
//     public static final String FOLDER_FLAGGED = "flagged";
//     public static final List<String> FOLDERS = Arrays.asList(FOLDER_INBOX,
//             FOLDER_DRAFTS, FOLDER_SENT, FOLDER_JUNK, FOLDER_TRASH,
//             FOLDER_FLAGGED);
// 
//     @Inject
//     private MessageRepository repository;
// 
//     public List<Message> getFolderMessages(String folder) {
//         if (FOLDERS.contains(folder)) {
//             if (folder.equals(FOLDER_INBOX)) {
//                 return repository.findAll();
//             } else if (folder.equals(FOLDER_FLAGGED)) {
//                 return repository.findByFlagIsNotNullAndTrashed(false);
//             }
//         }
//         return new ArrayList<>();
//     }
// 
//     public long countAllUnread() {
//         return repository.findByRead(false).count();
// 
//     }
// 
//     public long countFlaggedUnread() {
//         return repository.findByFlagIsNotNullAndRead(false).count();
//     }
// 
//     public void save(Message message) {
//         repository.saveAndFlush(message);
//     }
// }
// 
// Path: emailclient-tutorial-data/src/main/java/org/vaadin/example/ui/themes/mytheme/MyTheme.java
// public class MyTheme {
//     public static final String INDICATOR_STAR_RED = "indicator-star-red";
//     public static final String INDICATOR_CIRCLE = "indicator-circle";
//     public static final String SELECTED = "selected";
// 
//     public static final List<String> MESSAGE_STYLES = Collections
//             .unmodifiableList(Arrays.asList(MyTheme.INDICATOR_CIRCLE,
//                     MyTheme.INDICATOR_STAR_RED));
// }


// Path: emailclient-tutorial-data/src/main/java/org/vaadin/example/ui/MainLayout.java
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
import javax.annotation.PostConstruct;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import org.vaadin.example.backend.MessageFacade;
import org.vaadin.example.ui.themes.mytheme.MyTheme;
import com.vaadin.cdi.UIScoped;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.UI;

package org.vaadin.example.ui;





/**
 * 
 * Handles the left-side menu and the top toolbar
 */
@UIScoped
public class MainLayout extends MainLayoutDesign {

    @Inject
    private MessageFacade messageFacade;