metricsOverlay.handlers
Class DocumentTracker

java.lang.Object
  extended by metricsOverlay.handlers.DocumentTracker

public class DocumentTracker
extends java.lang.Object


Method Summary
 void addMetricFile(MetricFile mFile)
           
 boolean contains(MetricFile mf)
           
static org.eclipse.core.runtime.IPath convertRelativePathToAbsolute(org.eclipse.core.runtime.IPath path)
           
static org.eclipse.ui.IWorkbenchPart getActiveJavaEditor()
           
 java.util.Set<MetricFile> getAllMetricFiles()
           
static org.eclipse.jface.text.IDocument getDocumentFromPart(org.eclipse.ui.IWorkbenchPart part)
           
 MetricFile getFile(org.eclipse.core.runtime.IPath path)
           
static DocumentTracker getInstance()
           
static org.eclipse.core.runtime.IPath getPathFromDocument(org.eclipse.jface.text.IDocument doc)
           
static org.eclipse.ui.IWorkbenchPart getWorkbenchPart(org.eclipse.jface.text.IDocument doc, boolean restore)
          A static method to get the workbench part from a document.
 int numFiles()
           
 void remove(org.eclipse.core.runtime.IPath path)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DocumentTracker getInstance()

addMetricFile

public void addMetricFile(MetricFile mFile)

getAllMetricFiles

public java.util.Set<MetricFile> getAllMetricFiles()

getFile

public MetricFile getFile(org.eclipse.core.runtime.IPath path)

remove

public void remove(org.eclipse.core.runtime.IPath path)

numFiles

public int numFiles()

getWorkbenchPart

public static org.eclipse.ui.IWorkbenchPart getWorkbenchPart(org.eclipse.jface.text.IDocument doc,
                                                             boolean restore)
A static method to get the workbench part from a document.

Parameters:
doc - the document
Returns:
the workbench part corresponding to the document

getActiveJavaEditor

public static org.eclipse.ui.IWorkbenchPart getActiveJavaEditor()

getDocumentFromPart

public static org.eclipse.jface.text.IDocument getDocumentFromPart(org.eclipse.ui.IWorkbenchPart part)

getPathFromDocument

public static org.eclipse.core.runtime.IPath getPathFromDocument(org.eclipse.jface.text.IDocument doc)

convertRelativePathToAbsolute

public static org.eclipse.core.runtime.IPath convertRelativePathToAbsolute(org.eclipse.core.runtime.IPath path)

contains

public boolean contains(MetricFile mf)