public Map<String, String> getMacros() {
    Map<String, String> macros = new LinkedHashMap<String, String>();

    for (ICLanguageSetting ls : languageSettings) {
      for (ICLanguageSettingEntry ms : ls.getSettingEntries(ICSettingEntry.MACRO)) {
        if (ms.isBuiltIn()) {
          continue;
        }
        macros.put(ms.getName(), ms.getValue());
      }
    }

    return macros;
  }
  private void appendFile(
      Collection<File> paths, String workspacePath, ICLanguageSettingEntry includePath) {
    File path = new File(includePath.getValue());

    if ((includePath.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH)
        == ICSettingEntry.VALUE_WORKSPACE_PATH) {
      path = new File(workspacePath, path.toString());
    }

    IFile file = root.getFileForLocation(new Path(path.toString()));

    if (file != null) {
      path = file.getLocation().toFile();
    }

    paths.add(path);
  }
예제 #3
0
파일: IncludeTab.java 프로젝트: zhaog/cdt
 @Override
 public ICLanguageSettingEntry doEdit(ICLanguageSettingEntry ent) {
   IncludeDialog dlg =
       new IncludeDialog(
           usercomp.getShell(),
           IncludeDialog.OLD_DIR,
           Messages.IncludeTab_2,
           ent.getValue(),
           getResDesc().getConfiguration(),
           (ent.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH));
   if (dlg.open()) {
     int flags = 0;
     if (dlg.check2) flags = ICSettingEntry.VALUE_WORKSPACE_PATH;
     return CDataUtil.createCIncludePathEntry(dlg.text1, flags);
   }
   return null;
 }