notifications for unknown macros
[fedora-idea.git] / platform / platform-impl / src / com / intellij / openapi / components / ExpandMacroToPathMap.java
blobdefdfccf4d72ec31a51f33caeb00f789404e5117
1 /*
2 * Copyright (c) 2000-2004 by JetBrains s.r.o. All Rights Reserved.
3 * Use is subject to license terms.
4 */
5 package com.intellij.openapi.components;
7 import com.intellij.openapi.util.text.StringUtil;
9 import java.util.Map;
11 /**
12 * @author Eugene Zhuravlev
13 * Date: Dec 6, 2004
15 public class ExpandMacroToPathMap extends PathMacroMap {
17 public void addMacroExpand(String macroName, String path) {
18 put("$" + macroName + "$", quotePath(path));
21 public String substitute(String text, boolean caseSensitive) {
22 for (Map.Entry<String, String> entry : entries()) {
23 // when replacing macros with actual paths the replace utility may be used as always 'case-sensitive'
24 // for case-insensitive file systems there will be no unnecesary toLowerCase() transforms.
25 text = StringUtil.replace(text, entry.getKey(), entry.getValue(), false);
27 return text;