コード例 #1
0
  public void load(XModelObject object) {
    if (EclipseResourceUtil.isProjectFragment(object.getModel())) return;

    IAutoLoad auto = (IAutoLoad) object.getModel().getProperties().get(XModelConstants.AUTOLOAD);
    if (auto != null) {
      auto.load(object.getModel());
      updateLibs(object);
      _updateSrcs(object);
      ((FileSystemsImpl) object).updateOverlapped();
      return;
    }

    String f = getEclipseFileName(object, true);
    if (f == null) super.load(object);
    else util().load(new File(f), object);

    XModelObject[] os = object.getChildren();
    for (int i = 0; i < os.length; i++) {
      String s = os[i].getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION);
      if (s == null || !s.startsWith(XModelConstants.WORKSPACE_OLD_REF)) continue;
      s = XModelConstants.WORKSPACE_REF + s.substring(XModelConstants.WORKSPACE_OLD_REF.length());
      os[i].setAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION, s);
    }

    removeMissingJarSystems(object);
  }
コード例 #2
0
  public boolean update(XModelObject object) throws XModelException {
    boolean b = true;

    IAutoLoad auto = (IAutoLoad) object.getModel().getProperties().get(XModelConstants.AUTOLOAD);
    if (auto != null) {
      auto.update(object.getModel());
    }

    XModelObject[] cs = object.getChildren();
    for (int i = 0; i < cs.length; i++) {
      XObjectLoader loader = XModelObjectLoaderUtil.getObjectLoader(cs[i]);
      if (loader != null) b &= loader.update(cs[i]);
    }
    updateClassPath(object);
    ((FileSystemsImpl) object).updateOverlapped();
    return b;
  }