classpathhelper.eclipse.basicmodel
Class BasicClassPathModel

java.lang.Object
  extended byclasspathhelper.eclipse.ui.AbstractClassPathModel
      extended byclasspathhelper.eclipse.basicmodel.BasicClassPathModel
All Implemented Interfaces:
IClassPathModel, IFileChangeListener

public class BasicClassPathModel
extends AbstractClassPathModel
implements IFileChangeListener

Classpath model that uses a standard classpath string to construct a CGClassLoader. The classpath string is stored as preference.

Implementation Notes

This class also monitors the underly files in the classpath and will resend a new classloader if any files are updated.

Since:
1.0
Author:
bharris

Constructor Summary
BasicClassPathModel()
           
 
Method Summary
 void fileChanged(FileChangeMonitor monitor, FileChangedEvent[] evts)
          Callback method indicating file(s) have changed.
protected  CGClassLoader getCurrentClassLoader()
          Internal method used to obtain the current classloader for AbstractClassPathModel.addClassPathChangeListener(IClassPathChangeListener).
 void propertyChange(PropertyChangeEvent evt)
           
 void startClassPathListening()
          Method called to indicate that this model is the selected model and should start sending classpath change events.
 void stopClassPathListening()
          Method called to indicate that this model is nolonger the selected model and can clean up any listeners it has started (as well as any caching.
protected  void updateClassLoader(java.lang.String classpath)
          Internal method that fires a new classloader event.
 
Methods inherited from class classpathhelper.eclipse.ui.AbstractClassPathModel
addClassPathChangeListener, fireClassPathChangeEvent, getNumberOfListeners, removeClassPathChangeListener, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicClassPathModel

public BasicClassPathModel()
Since:
1.0
Method Detail

updateClassLoader

protected void updateClassLoader(java.lang.String classpath)
Internal method that fires a new classloader event. In addition to constructing the classpath it creates a file monitor that will refresh the classloader if any files are updated.

Parameters:
classpath - string in the standard classpath format.
Since:
1.0

getCurrentClassLoader

protected CGClassLoader getCurrentClassLoader()
Description copied from class: AbstractClassPathModel
Internal method used to obtain the current classloader for AbstractClassPathModel.addClassPathChangeListener(IClassPathChangeListener). If not class loader exists, this method should return null.

Specified by:
getCurrentClassLoader in class AbstractClassPathModel
Returns:
The current class loader.

startClassPathListening

public void startClassPathListening()
Description copied from interface: IClassPathModel

Method called to indicate that this model is the selected model and should start sending classpath change events. If a model needs to attach any listeners this is a good point to do so.

A model should also use this call send its initial class loader via its IClassPathChangeListener objects.

Specified by:
startClassPathListening in interface IClassPathModel

stopClassPathListening

public void stopClassPathListening()
Description copied from interface: IClassPathModel
Method called to indicate that this model is nolonger the selected model and can clean up any listeners it has started (as well as any caching.

Specified by:
stopClassPathListening in interface IClassPathModel

fileChanged

public void fileChanged(FileChangeMonitor monitor,
                        FileChangedEvent[] evts)
Description copied from interface: IFileChangeListener
Callback method indicating file(s) have changed.

Specified by:
fileChanged in interface IFileChangeListener
Parameters:
monitor - The monitor these changes are from.
evts - An array of the events representing all the file changes.

propertyChange

public void propertyChange(PropertyChangeEvent evt)