コード例 #1
0
  @Override
  public void addListener(final IDebuggerContainerListener listener) {
    final ListenerWrapper wrapper = new ListenerWrapper(listener);

    m_database.getContent().getDebuggerTemplateManager().addListener(wrapper);

    m_wrappers.add(wrapper);
  }
コード例 #2
0
  /**
   * 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);
  }
コード例 #3
0
  @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);
      }
    }
  }
コード例 #4
0
  /**
   * 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);
      }
    }
  }
コード例 #5
0
 @Override
 public List<DebuggerTemplate> getDebuggers() {
   return m_database.getContent().getDebuggerTemplateManager().getDebuggers();
 }
コード例 #6
0
 /** Frees allocated resources. */
 public void dispose() {
   for (final ListenerWrapper wrapper : m_wrappers) {
     m_database.getContent().getDebuggerTemplateManager().removeListener(wrapper);
   }
 }