@Test public void testActivate() { Entity defect = new Entity("defect", 1); defect.setProperty("name", "Name..."); defect.setProperty("description", "Description..."); defect.setProperty("dev-comments", "Comments..."); defect.setProperty("last-modified", "2012-12-12 12:12:12"); defect.setProperty("creation-time", "2012-12-12"); taskManagerIntegration.activate(defect); Assert.assertEquals("defect #1: Name...", taskManager.getActiveTask().getPresentableName()); }
public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } TaskManagerIntegration(Project project, EntityService entityService); }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } TaskManagerIntegration(Project project, EntityService entityService); void activate(Entity entity); void addListener(Listener listener); void removeListener(Listener listener); }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } TaskManagerIntegration(Project project, EntityService entityService); void activate(Entity entity); void addListener(Listener listener); void removeListener(Listener listener);  }