public interface DocumentInterceptor
DocumentInterceptor
completes the interception capabilities for jadice Document
s.
Most document life cycle events, like page addition, page movement or page removal are handled by
EventListInterceptor
s which can be registered on an EventList
of Page
s
returned by the Document
. Implementors of DocumentInterceptor
may intercept state
changes of Document
s. That is, they will be notified whenever a state change occurs.
Furthermore implementations of this interface could perform any operations before the state
change takes places and may decide whether the operation shall go on or should be cancelled.
All interface methods may be called asynchronously from any thread, especially from other threads than the event dispatching thread. It is in the developer's responsibility to take precautions not to violate swing single thread rule and to ensure to do GUI interactions, like user-acknowledging dialogs, only on the event dispatching thread.
Modifier and Type | Method and Description |
---|---|
boolean |
approveStateChange(Document source,
Document.State oldState,
Document.State newState)
Return whether this DocumentListener approves the state change (
true ) of the given
document from the given previous state to the given new state. |
boolean approveStateChange(Document source, Document.State oldState, Document.State newState)
true
) of the given
document from the given previous state to the given new state.source
- The Document
on which a state change occurredoldState
- that Document.State
which was valid up to now.newState
- that Document.State
which will be the Document
's new Document.State
if no
registered DocumentInterceptor
disapproves the change.true
if the change is approved, false
otherwise.Copyright © 2024 levigo holding gmbh. All rights reserved.