Package com.openhtmltopdf.layout.counter
Class CounterContext
java.lang.Object
com.openhtmltopdf.layout.counter.CounterContext
- All Implemented Interfaces:
AbstractCounterContext
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CounterContext
(LayoutContext ctx, CalculatedStyle style, Integer startIndex) A CounterContext should really be reflected in the element hierarchy, but CalculatedStyles reflect the ancestor hierarchy just as well and also handles pseudo-elements seamlessly. -
Method Summary
Modifier and TypeMethodDescriptionprivate Integer
getCounter
(String name) private void
getCounterValues
(String name, List<Integer> values) int
getCurrentCounterValue
(String name) private boolean
private void
incrementListItemCounter
(int increment) private void
-
Field Details
-
_counters
-
_parent
This is different because it needs to work even when the counter- properties cascade and it should also logically be redefined on each level (think list-items within list-items)
-
-
Constructor Details
-
CounterContext
A CounterContext should really be reflected in the element hierarchy, but CalculatedStyles reflect the ancestor hierarchy just as well and also handles pseudo-elements seamlessly. -
CounterContext
private CounterContext()
-
-
Method Details
-
incrementCounter
- Parameters:
cd
-- Returns:
- true if a counter was found and incremented
-
incrementListItemCounter
private void incrementListItemCounter(int increment) -
resetCounter
-
getCurrentCounterValue
- Specified by:
getCurrentCounterValue
in interfaceAbstractCounterContext
-
getCounter
-
getCurrentCounterValues
- Specified by:
getCurrentCounterValues
in interfaceAbstractCounterContext
-
getCounterValues
-