|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.render.RenderControlInventory
public abstract class RenderControlInventory
Implementations of RenderControlInventory
handle document and page specific render
controls belonging to a certain document instance.
Instances of this interface allow to get access to document and page specific render settings which is especially useful when the keep render settings mode is enabled.
This interface allows to get access to document and page specific render settings. With that it allows to change the render settings, too. To support multi viewer usage of one single document instance, viewers always works on snapshots of document render control inventories. As a consequence changes may not be reflected by any viewer which holds this document currently.
Therefore it is strongly recommended that developers do not change any of the render settings
while the associated document is hold by any viewer instance, if and only if the render
control instance is retrieved by a call of get(Document)
or
get(Document, boolean)
. Ignoring this recommendation would cause undesirable failures
and inconsistencies may happen.
Nested Class Summary | |
---|---|
static interface |
RenderControlInventory.Synchronizer
|
Constructor Summary | |
---|---|
RenderControlInventory()
|
Method Summary | |
---|---|
abstract void |
addInventoryRenderSettingsListener(InventoryRenderSettingsListener listener)
Adds a InventoryRenderSettingsListener for receiving render settings change events. |
static RenderControlInventory |
bindInventoryToDocument(Document doc,
RenderControlInventory inv)
Binds the given inventory to the document. |
static RenderControlInventory.Synchronizer |
createDefaultSynchronizer()
Returns a default synchronizer which reflects document render settings changes into all page render controls. |
abstract RenderControlInventory |
createSnapshot()
Creates a snapshot copy of this inventory instance. |
static RenderControlInventory |
get()
Creates and returns an empty RenderControlInventory . |
static RenderControlInventory |
get(Document document)
Returns the RenderControlInventory for the given document. |
static RenderControlInventory |
get(Document document,
boolean create)
Creates and returns a RenderControlInventory for given document. |
abstract RenderControls |
getDocumentRenderControl()
Return the documents render control |
abstract List<InventoryRenderSettingsListener> |
getInventoryRenderSettingsListeners()
Returns a list of the registered InventoryRenderSettingsListener . |
abstract RenderControls |
getPageRenderControl(Page page)
Return the page render control for the given page. |
abstract RenderControls |
getPageRenderControl(Page page,
boolean create)
Return the page render control for the given page. |
abstract boolean |
hasPageRenderControl(Page page)
Return whether the page has specific render control settings. |
abstract void |
removeInventoryRenderSettingsListener(InventoryRenderSettingsListener listener)
Removes a InventoryRenderSettingsListener . |
abstract void |
setSettingsSynchronizer(RenderControlInventory.Synchronizer handler)
The default synchronizer reflects document render settings changes into all page render controls. |
static RenderControlInventory |
unbindInventoryFromDocument(Document doc)
Unbinds any inventory from the document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RenderControlInventory()
Method Detail |
---|
public static RenderControlInventory get(Document document)
RenderControlInventory
for the given document. If no
RenderControlInventory
exists for given document, null
will be returned.
document
- the document for which the RenderControlInventory
is demanded
RenderControlInventory
for given document or null
if not
available.get()
,
get(Document, boolean)
public static RenderControlInventory get(Document document, boolean create)
RenderControlInventory
for given document. If no
RenderControlInventory
exists for given document, the boolean parameter decides whether
a new one will be created, will be bound to the document and will be returned.
document
- the document for which the RenderControlInventory
is demandedcreate
- if no inventory exist for given document:
true
creates a new inventory, bind it to the document and return it,false
null
will be returnedRenderControlInventory
for given document or null
.get()
,
get(Document)
,
bindInventoryToDocument(Document, RenderControlInventory)
public static RenderControlInventory get()
RenderControlInventory
. This inventory is not bound to any
document. It can be used to store render controls settings temporarily.
RenderControlInventory
get(Document)
,
get(Document, boolean)
,
bindInventoryToDocument(Document, RenderControlInventory)
public static RenderControlInventory.Synchronizer createDefaultSynchronizer()
RenderControlInventory.Synchronizer
public static RenderControlInventory bindInventoryToDocument(Document doc, RenderControlInventory inv)
doc
- inv
-
null
if the
document was not bind to another inventory beforeget(Document)
,
unbindInventoryFromDocument(Document)
public static RenderControlInventory unbindInventoryFromDocument(Document doc)
doc
-
null
if the
document was not bind to another inventory beforeget(Document)
,
bindInventoryToDocument(Document, RenderControlInventory)
public abstract RenderControls getDocumentRenderControl()
public abstract RenderControls getPageRenderControl(Page page)
null
will be returned.
page
- the page for which the page render control lookup is demanded
null
if no page render control is
availablepublic abstract RenderControls getPageRenderControl(Page page, boolean create)
page
- the page for which the page render control lookup is demandedcreate
- boolean flag. If no page render control for given page is available,
true
means a new one will be created and returned otherwise if the create
parameter is false
, null will be returned.
null
if no page render control is
available and the create parameter is false
.public abstract boolean hasPageRenderControl(Page page)
page
- the page for which the page render control lookup is demanded
public abstract RenderControlInventory createSnapshot()
public abstract void setSettingsSynchronizer(RenderControlInventory.Synchronizer handler)
RenderControlInventory.Synchronizer
which will be called whenever a change of the
document render control happened.
To restore the default behavior use a default synchronizer which can be obtained by a call of
createDefaultSynchronizer()
.
If no synchronization should happen set null as RenderControlInventory.Synchronizer
.
handler
- to synchronize document render settings changes into page render settingspublic abstract void addInventoryRenderSettingsListener(InventoryRenderSettingsListener listener)
InventoryRenderSettingsListener
for receiving render settings change events.
listener
- the listener to registerpublic abstract void removeInventoryRenderSettingsListener(InventoryRenderSettingsListener listener)
InventoryRenderSettingsListener
.
listener
- the listener to removepublic abstract List<InventoryRenderSettingsListener> getInventoryRenderSettingsListeners()
InventoryRenderSettingsListener
.
It is up to the implementation whether to return the internal listener collection or a copy of
this. Therefore changes made to the returned list must not be reflected in the internal
listener collection. Addition or removal of listeners should always be done with a call of
addInventoryRenderSettingsListener(InventoryRenderSettingsListener)
or
removeInventoryRenderSettingsListener(InventoryRenderSettingsListener)
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |