/** * Remove the given project. * * @param project * the project to remove * @param source * the source of the edit activity */ public final void removeProject(final Project project, final Object source) { if (log.isDebugEnabled()) { log.debug("Removing project " + String.valueOf(project) + "."); } if (source.getClass().equals(BaralgaMain.class)) { // Don't confirm deletion during model migration. } else { if (!isProjectDeletionConfirmed(project)) { return; } } this.baralgaDAO.remove(project); this.projectList.remove(project); this.allProjectsList.remove(project); final BaralgaEvent event = new BaralgaEvent(BaralgaEvent.PROJECT_REMOVED, source); event.setData(project); notify(event); }
/** * Fires an event that a projects property has changed. * * @param changedProject * the project that's changed * @param propertyChangeEvent * the event to fire */ public void fireProjectChangedEvent(final Project changedProject, final PropertyChangeEvent propertyChangeEvent) { final BaralgaEvent event = new BaralgaEvent(BaralgaEvent.PROJECT_CHANGED, this); event.setData(changedProject); event.setPropertyChangeEvent(propertyChangeEvent); this.baralgaDAO.updateProject(changedProject); notify(event); if (propertyChangeEvent.getPropertyName().equals(Project.PROPERTY_ACTIVE)) { if (changedProject.isActive()) { this.projectList.add(changedProject); } else { this.projectList.remove(changedProject); } } }
activitiesList.remove(changedActivity);