Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some other feature such as pressing esc key to clear command box #64

Merged
merged 1 commit into from
Oct 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/main/java/seedu/malitio/ui/CommandBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ public String getFxmlPath() {
public void setPlaceholder(AnchorPane pane) {
this.placeHolderPane = pane;
}

/**
* Clears the command box
*/
public void clearCommandBox() {
commandTextField.clear();
}


@FXML
Expand Down Expand Up @@ -110,5 +117,5 @@ private void restoreCommandText() {
private void setStyleToIndicateIncorrectCommand() {
commandTextField.getStyleClass().add("error");
}

}
9 changes: 9 additions & 0 deletions src/main/java/seedu/malitio/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public class MainWindow extends UiPart {

@FXML
private MenuItem helpMenuItem;

@FXML
private MenuItem clearCommandBoxMenuItem;

@FXML
private AnchorPane taskListPanelPlaceholder;
Expand Down Expand Up @@ -111,6 +114,7 @@ private void configure(String appTitle, String malitioName, Config config, UserP

private void setAccelerators() {
helpMenuItem.setAccelerator(KeyCombination.valueOf("F1"));
clearCommandBoxMenuItem.setAccelerator(KeyCombination.valueOf("ESC"));
}

void fillInnerParts() {
Expand Down Expand Up @@ -196,6 +200,11 @@ public void show() {
private void handleExit() {
raise(new ExitAppRequestEvent());
}

@FXML
private void clearCommandBox() {
commandBox.clearCommandBox();
}

public FloatingTaskListPanel getTaskListPanel() {
return this.taskListPanel;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" onAction="#handleExit" text="Exit" />
<MenuItem fx:id="clearCommandBoxMenuItem" mnemonicParsing="false" onAction="#clearCommandBox" text="Clear Command Box" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
Expand Down