public void setTarget(OWLEntity target) {
   currentTarget = target;
   UserId userId = Application.get().getUserId();
   view.setPostNewTopicEnabled(currentTarget != null && !userId.isGuest());
   view.setPostNewTopicHandler(new PostNewTopicHandlerImpl(Optional.fromNullable(currentTarget)));
   reload();
 }
 private void appendNote(Note note, int depth, DiscussionThread discussionThread) {
   NoteContainerPresenter noteContainerPresenter =
       new NoteContainerPresenter(new NoteContainerViewImpl());
   noteContainerPresenter.setNote(note, discussionThread);
   view.addNote(noteContainerPresenter, depth);
   for (Note childNote : discussionThread.getReplies(note.getNoteId())) {
     appendNote(childNote, depth + 1, discussionThread);
   }
 }
 private void displayDiscussionThread(DiscussionThread thread) {
   view.removeAllNotes();
   final List<Note> rootNotes = new ArrayList<Note>(thread.getRootNotes());
   Collections.sort(
       rootNotes,
       new Comparator<Note>() {
         @Override
         public int compare(Note o1, Note o2) {
           return (int) -(o1.getTimestamp() - o2.getTimestamp());
         }
       });
   for (Note rootNote : rootNotes) {
     appendNote(rootNote, 0, thread);
   }
   currentNoteIds.clear();
   currentNoteIds.addAll(thread.getNoteIds());
 }
 public void clearTarget() {
   view.removeAllNotes();
   currentTarget = null;
   view.setPostNewTopicEnabled(false);
   view.setPostNewTopicHandler(new PostNewTopicHandlerImpl(Optional.fromNullable(currentTarget)));
 }
 public Widget getWidget() {
   return view.getWidget();
 }