Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1670)

Unified Diff: samples/simple_todo/java/TodoView.java

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/simple_todo/java/TodoController.java ('k') | samples/simple_todo/simple_todo.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/simple_todo/java/TodoView.java
diff --git a/samples/simple_todo/java/TodoView.java b/samples/simple_todo/java/TodoView.java
deleted file mode 100644
index ff54d9e04b0ccb258fd8f2b52cb09602a7be50fe..0000000000000000000000000000000000000000
--- a/samples/simple_todo/java/TodoView.java
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE.md file.
-
-import dartino.*;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import java.lang.NumberFormatException;
-
-class TodoView {
- public TodoView() { }
-
- public void showMenu() {
- String menu =
- "\n" +
- " #### Todo Menu ####\n" +
- "m\t-show this menu\n" +
- "l\t-list todo items\n" +
- "a\t-add todo item\n" +
- "t\t-toggle todo item done/undone\n" +
- "c\t-clear done items\n" +
- "d\t-delete item\n" +
- "q\t-quit application";
- System.out.println(menu);
- }
-
- private String readLine() {
- try {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- String input = br.readLine();
- return input;
- } catch (IOException exception) {
- exception.printStackTrace();
- }
- return null;
- }
-
- public String getInput() {
- return readLine();
- }
-
- // TODO(zarah): In a multithreaded setting this should be atomic or extend
- // the service with a List<Item> getItems to use here instead.
- public void listTodoItems() {
- int count = TodoService.getNoItems();
- System.out.println("-------------------- ToDo's --------------------");
- System.out.printf("Listing %2d items\n", count);
- for (int i = 0; i < count; ++i) {
- TodoItem item = TodoService.getItem(i);
- String done = item.getDone() ? "+" : " ";
- System.out.printf("%2d: %s [%s] \n", item.getId(), item.getTitle(), done);
- }
- System.out.println("------------------------------------------------");
- }
-
- public void addTodoItem() {
- System.out.println("Add Todo Item:");
- System.out.print("Title: ");
- String title = readLine();
- System.out.println();
-
- int size = 56 + BoxStringBuilder.kSize + title.length();
- MessageBuilder messageBuilder = new MessageBuilder(size);
- BoxStringBuilder stringBuilder = new BoxStringBuilder();
- messageBuilder.initRoot(stringBuilder, BoxStringBuilder.kSize);
- stringBuilder.setS(title);
- TodoService.createItem(stringBuilder);
- }
-
- public void toggleTodoItem() {
- System.out.print("[t] Enter id: ");
- String idString = readLine();
- try {
- int id = Integer.parseInt(idString);
- TodoService.toggle(id);
- } catch (NumberFormatException exception) {
- // Ignore bad input.
- }
- }
-
- public void clearDoneItems() {
- TodoService.clearItems();
- }
-
- public void deleteItem() {
- System.out.print("[d] Enter id: ");
- String idString = readLine();
- try {
- int id = Integer.parseInt(idString);
- TodoService.deleteItem(id);
- } catch (NumberFormatException exception) {
- // Ignore bad input.
- }
- }
-}
« no previous file with comments | « samples/simple_todo/java/TodoController.java ('k') | samples/simple_todo/simple_todo.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698