org.eclipse.cdt.internal.ui.util
Class ResourceToItemsMapper

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.util.ResourceToItemsMapper

public class ResourceToItemsMapper
extends java.lang.Object

Helper class for updating error markers and other decorators that work on resources. Items are mapped to their element's underlying resource. Method resourceChanged updates all items that are affected from the changed elements.


Constructor Summary
ResourceToItemsMapper(org.eclipse.jface.viewers.ContentViewer viewer)
           
 
Method Summary
 void addToMap(java.lang.Object element, org.eclipse.swt.widgets.Item item)
          Adds a new item to the map.
 void clearMap()
          Clears the map.
 boolean isEmpty()
          Tests if the map is empty
 void removeFromMap(java.lang.Object element, org.eclipse.swt.widgets.Item item)
          Removes an element from the map.
 void resourceChanged(org.eclipse.core.resources.IResource changedResource)
          Must be called from the UI thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceToItemsMapper

public ResourceToItemsMapper(org.eclipse.jface.viewers.ContentViewer viewer)
Method Detail

resourceChanged

public void resourceChanged(org.eclipse.core.resources.IResource changedResource)
Must be called from the UI thread.


addToMap

public void addToMap(java.lang.Object element,
                     org.eclipse.swt.widgets.Item item)
Adds a new item to the map.

Parameters:
element - Element to map
item - The item used for the element

removeFromMap

public void removeFromMap(java.lang.Object element,
                          org.eclipse.swt.widgets.Item item)
Removes an element from the map.


clearMap

public void clearMap()
Clears the map.


isEmpty

public boolean isEmpty()
Tests if the map is empty