Ejemplo n.º 1
0
  @Override
  public void delete() {
    m_addressSpace.removeListener(m_addressSpaceListener);

    if (m_addressSpace.isLoaded()) {
      m_addressSpace.getContent().removeListener(m_contentListener);

      for (final INaviModule module : m_addressSpace.getContent().getModules()) {
        module.removeListener(m_modulesListener);
      }
    }
  }
Ejemplo n.º 2
0
  /**
   * Creates a new model object.
   *
   * @param addressSpace The address space that provides the modules.
   */
  public CProjectModulesModel(final INaviAddressSpace addressSpace) {
    Preconditions.checkNotNull(addressSpace, "IE01955: Address space argument can't be null");

    m_addressSpace = addressSpace;

    addressSpace.addListener(m_addressSpaceListener);

    if (addressSpace.isLoaded()) {
      addressSpace.getContent().addListener(m_contentListener);

      for (final INaviModule module : addressSpace.getContent().getModules()) {
        module.addListener(m_modulesListener);
      }
    }
  }
Ejemplo n.º 3
0
  /**
   * Returns the currently displayed modules.
   *
   * @return The currently displayed modules.
   */
  public List<INaviModule> getModules() {
    List<INaviModule> localCachedValues = m_cachedValues;

    if (localCachedValues == null) {
      final IFilter<INaviModule> filter = getFilter();

      if (m_addressSpace.isLoaded()) {
        localCachedValues =
            filter == null
                ? m_addressSpace.getContent().getModules()
                : filter.get(m_addressSpace.getContent().getModules());
      } else {
        localCachedValues = new ArrayList<INaviModule>();
      }
    }

    m_cachedValues = localCachedValues;
    return new ArrayList<INaviModule>(localCachedValues);
  }
Ejemplo n.º 4
0
 @Override
 public void loaded(final INaviAddressSpace addressSpace) {
   addressSpace.getContent().addListener(m_contentListener);
 }