Пример #1
0
  public Properties getThemeSettings() {
    Theme theme = getTheme();

    Properties properties = new Properties();

    Map<String, ThemeSetting> themeSettings = theme.getSettings();

    for (String key : themeSettings.keySet()) {
      ThemeSetting themeSetting = themeSettings.get(key);

      String value = null;

      if (themeSetting.isConfigurable()) {
        value = getThemeSetting(key);
      } else {
        value = themeSetting.getValue();
      }

      if (value != null) {
        properties.put(key, value);
      }
    }

    return properties;
  }
Пример #2
0
  public void setSetting(String key, String value) {
    ThemeSetting themeSetting = _themeSettingsMap.get(key);

    if (themeSetting != null) {
      themeSetting.setValue(value);
    } else {
      addSetting(key, value, false, null, null, null);
    }
  }
Пример #3
0
  public String[] getSettingOptions(String key) {
    String[] options = null;

    ThemeSetting themeSetting = _themeSettingsMap.get(key);

    if (themeSetting != null) {
      options = themeSetting.getOptions();
    }

    return options;
  }
Пример #4
0
  public String getSetting(String key) {
    String value = null;

    ThemeSetting themeSetting = _themeSettingsMap.get(key);

    if (themeSetting != null) {
      value = themeSetting.getValue();
    }

    return value;
  }
Пример #5
0
  public Properties getSettingsProperties() {
    Properties properties = new Properties();

    for (String key : _themeSettingsMap.keySet()) {
      ThemeSetting setting = _themeSettingsMap.get(key);

      if (setting != null) {
        properties.setProperty(key, setting.getValue());
      }
    }

    return properties;
  }
Пример #6
0
  public Map<String, ThemeSetting> getConfigurableSettings() {
    Map<String, ThemeSetting> configurableSettings = new HashMap<String, ThemeSetting>();

    for (Map.Entry<String, ThemeSetting> entry : _themeSettingsMap.entrySet()) {

      ThemeSetting themeSetting = entry.getValue();

      if (themeSetting.isConfigurable()) {
        configurableSettings.put(entry.getKey(), entry.getValue());
      }
    }

    return configurableSettings;
  }