Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse Platform
Release 3.5

Interface ICommonViewerMapper

public interface ICommonViewerMapper

Allows improved performance by optimizing label updates of the CommonViewer. Often label updates come in the form of resource updates, and the resources themselves are not directly stored in the CommonViewer; instead other model objects are stored. In addition, it may be the case where the objects that have changed are not present in the Tree associated with the CommonViewer because they have not been opened or expanded. You can use an instance of this class to define a mapping between the current Tree Items associated with the CommonViewer and the (typically resource) objects where a change is notified. The change is notified to the CommonViewer.handleLabelProviderChanged(org.eclipse.jface.viewers.LabelProviderChangedEvent). The mapper object (implementing this interface) is associated with the CommonViewer using the CommonViewer.setMapper(ICommonViewerMapper) method. When this mapper wishes to update the CommonViewer, the CommonViewer.doUpdateItem(org.eclipse.swt.widgets.Widget) method is used.

This interface is not intended to be extended by clients.

Method Summary
 void addToMap ( Object element, Item item)
          Adds a new item to the map.
 void clearMap ()
          Clears the map.
 boolean handlesObject ( Object object)
          Tests if this mapper handles the specified object.
 boolean isEmpty ()
          Tests if the map is empty
 void objectChanged ( Object object)
          Indicates the specified object has changed.
 void removeFromMap ( Object element, Item item)
          Removes an element from the map.

Method Detail


void addToMap(
Object element,
Item item)
Adds a new item to the map. Called by the CommonViewer when the element is added to the Tree.

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


void removeFromMap(
Object element,
Item item)
Removes an element from the map. Called by the CommonViewer when the element is removed from the Tree.

element - The data element
item - The table or tree item


void clearMap()
Clears the map.


boolean isEmpty()
Tests if the map is empty

Returns if there are mappings


boolean handlesObject(
Object object)
Tests if this mapper handles the specified object. This is used only by the viewer to determine if the object should be looked up in the mapper. This is not to be used when the object is being added to the mapper, as the mapper may adapt to the desired object to be mapped (like adapting from a Java model object to a resource object for example).

object - the object that the mapper can handle
true if it does


void objectChanged(
Object object)
Indicates the specified object has changed. If the object has a corresponding Item in the map, the associated CommonViewer is notified of the change using the CommonViewer.doUpdateItem(org.eclipse.swt.widgets.Widget) method so that it can update its state.

object - the object that changed

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire