public Optional<String> actionDisplayName(final String type, final String name) { return readRawValue(prefix + "actions." + type + "." + name + "._displayName"); }
public Optional<String> category(final String value) { return readValue(value + "._category"); }
final IconResolver.Icon iconFamilyContent = iconResolver.resolve(container, familyIcon); final String familyDisplayName = meta.getParent().findBundle(loader, locale).displayName().orElse(meta.getParent().getName()); final List<String> categories = ofNullable(meta.getParent().getCategories()) .map(vals -> vals .getParent() .findBundle(loader, locale) .category(category) .orElseGet(() -> category .replace("/" + meta.getParent().getName() + "/",
public Set<ActionReference> getActionReference(final Stream<ParameterMeta> parameters, final String familyName, final FamilyBundle familyBundle) { return parameters .flatMap(p -> p.getMetadata().entrySet().stream()) .filter(e -> e.getKey().startsWith(ActionParameterEnricher.META_PREFIX)) .map(e -> { final String type = e.getKey().substring(ActionParameterEnricher.META_PREFIX.length()); return new ActionReference(familyName, e.getValue(), type, familyBundle.actionDisplayName(type, e.getValue()).orElse(e.getValue()), null); }) .collect(toSet()); }
public FamilyBundle findBundle(final ClassLoader loader, final Locale locale) { return bundles.computeIfAbsent(locale, l -> { try { final ResourceBundle bundle = ResourceBundle .getBundle((packageName.isEmpty() ? packageName : (packageName + '.')) + "Messages", locale, loader); return new FamilyBundle(bundle, name + '.'); } catch (final MissingResourceException mre) { log .warn("No bundle for " + packageName + " (" + name + "), means the display names will be the technical names"); log.debug(mre.getMessage(), mre); return NO_COMPONENT_BUNDLE; } }); }
node.setName(family.getMeta().getName()); node.setDisplayName(resourcesBundle.displayName().orElse(family.getMeta().getName()));
node .setDisplayName(resourcesBundle .configurationDisplayName(c.getKey().getConfigType(), c.getKey().getConfigName()) .orElse(c.getKey().getConfigName())); if (!lightPayload) {
private Collection<ActionReference> findActions(final String family, final Set<ActionReference> actions, final Container container, final Locale locale, final FamilyBundle familyBundle) { final ContainerComponentRegistry registry = container.get(ContainerComponentRegistry.class); return registry .getServices() .stream() .flatMap(s -> s.getActions().stream()) .filter(s -> s.getFamily().equals(family)) .filter(s -> actions .stream() .anyMatch(e -> s.getFamily().equals(e.getFamily()) && s.getType().equals(e.getType()) && s.getAction().equals(e.getName()))) .map(s -> new ActionReference(s.getFamily(), s.getAction(), s.getType(), familyBundle.actionDisplayName(s.getType(), s.getAction()).orElse(s.getAction()), propertiesService .buildProperties(s.getParameters(), container.getLoader(), locale, null) .collect(toList()))) .collect(toList()); }
public Optional<String> displayName() { return readValue("_displayName"); }
public Optional<String> configurationDisplayName(final String type, final String name) { return readValue(type + "." + name + "._displayName"); } }