|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclasspathhelper.eclipse.ui.AbstractClassPathModel
classpathhelper.eclipse.jdt.listener.JavaProjectClassPathListener
Class that listens to the IJavaProject
and notifies
an instance of IClassPathChangeListener
if anything
occurs that would cause a change to the classpath.
This listener caches classpaths/classloaders for each project this prevents the constant reloading of projects when clicking around Package Explorer as it simply returns the already existing classloader. It clears its cache if another listener is selected as the primary listener.
This class has two different strategies for locating
the selected IJavaProject
. These two strategies
are selected by the user and stored as preferences. The two
strategies implement the IProjectSelectionStrategy
interface.
Constructor Summary | |
JavaProjectClassPathListener()
|
Method Summary | |
protected static void |
addSourcesToFileMonitor(FileChangeMonitor fileMonitor,
java.lang.String cp)
Internal method that adds elements from the classpath to the file monitor. |
protected java.lang.String |
determineClassPath(IJavaProject javaProject)
Internal method for determining the classpath of a JDT JavaProject. |
void |
fileChanged(FileChangeMonitor monitor,
FileChangedEvent[] evts)
Callback method indicating file(s) have changed. |
protected void |
fireNewClassPathEvent(IJavaProject javaProject)
Internal method to notify listeners that the classpath has 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. |
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 |
public JavaProjectClassPathListener()
Method Detail |
protected void fireNewClassPathEvent(IJavaProject javaProject)
javaProject
- The javaProject to pull the classpath
from.protected static void addSourcesToFileMonitor(FileChangeMonitor fileMonitor, java.lang.String cp)
fileMonitor
- The monitor that will watch files on the classpath
for changes.cp
- The classpath.protected java.lang.String determineClassPath(IJavaProject javaProject)
javaProject
- The javaProject to pull the classpath from.
protected CGClassLoader getCurrentClassLoader()
AbstractClassPathModel
AbstractClassPathModel.addClassPathChangeListener(IClassPathChangeListener)
.
If not class loader exists, this method should return null.
getCurrentClassLoader
in class AbstractClassPathModel
public void startClassPathListening()
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.
startClassPathListening
in interface IClassPathModel
public void stopClassPathListening()
IClassPathModel
stopClassPathListening
in interface IClassPathModel
public void fileChanged(FileChangeMonitor monitor, FileChangedEvent[] evts)
IFileChangeListener
fileChanged
in interface IFileChangeListener
monitor
- The monitor these changes are from.evts
- An array of the events representing all
the file changes.public void propertyChange(PropertyChangeEvent evt)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |