package seedu.jimi.logic.commands;

import java.util.Arrays;
import java.util.List;

import seedu.jimi.model.ModelManager;

/**
 * Shows certain sections of the task panel to the user.
 * @author zexuan
 *
 */
public class ShowCommand extends Command {

    public static final String COMMAND_WORD = "show";
    
    public static final List<String> VALID_KEYWORDS = Arrays.asList(
            "floating", 
            "incomplete", 
            "complete",
            "today", 
            "tomorrow", 
            "Monday", 
            "Tuesday", 
            "Wednesday", 
            "Thursday", 
            "Friday", 
            "Saturday", 
            "Sunday" 
    );
    
    public static final String MESSAGE_USAGE = 
            COMMAND_WORD + ": Shows certain sections of the task panel in the agenda panel. \n"
            + "Parameters: NAME_OF_SECTION_TO_DISPLAY\n" 
            + "Example: " + COMMAND_WORD + " floating tasks\n"
            + "> Valid Keywords: Floating Tasks, Completed Tasks, Incomplete Tasks, Today, Tomorrow, {day of week displayed}";

    public static final String MESSAGE_SUCCESS = "Displayed tasks and events.";
    
    private final String sectionToShow; //section name from user input
    
    public ShowCommand() {
        this.sectionToShow = "";
    }
    
    public ShowCommand(String args) {
        this.sectionToShow = args;
    }
    
    /**
     * Updates the agenda lists with new relevant predicates to update lists show to user.
     */
    @Override
    public CommandResult execute() {
        ((ModelManager) model).showTaskPanelSection(sectionToShow);
        
        model.updateFilteredAgendaTaskList(null, sectionToShow);
        model.updateFilteredAgendaEventList(null, sectionToShow);
        
        return new CommandResult(MESSAGE_SUCCESS);
    }

    @Override
    public boolean isValidCommandWord(String commandWord) {
        for (int i = 1; i <= COMMAND_WORD.length(); i++) {
            if (commandWord.equals(COMMAND_WORD.substring(0, i))) {
                return true;
            }
        }
        return false;
    }

}

@@ -1662,29 +1662,51 @@
 daTaskList(n
-ull, 
+ew HashSet%3C%3E(Arrays.asList(
 sectionToSho
@@ -1699,32 +1699,34 @@
 t(sectionToShow)
+))
 ;%0A        model.
@@ -1760,13 +1760,35 @@
 st(n
-ull, 
+ew HashSet%3C%3E(Arrays.asList(
 sect
@@ -1789,32 +1789,34 @@
 t(sectionToShow)
+))
 ;%0A        %0A     

fix imports and method calls