@Test public void testActivate_default() { handler.async(); ApplicationUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { testActivate(); taskManagerIntegration.activate(null); Assert.assertEquals("Default task", taskManager.getActiveTask().getPresentableName()); handler.done(); } }); }
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);  }