Top Fields Constructors Methods
com.openhtmltopdf.layout.counter

public Class CounterContext

extends Object
implements AbstractCounterContext
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.layout.counter.AbstractCounterContext
Imports
java.util.ArrayList, .HashMap, .List, .Map, com.openhtmltopdf.css.constants.CSSName, .IdentValue, com.openhtmltopdf.css.parser.CounterData, com.openhtmltopdf.css.style.CalculatedStyle, com.openhtmltopdf.layout.LayoutContext

Field Summary

Modifier and TypeField and Description
private final Map<String, Integer>
private CounterContext
_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 Summary

AccessConstructor and Description
public
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.

private

Method Summary

Modifier and TypeMethod and Description
private Integer
private void
public int
public List<Integer>
private boolean

Returns:

true if a counter was found and incremented
incrementCounter
(CounterData cd)

private void
incrementListItemCounter(int increment)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_countersback to summary
private final Map<String, Integer> _counters
_parentback to summary
private CounterContext _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 Detail

CounterContextback to summary
public 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.

CounterContextback to summary
private CounterContext()

Method Detail

getCounterback to summary
private Integer getCounter(String name)
getCounterValuesback to summary
private void getCounterValues(String name, List<Integer> values)
getCurrentCounterValueback to summary
public int getCurrentCounterValue(String name)

Implements com.openhtmltopdf.layout.counter.AbstractCounterContext.getCurrentCounterValue.

Annotations
@Override
getCurrentCounterValuesback to summary
public List<Integer> getCurrentCounterValues(String name)

Implements com.openhtmltopdf.layout.counter.AbstractCounterContext.getCurrentCounterValues.

Annotations
@Override
incrementCounterback to summary
private boolean incrementCounter(CounterData cd)
Returns:boolean

true if a counter was found and incremented

incrementListItemCounterback to summary
private void incrementListItemCounter(int increment)
resetCounterback to summary
private void resetCounter(CounterData cd)