コード例 #1
0
 /* (non-Javadoc)
  * @see com.hundsun.ares.studio.reference.IReferenceInfoProvider#getReferenceInfos(com.hundsun.ares.studio.core.IARESResource, java.util.Map)
  */
 @Override
 public List<ReferenceInfo> getReferenceInfos(
     IARESResource resource, Map<Object, Object> context) {
   List<ReferenceInfo> infoList = new ArrayList<ReferenceInfo>();
   ReferenceInfo info = ReferenceFactory.eINSTANCE.createReferenceInfo();
   info.setRefName(resource.getFullyQualifiedName());
   info.setRefType(ResourceTypeMapping.getInstance().getReferenceType(resource.getType()));
   info.setRefNamespace(StringUtils.EMPTY);
   info.setResource(resource);
   info.setObjectProvider(ARESResourceObjectProvider.INSTANCE);
   infoList.add(info);
   return infoList;
 }
コード例 #2
0
  @Override
  public List<ReferenceInfo> getReferenceInfos(
      IARESResource resource, Map<Object, Object> context) {
    List<ReferenceInfo> infoList = new ArrayList<ReferenceInfo>();
    BasicResourceInfo basicInfo = null;
    try {
      basicInfo = resource.getInfo(BasicResourceInfo.class);
    } catch (ARESModelException e) {
      e.printStackTrace();
    }

    if (basicInfo != null) {
      ReferenceInfo cnameRefInfo = ReferenceFactory.eINSTANCE.createReferenceInfo();
      cnameRefInfo.setResource(resource);
      cnameRefInfo.setRefName(basicInfo.getChineseName());
      cnameRefInfo.setRefType(
          ResourceTypeMapping.getInstance().getReferenceType(resource.getType()));
      cnameRefInfo.setRefNamespace(resource.getBundle().getId());
      cnameRefInfo.setObjectProvider(ARESResourceObjectProvider.INSTANCE);
      infoList.add(cnameRefInfo);
    }
    return infoList;
  }