예제 #1
0
  public void addInclude(XInclude a_include) throws CircularIncludeException {
    if (isCircularInclude(a_include.getHref())) {
      throw new CircularIncludeException();
    } // if

    m_actives.unselectAll();
    m_actives.addActive((GlyphObject) a_include);
    m_glyph.getBody().addInclude(a_include);
    m_history.record("addInclude");
  }
예제 #2
0
  private boolean isCircularInclude(String a_href) {
    if (getShortFileName().equals(a_href)) {
      return true;
    } // if

    ModuleManager manager = ModuleManager.getSingletonInstance();
    XInclude[] includes = m_glyph.getBody().getInclude();
    int i;
    for (i = 0; i < includes.length; i++) {
      XInclude include = includes[i];
      GlyphFile child = manager.getGlyphFile(include.getHref());

      if (child.isCircularInclude(a_href)) {
        return true;
      } // if
    } // for i

    return false;
  }