Example #1
0
 private void store(final Bok bok) {
   final String bokType = bok.getBokType();
   if (bokType.equals(Bok.SITE)) {
     setSite(bok);
   } else if (bokType.equals(Bok.PROJECT)) {
     setProject(bok);
     if (site == null) {
       eventBus.fireEvent(new OpenBokEvent(Bok.SITE, "1", null, null));
     }
   } else {
     byType.put(bokType, bok);
     if (project == null || !project.getId().equals(bok.getProjectId())) {
       eventBus.fireEvent(new OpenBokEvent(Bok.PROJECT, bok.getProjectId(), null, null));
     }
   }
 }
Example #2
0
 /**
  * Recommended way to send BokSelected events
  *
  * @param bok
  * @return
  */
 public boolean select(final Bok bok) {
   if (bok != null) {
     selected = bok;
     eventBus.fireEvent(new BokSelectedEvent(bok));
     return true;
   } else {
     return false;
   }
 }