Package com.intellij.openapi.components

Examples of com.intellij.openapi.components.PathMacroManager


    return rootFiles[0].getPath();
  }


  public static String collapsePathMacro(final ComponentManager project, @NotNull final String path) {
    final PathMacroManager macroManager = PathMacroManager.getInstance(project);
    return macroManager.collapsePath(path);
  }
View Full Code Here


    return macroManager.collapsePath(path);
  }


  public static String expandPathMacro(final ComponentManager project, @NotNull final String path) {
    final PathMacroManager macroManager = PathMacroManager.getInstance(project);
    return macroManager.expandPath(path);
  }
View Full Code Here

                         String.valueOf(isAlwaysRebuildBundleJAR()));
    element.setAttribute(DO_NOT_SYNCHRONIZE_WITH_MAVEN, String.valueOf(myDoNotSynchronizeWithMaven));

    Element props = new Element(ADDITIONAL_PROPERTIES);

    PathMacroManager macroManager = PathMacroManager.getInstance(myFacet.getModule());


    Map<String, String> additionalPropertiesAsMap = getAdditionalPropertiesAsMap();
    for (String key : additionalPropertiesAsMap.keySet()) {
      Element prop = new Element(PROPERTY);
      prop.setAttribute(KEY, key);

      String value = additionalPropertiesAsMap.get(key);
      if (key.equals(INCLUDE_RESOURCE)) {
        // there are paths in there, collapse these so the IML files don't get mixed up on every machine. The built in macro manager
        // does not recognize these, so we have to do this manually here.
        Parameters parameters = OSGiHeader.parseHeader(value);

        for (String name : parameters.keySet()) {
          if (StringUtil.startsWithChar(name, '{') && name.endsWith("}")) {
            name = name.substring(1, name.length() - 1).trim();
          }

          String[] parts = name.split("\\s*=\\s*");
          String source = parts[0];
          if (parts.length == 2) {
            source = parts[1];
          }

          if (StringUtil.startsWithChar(source, '@')) {
            source = source.substring(1);
          }

          // so we now got the source path and can replace it

          String collapsedSource = macroManager.collapsePath(source);
          value = StringUtil.replace(value, source, collapsedSource);
        }
      }
      prop.setAttribute(VALUE, value);
      props.addContent(prop);
View Full Code Here

TOP

Related Classes of com.intellij.openapi.components.PathMacroManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.