Skip to content

Commit

Permalink
Fix list response
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluiexo authored and Pluiexo committed Feb 21, 2024
1 parent e5fedd4 commit 7bac5d2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/main/java/duke/task/TaskManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,11 @@ public String[] listItems() {
return new String[]{RESPONSE_EMPTY};

}
String[] ret = new String[items.size()];
ret[0] = RESPONSE_LISTING;
for (int i = 0; i < items.size(); i++) {
ret[i] = i + 1 + ". " + items.get(i);
}
return ret;

List<String> print = iterateWithIndex((items.stream().map(Task::toString).collect(Collectors.toList())));
print.add(0, RESPONSE_VIEW_DATES);

return print.toArray(String[]::new);
}

public boolean getUpdate() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/duke/ui/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static String handleError(String msg) {
errorResponse = "OOPS!!! I'm sorry, incorrect command or input";
break;
default:
errorResponse = "invalid application, commence self-destruct >:(";
errorResponse = "Invalid application, commence self-destruct >:(";
}
return errorResponse;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/DialogBox.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.text.Font?>

<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefWidth="400.0" stylesheets="@../style/style.css" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefWidth="400.0" stylesheets="@../style/style.css" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label fx:id="dialog" minHeight="-Infinity" styleClass="dialogLabel" text="Label" wrapText="true">
<font>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="duke.ui.MainWindow">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="duke.ui.MainWindow">
<children>
<TextField fx:id="userInput" layoutY="558.0" onAction="#handleUserInput" prefHeight="41.0" prefWidth="324.0" AnchorPane.bottomAnchor="1.0" />
<Button fx:id="sendButton" layoutX="324.0" layoutY="558.0" mnemonicParsing="false" onAction="#handleUserInput" prefHeight="41.0" prefWidth="76.0" text="Send" />
Expand Down

0 comments on commit 7bac5d2

Please sign in to comment.