@Override public void addListener(final IDebuggerContainerListener listener) { final ListenerWrapper wrapper = new ListenerWrapper(listener); m_database.getContent().getDebuggerTemplateManager().addListener(wrapper); m_wrappers.add(wrapper); }
/** * Returns the currently displayed projects. * * @return The currently displayed projects. */ public ArrayList<INaviProject> getProjects() { List<INaviProject> localCachedValues = m_cachedValues; if (localCachedValues == null) { if (m_database.isConnected()) { final IFilter<INaviProject> filter = getFilter(); localCachedValues = filter == null ? m_database.getContent().getProjects() : filter.get(m_database.getContent().getProjects()); } else { localCachedValues = new ArrayList<INaviProject>(); } } m_cachedValues = localCachedValues; return new ArrayList<INaviProject>(localCachedValues); }
@Override public void delete() { m_database.removeListener(m_databaseListener); if (m_database.isLoaded()) { final List<INaviProject> projects = m_database.getContent().getProjects(); for (final INaviProject project : projects) { project.removeListener(m_projectListener); } } }
/** * Creates a new table model to display the projects of a database. * * @param database The database that contains the projects. */ public CProjectsModel(final IDatabase database) { Preconditions.checkNotNull(database, "IE01989: Database argument can't be null"); m_database = database; database.addListener(m_databaseListener); if (database.isLoaded()) { final List<INaviProject> projects = database.getContent().getProjects(); for (final INaviProject project : projects) { project.addListener(m_projectListener); } } }
@Override public List<DebuggerTemplate> getDebuggers() { return m_database.getContent().getDebuggerTemplateManager().getDebuggers(); }
/** Frees allocated resources. */ public void dispose() { for (final ListenerWrapper wrapper : m_wrappers) { m_database.getContent().getDebuggerTemplateManager().removeListener(wrapper); } }