Beispiel #1
0
  public boolean refreshSourceFields() throws ModelException {
    if (jstType == null || !jstType.hasMixins()) { // only refresh types
      // with mixins
      return false;
    }

    ModelManager manager = ModelManager.getModelManager();

    // mixin types maybe changed, refresh the member fields
    try {
      final String natureId = getNatureId();
      final VjoSourceElementParser parser =
          (VjoSourceElementParser) getSourceElementParser(natureId);
      HashMap newElements = new HashMap();
      JSSourceModuleElementInfo info = (JSSourceModuleElementInfo) createElementInfo();

      final VjoSourceModuleStructureRequestor requestor =
          new VjoSourceModuleStructureRequestor(this, info, newElements);

      if (!isReadOnly()) {
        ((ISourceElementParserExtension) parser).setScriptProject(this.getScriptProject());
      }

      parser.setRequestor(requestor);

      final AccumulatingProblemReporter problemReporter = getAccumulatingProblemReporter();
      parser.setReporter(problemReporter);

      SourceParserUtil.parseSourceModule(this, parser);

      manager.putInfos(this, newElements);

      return true;
    } catch (CoreException e) {
      throw new ModelException(e);
    }
  }