boolean hasPropertiesFilter,
boolean checkSource
)
{
// Register the type
ImageType type =
manager.registerImageType(
ImageConstants.TECATE_NAMESPACE,
name,
null
);
char initialCap = Character.toUpperCase(name.charAt(0));
String baseName = initialCap + name.substring(1);
String rendererName =
"org.apache.myfaces.trinidadinternal.image.laf.browser." + baseName + "ImageRenderer";
// Initialize renderer name
type.setProperty(ImageType.IMAGE_RENDERER_NAME_PROPERTY, rendererName);
// Initialize the renderer
type.setProperty(
ImageType.IMAGE_RENDERER_PROPERTY,
new PropertyInstantiator(rendererName));
// Initialize encoder
type.setProperty(
ImageType.XML_ENCODER_PROPERTY,
new PropertyInstantiator(
"org.apache.myfaces.trinidadinternal.image.xml.encode." + baseName + "Encoder"
));
// FileSystemImageCache properties
type.setProperty(
CacheKeyFactory.CACHE_KEY_FACTORY_PROPERTY,
new PropertyInstantiator(
"org.apache.myfaces.trinidadinternal.image.cache." + baseName + "KeyFactory"
));
type.setProperty(
NameProvider.NAME_PROVIDER_PROPERTY,
new PropertyInstantiator(
"org.apache.myfaces.trinidadinternal.image.cache." + baseName + "NameProvider"
));
if (hasPropertiesFilter)
{
type.setProperty(
PropertiesFilter.PROPERTIES_FILTER_PROPERTY,
new PropertyInstantiator(
"org.apache.myfaces.trinidadinternal.image.cache." + baseName + "PropertiesFilter"
));
}
// Initialize localized property
type.setProperty(
ImageType.LOCALIZED_PROPERTY,
isLocalized ? Boolean.TRUE : Boolean.FALSE
);
// Initialize check source property
type.setProperty(
ImageType.CHECK_SOURCE_PROPERTY,
checkSource ? Boolean.TRUE : Boolean.FALSE
);
}