Extension SDK 10.1.2

oracle.ide.explorer
Class IconOverlayCache

java.lang.Object
  extended byoracle.ide.explorer.IconOverlayCache

public class IconOverlayCache
extends java.lang.Object

The IconOverlayCache class is responsible for an element overlay cache associated with many IconOverlayConsumers.

Instances of this class store overlay information for any number of explorer views and provide accessor and mutator methods for the cache. Overlay clients are required to update the cache when the state of an element changes and fire change notification for repainting.

Multiple simultaneous element overlays can be supported by an explorer. Each client is responsible for providing a unique identifier for the type of information being overlaid. There must be some kind of client consensus to prevent visual clashing of multiple overlay clients (Eg.several overlay icons on top of each other)

The displayable fields providing overlay information that the tree's cell renderer is capable of using are the values of the (superimposed) icon, (appended) tool tip text and (appended) short label.


Constructor Summary
IconOverlayCache()
           
 
Method Summary
 void clearOverlays(java.lang.String infoTypeId)
          Clears all overlay information from the cache.
 void deregisterOverlayConsumer(IconOverlayConsumer consumer)
           
 void fireOverlaysChanged()
          Fires a repaint for all pending element overlays after cache updates.
 Element[] getElementKeys(java.lang.String infoTypeId)
          Gets an array of current element keys in the overlay cache.
static IconOverlayCache getInstance()
           
 IconOverlay getOverlay(java.lang.String infoTypeId, Element e)
          Gets overlay information for the given element from the cache.
 javax.swing.Icon getRendererIcon(Element element, javax.swing.Icon baseObject)
           
 java.lang.String getRendererShortLabel(Element element, java.lang.String baseObject)
           
 java.lang.String getRendererToolTipText(Element element, java.lang.String baseObject)
           
 void putOverlay(java.lang.String infoTypeId, Element e, IconOverlay overlay)
          Puts overlay information for the given element into the cache.
 void registerOverlayConsumer(IconOverlayConsumer consumer)
           
 void removeOverlay(java.lang.String infoTypeId, Element e)
          Removes overlay information for the given element from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IconOverlayCache

public IconOverlayCache()
Method Detail

getInstance

public static final IconOverlayCache getInstance()

registerOverlayConsumer

public void registerOverlayConsumer(IconOverlayConsumer consumer)

deregisterOverlayConsumer

public void deregisterOverlayConsumer(IconOverlayConsumer consumer)

fireOverlaysChanged

public void fireOverlaysChanged()
Fires a repaint for all pending element overlays after cache updates.


putOverlay

public void putOverlay(java.lang.String infoTypeId,
                       Element e,
                       IconOverlay overlay)
Puts overlay information for the given element into the cache.

Parameters:
infoTypeId - an identifier for the type of information being overlaid.
e - the element.
overlay - the overlay object.

getOverlay

public IconOverlay getOverlay(java.lang.String infoTypeId,
                              Element e)
Gets overlay information for the given element from the cache.

Parameters:
infoTypeId - an identifier for the type of information.
e - the element.
Returns:
the overlay object.

removeOverlay

public void removeOverlay(java.lang.String infoTypeId,
                          Element e)
Removes overlay information for the given element from the cache.

Parameters:
infoTypeId - an identifier for the type of information being overlaid.
e - the element.

clearOverlays

public void clearOverlays(java.lang.String infoTypeId)
Clears all overlay information from the cache.

Parameters:
infoTypeId - an identifier for the type of information.

getElementKeys

public Element[] getElementKeys(java.lang.String infoTypeId)
Gets an array of current element keys in the overlay cache.

Returns:
the element array.

getRendererIcon

public javax.swing.Icon getRendererIcon(Element element,
                                        javax.swing.Icon baseObject)

getRendererToolTipText

public java.lang.String getRendererToolTipText(Element element,
                                               java.lang.String baseObject)

getRendererShortLabel

public java.lang.String getRendererShortLabel(Element element,
                                              java.lang.String baseObject)

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.