com.levigo.jadice.document
Class DocumentAdapter

java.lang.Object
  extended by com.levigo.jadice.document.DocumentAdapter
All Implemented Interfaces:
DocumentInterceptor, DocumentListener, PageListener, ListEventListener<Page>, PropertyChangeListener, EventListener

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:
Document, Page, DocumentListener, DocumentInterceptor

Constructor Summary
DocumentAdapter()
           
 
Method Summary
 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.
 void listChanged(ListEvent<Page> listEvent)
          When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary.
 void pageSegmentAdded(PageSegmentEvent evt)
          Signal the addition of a page segment from a page.
 void pageSegmentModified(PageSegmentEvent evt)
          Signal the modification of a page segment within a page.
 void pageSegmentRemoved(PageSegmentEvent evt)
          Signal the removal of a page segment from a page.
 void propertyChange(PropertyChangeEvent propertyChangeEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentAdapter

public DocumentAdapter()
Method Detail

listChanged

public void listChanged(ListEvent<Page> listEvent)
Description copied from interface: ListEventListener
When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary.

It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event.

Specified by:
listChanged in interface ListEventListener<Page>

propertyChange

public void propertyChange(PropertyChangeEvent propertyChangeEvent)
Specified by:
propertyChange in interface PropertyChangeListener

approveStateChange

public boolean approveStateChange(Document source,
                                  Document.State oldState,
                                  Document.State newState)
Description copied from interface: DocumentInterceptor
Return whether this DocumentListener approves the state change (true) of the given document from the given previous state to the given new state.

Specified by:
approveStateChange in interface DocumentInterceptor
Parameters:
source - The Document on which a state change occurred
oldState - 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.
Returns:
true if the change is approved, false otherwise.

pageSegmentModified

public void pageSegmentModified(PageSegmentEvent evt)
Description copied from interface: PageListener
Signal 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:
pageSegmentModified in interface PageListener
Parameters:
evt - the the event describing the change

pageSegmentRemoved

public void pageSegmentRemoved(PageSegmentEvent evt)
Description copied from interface: PageListener
Signal the removal of a page segment from a page.

Specified by:
pageSegmentRemoved in interface PageListener

pageSegmentAdded

public void pageSegmentAdded(PageSegmentEvent evt)
Description copied from interface: PageListener
Signal the addition of a page segment from a page.

Specified by:
pageSegmentAdded in interface PageListener


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.