public void add(String id, String title, String description) throws Exception { Task task = new Task(); task.setId(id); task.setTitle(title); task.setDescription(description); taskService.addTask(task); }
try{ TaskService taskService = ServiceGenerator.createService(TaskService.class); List<Task> tasks = taskService.getTasks(); //got a response, assume 200 ok... } catch (RetrofitError error){ Log.d(error.getBody().getStatus() + ""); }
public Task get(String id) throws Exception { return taskService.getTask(id); }
for (Task tempTask : TasksListAppObj.getInstance().tasksRepository.getTasksRepository()) { LatLng latlng = new LatLng(tempTask.getLatitude(), tempTask.getLongtitude()); if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_WAITING)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_IN_PROGRESS)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_bordo))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_ON_THE_WAY)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_turkiz))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_COMPLETE)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_orange))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_FAILED)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_purpul))); } }
private void showTask(PrintWriter writer, String taskId) { SimpleDateFormat sdf = new SimpleDateFormat(); Task task = taskService.getTask(taskId); if (task != null) { writer.println("<h1>Task " + task.getTitle() + " </h1>"); if (task.getDueDate() != null) { writer.println("Due date: " + sdf.format(task.getDueDate()) + "<br/>"); } writer.println(task.getDescription()); } else { writer.println("Task with id " + taskId + " not found"); } }
for (Task tempTask : tasksRepository) { LatLng latlng = new LatLng(tempTask.getLatitude(), tempTask.getLongtitude()); newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); }
RelativeLayout rl = (RelativeLayout) findViewById(R.id.relativeLayout3); final DatabaseHandler dbpin = new DatabaseHandler(this); Log.d("Reading: ", "Reading all tasks.."); List<Task> task1 = dbpin.getAllTask(); for (Task cn : task1) { String log = cn.getTitle(); int i = cn.getID(); Button button = new Button(this); button.setText("View" + i); button.setTextSize(10); button.setId(2000 + i); int width = 80; int height = 60; TextView textview = new TextView(this); textview.setText(log); textview.setWidth(200); textview.setTextSize(20); textview.setPadding( 0, 10, 0, 0); textview.setId(2000 + i); }
@Override public void addTask(Task task) { taskMap.put(task.getId(), task); }
@Override protected List<String> doInBackground(Void... arg0) { try { List<String> result = new ArrayList<String>(); com.google.api.services.tasks.Tasks.TasksOperations.List listRequest = service.tasks().list("@default"); listRequest.setFields("items/title,items/notes,items/completed"); //listRequest.setFields("items/title"); List<Task> tasks = listRequest.execute().getItems(); if (tasks != null) { for (Task task : tasks) { result.add(task.getTitle()); } } else { result.add("No tasks."); } return result; } catch (IOException e) { tasksSample.handleGoogleException(e); return Collections.singletonList(e.getMessage()); } finally { tasksSample.onRequestCompleted(); }
public void menuSelected(MenuItem selectedItem) { String id = (String) table.getValue(); taskService.deleteTask(id); table.removeItem(id); } });
public void valueChange(ValueChangeEvent event) { @SuppressWarnings("unchecked") BeanItem<Task> item = (BeanItem<Task>) form.getItemDataSource(); taskService.updateTask(item.getBean()); } });
public void menuSelected(MenuItem selectedItem) { Task task = new Task(); task.setId(UUID.randomUUID().toString()); task.setTitle("New Task"); task.setDescription("None"); taskService.addTask(task); beans.addBean(task); } });
for (Task tempTask : TasksListAppObj.getInstance().tasksRepository.getTasksRepository()) { LatLng latlng = new LatLng(tempTask.getLatitude(), tempTask.getLongtitude()); if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_WAITING)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_IN_PROGRESS)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_bordo))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_ON_THE_WAY)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_turkiz))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_COMPLETE)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_orange))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_FAILED)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_purpul))); } }
private void update(final BeanContainer<String, Task> beans) { beans.removeAllItems(); beans.addAll(taskService.getTasks()); }
@Override public void updateTask(Task task) { taskMap.put(task.getId(), task); }
public TaskServiceImpl() { taskMap = new HashMap<String, Task>(); Task task = new Task(); task.setId("1"); task.setTitle("Buy some coffee"); task.setDescription("Take the extra strong"); addTask(task); task = new Task(); task.setId("2"); task.setTitle("Finish karaf tutorial"); task.setDescription("Last check and wiki upload"); addTask(task); }
for (Task tempTask : SGTasksListAppObj.getInstance().tasksRepository.getTasksRepository()) { LatLng latlng = new LatLng(tempTask.getLatitude(),tempTask.getLongtitude()); if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_WAITING)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_IN_PROGRESS)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_bordo))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_ON_THE_WAY)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_turkiz))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_COMPLETE)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_orange))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_FAILED)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_purpul))); } }