Skip to content

Commit

Permalink
freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjiyi committed Apr 11, 2016
1 parent 01d8b16 commit 20aec7b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
11 changes: 6 additions & 5 deletions collated/A0123994W.md
Original file line number Diff line number Diff line change
Expand Up @@ -1308,30 +1308,31 @@ public class MainApp extends Application {
if (mainController != null) {
return mainController.getTaskAt(pos);
}
// Fallthrough
break;
case 2:
if (overdueController != null) {
return overdueController.getTaskAt(pos);
}
// Fallthrough
break;
case 3:
if (todayController != null) {
return todayController.getTaskAt(pos);
}
// Fallthrough
break;
case 4:
if (weekController != null) {
return weekController.getTaskAt(pos);
}
// Fallthrough
break;
case 5:
if (archiveController != null) {
return archiveController.getTaskAt(pos);
}
// Fallthrough
break;
default:
return null;
}
return null;
}

/**
Expand Down
38 changes: 17 additions & 21 deletions collated/A0130620B.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@ public class CaseExecuter {

protected void edit(String[] arg) {
actionOnIndex("EDIT", arg);

}

protected void delete(String[] arg) {
actionOnIndex("DELETE", arg);

}

protected void search(String[] arg) {
logic.search(arg);
logic.search(arg[0]);
}

protected void filter(String[] arg) {
Expand All @@ -101,27 +99,22 @@ public class CaseExecuter {

protected void label(String[] arg) {
actionOnIndex("LABEL", arg);

}

protected void setRecurring(String[] arg) {
actionOnIndex("SET-RECURRING", arg);

}

protected void removeRecurring(String[] arg) {
actionOnIndex("REMOVE-RECURRING", arg);

}

protected void postpone(String[] arg) {
actionOnIndex("POSTPONE", arg);

}

protected void forward(String[] arg) {
actionOnIndex("FORWARD", arg);

}

protected void addRemind(String[] arg) {
Expand All @@ -142,17 +135,14 @@ public class CaseExecuter {

protected void remindBef(String[] arg) {
actionOnIndex("REMIND-BEF", arg);

}

protected void removeRemind(String[] arg) {
actionOnIndex("REMOVE-REMIND", arg);

}

protected void done(String[] arg) {
actionOnIndex("DONE", arg);

}

protected void undone(String[] arg) {
Expand Down Expand Up @@ -1824,12 +1814,9 @@ public class Logic {
* the keyword in title to search for
* @return Boolean return true if there is at one search result
*/
public Boolean search(String[] keyword) {
String input = keyword[0];

for (int i = 1; i < keyword.length; i++) {
input = input + " " + keyword[i];
}
public Boolean search(String input) {

String[] keyword = input.split(" ");

logger.logAction(COMPONENT_LOGIC, ResponseMessage.MESSAGE_SEARCHING_TASK + input);

Expand Down Expand Up @@ -2202,14 +2189,18 @@ public class Logic {
logger.logAction(COMPONENT_LOGIC, ResponseMessage.MESSAGE_EDITING_TASK + title);

Task tempTask = dataBase.retrieve(new SearchCommand("NAME", title)).get(0);

Boolean deleteResponse = dataBase.delete(tempTask);

tempTask.setReminder(new Reminder(false, null));

Boolean addResponse = dataBase.add(tempTask);

return addResponse&&deleteResponse;
uiHandler.refresh();
uiHandler.highLight(tempTask);
uiHandler.sendMessage(String.format(ResponseMessage.MESSAGE_SUCCESS_REMOVE_REMIND, truncateTitle(title)), true);

return addResponse && deleteResponse;
}

/**
Expand Down Expand Up @@ -2666,6 +2657,7 @@ public final class ResponseMessage {
protected static final String MESSAGE_SUCCESS_UNARCHIVE = "[%1$s] has been unarchived! (not what you want? try 'undo 1')";
protected static final String MESSAGE_SUCCESS_ARCHIVE = "[%1$s] has been archived! (not what you want? try 'undo 1')";
protected static final String MESSAGE_SUCCESS_REMIND = "[%1$s] is set to trigger a reminder on %2$s. (not what you want? try 'undo 1')";
protected static final String MESSAGE_SUCCESS_REMOVE_REMIND = "[%1$s]'s reminder is removed. (not what you want? try 'undo 1')";
protected static final String MESSAGE_SUCCESS_FORWARD = "[%1$s] has been brought forward! (not what you want? try 'undo 1')";
protected static final String MESSAGE_SUCCESS_POSTPONE = "[%1$s] has been postponed! (not what you want? try 'undo 1')";
protected static final String MESSAGE_SUCCESS_NON_RECURRING = "[%1$s] is now a one-time-off task. (not what you want? try 'undo 1')";
Expand Down Expand Up @@ -2794,6 +2786,8 @@ public class ErrorBase {
"Your command to EDIT TASK was incomplete! Please check HELP for formats.");
errorBase.put(("FILTER" + "INCOMPLETE"),
"Your command to FILTER (CATEGORY) was incomplete! Please check HELP for formats.");
errorBase.put(("SEARCH" + "INCOMPLETE"),
"Your command to SEARCH (KEYWORD) was incomplete! Please check HELP for formats.");
errorBase.put(("SET-RECURRING" + "INCOMPLETE"),
"Your command to SET RECURRENCE was incomplete! Please check HELP for formats.");
errorBase.put(("LABEL" + "INCOMPLETE"),
Expand All @@ -2819,7 +2813,7 @@ public class ErrorBase {
errorBase.put(("TAB" + "INCOMPLETE"),
"Your command to CHANGE TAB was incomplete! Please check HELP for formats.");
errorBase.put(("ADD" + "REPEAT TITLE"), "You might have added this task before! Try a different TASK TITLE.");
errorBase.put(("SORT" + "NO FIELD"), "Your command to SORT was incomplete! Please check HELP for formats.");
errorBase.put(("SORT" + "INCOMPLETE"), "Your command to SORT was incomplete! Please check HELP for formats.");
errorBase.put(("ADD EVENT" + "INVALID TIME UNIT"),
"You have specified a TIME UNIT that I don't understand! Try {minute, hour, day, week, month, year}.");
errorBase.put(("ADD EVENT" + "INVALID QUANTITY"),
Expand Down Expand Up @@ -3224,8 +3218,10 @@ public class FlexiCommandParser {

if (dates.size() == 1) {
return addDeadline(input, result, dates);
} else {
} else if (dates.size() == 2){
return addEvent(result, dates);
} else {
return addTask(input);
}
}
}
Expand Down

0 comments on commit 20aec7b

Please sign in to comment.