Package com.redcareditor.plist

Examples of com.redcareditor.plist.Dict


  }

  private void loadSettings(Dict dict) {
    List<PlistNode<?>> dictSettings = dict.getArray("settings");
    for (PlistNode<?> node : dictSettings) {
      Dict nodeDict = (Dict) node;
      if (!nodeDict.containsElement("scope")) {
        loadGlobalSetting(nodeDict);
      } else {
        settings.add(new ThemeSetting(nodeDict));
      }
    }
View Full Code Here


      }
    }
  }

  private void loadGlobalSetting(Dict nodeDict) {
    Dict settingsDict = nodeDict.getDictionary("settings");
    for (String key : settingsDict.value.keySet()) {
      globalSettings.put(key, settingsDict.getString(key));
    }
  }
View Full Code Here

    loadSettings(dict);
    compileScopeMatchers();
  }

  private void loadSettings(Dict dict) {
    Dict settingsDict = dict.getDictionary("settings");
   
    background = getSetting(settingsDict, "background");
    foreground = getSetting(settingsDict, "foreground");
    fontStyle  = getSetting(settingsDict, "fontStyle");
  }
View Full Code Here

  public static void loadThemes(String textmateDir) {
    if (themes == null) {
        themes = new ArrayList<Theme>();
    }
        for (String themeName : themeNames(textmateDir)) {
      Dict dict = Dict.parseFile(textmateDir + "/Themes/" + themeName);
      if (dict != null) {
        Theme theme = new Theme(dict);
        themes.add(theme);
      }
    }
View Full Code Here

public class RailsCastThemeTest {
  private Theme theme;

  @Before
  public void setup(){
    Dict themeDict = Dict.parseFile("input/Themes/Railscasts.tmTheme");
    theme = new Theme(themeDict);
  }
View Full Code Here

    }
  }

  private void loadRepository() {
    repository = new HashMap<String, List<Pattern>>();
    Dict plistRepo = plist.getDictionary("repository");
    if (plistRepo == null)
      return;
    Dict plistRepoEntry;
    for (String key : plistRepo.keys()) {
//      System.out.printf("loading repository entry: %s\n", key);
      List<Pattern> repoArray = new ArrayList<Pattern>();
      plistRepoEntry = plistRepo.getDictionary(key);
      if (plistRepoEntry.containsElement("begin") || plistRepoEntry.containsElement("match")) {
//        System.out.printf("    contains begin or match\n");
        Pattern pattern = Pattern.createPattern(this.allPatterns, plistRepoEntry);
        if (pattern != null) {
          pattern.grammar = this;
          repoArray.add(pattern);
        }
      }
      else if (plistRepoEntry.containsElement("patterns")) {
//        System.out.printf("    contains patterns\n");
        for (PlistNode<?> plistPattern : plistRepoEntry.getArray("patterns")) {
          Pattern pattern = Pattern.createPattern(this.allPatterns, (Dict) plistPattern);
          if (pattern != null) {
            pattern.grammar = this;
            repoArray.add(pattern);
          }
View Full Code Here

  }

  public static Map<Integer, String> makeCapturesFromPlist(Dict pd) {
    if (pd == null)
      return new HashMap<Integer, String>();
    Dict pcd;
    String ns;
    Map<Integer, String> captures = new HashMap<Integer, String>();
    for (String sCapnum : pd.value.keySet()) {
      int capnum = Integer.parseInt(sCapnum);
      pcd = pd.getDictionary(sCapnum);
      ns = pcd.getString("name");
//      System.out.printf("capture: %d, %s\n", capnum, ns);
      captures.put((Integer) capnum, ns);
    }
    return captures;
  }
View Full Code Here

TOP

Related Classes of com.redcareditor.plist.Dict

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.