In case when a component lib like PF would like to use Facets in similar way like PropertyKeys:
public enum PropertyKeys {
@Property(description = "Name of the field associated to bean 'var'", type = String.class)
field,
footerText,
@Property(description = "Shortcut for header facet", type = String.class)
headerText,
style,
styleClass,
converter
}
public enum FacetKeys {
@Facet(description = "")
header,
@Facet(description = "")
footer
}
and
UIComponent header = column.getFacet(ColumnBase.FacetKeys.header);
we can simply add the following method to UIComponent/Base:
public abstract UIComponent getFacet(Enum<?> facet);
@Override
public UIComponent getFacet(Enum<?> facet) {
return getFacet(facet.name());
}
In case when a component lib like PF would like to use Facets in similar way like PropertyKeys:
and
we can simply add the following method to UIComponent/Base: