Package com.levigo.jadice.document
Class DocumentAdapter
java.lang.Object
com.levigo.jadice.document.DocumentAdapter
- All Implemented Interfaces:
DocumentInterceptor,DocumentListener,PageListener,PropertyChangeListener,EventListener,org.jadice.util.glazedlists.event.ListEventListener<Page>
public abstract class DocumentAdapter
extends Object
implements DocumentListener, DocumentInterceptor
An abstract adapter class used to reduce the complexity of implementing
DocumentListeners
as well as DocumentInterceptor. This class implements all methods mandated by the
aforementioned interfaces with default methods. The implementations for the
DocumentListener methods just do nothing, while the implementations of the
DocumentInterceptor methods approve all operations.- Since:
- 5.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapproveStateChange(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.voidlistChanged(org.jadice.util.glazedlists.event.ListEvent<Page> listEvent) voidSignal the addition of a page segment from a page.voidSignal the modification of a page segment within a page.voidSignal the removal of a page segment from a page.voidpropertyChange(PropertyChangeEvent propertyChangeEvent)
-
Constructor Details
-
DocumentAdapter
public DocumentAdapter()
-
-
Method Details
-
listChanged
- Specified by:
listChangedin interfaceorg.jadice.util.glazedlists.event.ListEventListener<Page>
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
approveStateChange
public boolean approveStateChange(Document source, Document.State oldState, Document.State newState) Description copied from interface:DocumentInterceptorReturn whether this DocumentListener approves the state change (true) of the given document from the given previous state to the given new state.- Specified by:
approveStateChangein interfaceDocumentInterceptor- Parameters:
source- TheDocumenton which a state change occurredoldState- thatDocument.Statewhich was valid up to now.newState- thatDocument.Statewhich will be theDocument's newDocument.Stateif no registeredDocumentInterceptordisapproves the change.- Returns:
trueif the change is approved,falseotherwise.
-
pageSegmentModified
Description copied from interface:PageListenerSignal the modification of a page segment within a page. This could mean an addition, removal or just a modification within a page segment.- Specified by:
pageSegmentModifiedin interfacePageListener- Parameters:
evt- the the event describing the change
-
pageSegmentRemoved
Description copied from interface:PageListenerSignal the removal of a page segment from a page.- Specified by:
pageSegmentRemovedin interfacePageListener
-
pageSegmentAdded
Description copied from interface:PageListenerSignal the addition of a page segment from a page.- Specified by:
pageSegmentAddedin interfacePageListener
-