Exemple #1
0
  public String toMenuLocationDebug(final String profileID, final Locale locale) {
    final String SEPARATOR =
        LocaleHelper.getLocalizedMessage(locale, Config.Display_SettingNavigationSeparator, null);
    final StringBuilder sb = new StringBuilder();

    PwmSettingCategory nextCategory = this;
    while (nextCategory != null) {
      if (nextCategory != this) {
        sb.insert(0, nextCategory.getLabel(locale) + SEPARATOR);
      } else {
        sb.insert(0, nextCategory.getLabel(locale));
      }
      nextCategory = nextCategory.getParent();
    }

    if (this.hasProfiles()) {
      if (profileID != null) {
        sb.append(SEPARATOR);
        sb.append(profileID);
      } else {
        final String NULL_PROFILE =
            LocaleHelper.getLocalizedMessage(
                locale, Config.Display_SettingNavigationNullProfile, null);
        sb.append(SEPARATOR);
        sb.append(NULL_PROFILE);
      }
    }

    return sb.toString();
  }
Exemple #2
0
 public Collection<PwmSettingCategory> getChildCategories() {
   final ArrayList<PwmSettingCategory> returnObj = new ArrayList<>();
   for (final PwmSettingCategory category : values()) {
     if (this == category.getParent()) {
       returnObj.add(category);
     }
   }
   return returnObj;
 }
Exemple #3
0
 public Collection<PwmSettingCategory> getParents() {
   final ArrayList<PwmSettingCategory> returnObj = new ArrayList<>();
   PwmSettingCategory currentCategory = this.getParent();
   while (currentCategory != null) {
     returnObj.add(0, currentCategory);
     currentCategory = currentCategory.getParent();
   }
   return returnObj;
 }