// XDIME/PAPI element in order to add atttributes to it.
// text-align
AttributeOnlyStyleEmulationPropertyRenderer textAlignRenderer =
new AttributeOnlyStyleEmulationPropertyRenderer(
new StyleEmulationElementSetAttributeRenderer(
new String[] {"p", "div", "table", "tr", "td", "th",
"img", "input", "h1", "h2", "h3", "h4",
"h5", "h6", "hr"}, "align",
new DefaultTextAlignEmulationAttributeValueRenderer())
);
styleEmulationPropertyRendererSelector.register(
StylePropertyDetails.TEXT_ALIGN, textAlignRenderer);
// vertical-align
AttributeOnlyStyleEmulationPropertyRenderer verticalAlignRenderer =
new AttributeOnlyStyleEmulationPropertyRenderer(
new HTML3_2VerticalAlignEmulationPropertyRenderer()
);
styleEmulationPropertyRendererSelector.register(
StylePropertyDetails.VERTICAL_ALIGN,
verticalAlignRenderer);
// padding
registerPaddingPropertyRenderers();
// margin
registerMarginPropertyRenderers();
// border-spacing
AttributeOnlyStyleEmulationPropertyRenderer borderSpacingRenderer =
new AttributeOnlyStyleEmulationPropertyRenderer(
new StyleEmulationElementSetAttributeRenderer(
new String[] {"table"}, "cellspacing",
new HTML3_2BorderSpacingEmulationAttributeValueRenderer()));
styleEmulationPropertyRendererSelector.register(
StylePropertyDetails.BORDER_SPACING,
borderSpacingRenderer);
// border-width
AttributeOnlyStyleEmulationPropertyRenderer borderWidthRenderer =
new AttributeOnlyStyleEmulationPropertyRenderer(
new StyleEmulationElementSetAttributeRenderer(
new String[] {"table", "img"}, "border",
new HTML3_2PixelsEmulationAttributeValueRenderer()));
styleEmulationPropertyRendererSelector.register(
StylePropertyDetails.BORDER_TOP_WIDTH,
borderWidthRenderer);
// width
AttributeOnlyStyleEmulationPropertyRenderer widthRenderer =
new AttributeOnlyStyleEmulationPropertyRenderer(
new StyleEmulationElementSetAttributeRenderer(
new String[]{"table", "td", "th", "hr"}, "width",
new HTML3_2PixelsEmulationAttributeValueRenderer()));
styleEmulationPropertyRendererSelector.register(
StylePropertyDetails.WIDTH,
widthRenderer);
// height
AttributeOnlyStyleEmulationPropertyRenderer heightRenderer =
new AttributeOnlyStyleEmulationPropertyRenderer(
new StyleEmulationElementSetAttributeRenderer(
new String[]{"td", "hr", "th"}, "height",
new HTML3_2PixelsEmulationAttributeValueRenderer()));
styleEmulationPropertyRendererSelector.register(
StylePropertyDetails.HEIGHT,
heightRenderer);
// background-color
AttributeOnlyStyleEmulationPropertyRenderer backgroundColor =
new AttributeOnlyStyleEmulationPropertyRenderer(
new StyleEmulationElementSetAttributeRenderer(
new String[] {"body", "table", "tr", "td", "th"}, "bgcolor",
new HTML3_2ColorEmulationAttributeValueRenderer()));
styleEmulationPropertyRendererSelector.register(
StylePropertyDetails.BACKGROUND_COLOR,
backgroundColor);