com.levigo.jadice.demo.filehistory
Class FileHistoryPropertyListener

java.lang.Object
  extended by com.levigo.jadice.demo.filehistory.FileHistoryPropertyListener
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class FileHistoryPropertyListener
extends Object
implements PropertyChangeListener

A property listener which keeps track of recently opened files. This listener will update the "Recently opened"-files section in the "File"-menu.


Constructor Summary
FileHistoryPropertyListener(BasicJadicePanel mainViewerPanel, boolean useKeyStrokes)
          Constructor.
 
Method Summary
 void propertyChange(PropertyChangeEvent evt)
          When a Property event for key "PageView.DOCUMENT_PROPERTY" is received, we check if the current document is different from the previously opened document (if any).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHistoryPropertyListener

public FileHistoryPropertyListener(BasicJadicePanel mainViewerPanel,
                                   boolean useKeyStrokes)
Constructor.

Creates a new Listener with the given mainViewerPanel

Parameters:
mainViewerPanel - the related viewer panel
useKeyStrokes - whether the file menu entries get accelerator key strokes
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent evt)
When a Property event for key "PageView.DOCUMENT_PROPERTY" is received, we check if the current document is different from the previously opened document (if any).

If that is the case, notify JadiceDemoPreferences about the change.

Note
We do not check the PropertyChangeEvent key here - the listener is registered via

 getPageView().addPropertyChangeListener(String key, PropertyChangeListener listener)
 
Due to this registration, this listener will just receive Events with the specified key

Specified by:
propertyChange in interface PropertyChangeListener


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