public abstract class AbstractMemoryRendering extends PlatformObject implements IMemoryRendering
To contribute an action to a rendering, an objectContribution can
be used on a rendering implementation class itself using a
popupMenus extension. Additionally, the context menu created
by createPopupMenu() is registered with an identifier of this
rendering's container identifier. Actions may also be contributed to the
container's context menu specifically by using a viewerContribution
on a popupMenus extension that has a targetID referring
to this rendering container's identifier.
Clients implementing memory renderings must subclass this class.
| Constructor and Description |
|---|
AbstractMemoryRendering(String renderingId)
Constructs a new rendering of the given type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activated()
Notification this rendering has become the active rendering.
|
void |
addPropertyChangeListener(IPropertyChangeListener listener)
Adds a listener for property changes to this rendering.
|
void |
becomesHidden()
Notification this rendering has become hidden in its container.
|
void |
becomesVisible()
Notification this rendering has become visible in its container.
|
protected void |
createPopupMenu(Control control)
Helper method for creating a pop up menu in the rendering for a control.
|
void |
deactivated()
Notification this rendering is no longer the active rendering.
|
protected Image |
decorateImage(Image image)
Decorates and returns this rendering's image.
|
protected String |
decorateLabel(String label)
Decorates and returns this rendering's label.
|
void |
dispose()
Disposes this rendering.
|
protected void |
firePropertyChangedEvent(PropertyChangeEvent event)
Fires the given event to all registered listeners.
|
Image |
getImage()
Returns an image for this rendering.
|
String |
getLabel()
Returns a label for this rendering.
|
IMemoryBlock |
getMemoryBlock()
Returns the memory block displayed by this rendering.
|
IMemoryRenderingContainer |
getMemoryRenderingContainer()
Returns the container hosting this memory rendering.
|
protected MenuManager |
getPopupMenuManager()
Returns the pop up menu manager for this rendering, or
null
if none. |
String |
getRenderingId()
Returns the identifier associated with this rendering's type.
|
void |
init(IMemoryRenderingContainer container,
IMemoryBlock block)
Initializes this rendering to be hosted in the given container, displaying
the given memory block.
|
boolean |
isVisible()
Returns whether this rendering is currently visible.
|
void |
removePropertyChangeListener(IPropertyChangeListener listener)
Removes the given property change listener from this rendering.
|
getAdapterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateControl, getControlgetAdapterpublic AbstractMemoryRendering(String renderingId)
renderingId - memory rendering type identifierpublic void init(IMemoryRenderingContainer container, IMemoryBlock block)
IMemoryRenderinginit in interface IMemoryRenderingcontainer - container hosting this renderingblock - the memory block to renderpublic void dispose()
IMemoryRenderingdispose in interface IMemoryRenderingpublic void activated()
IMemoryRenderingactivated in interface IMemoryRenderingpublic void deactivated()
IMemoryRenderingdeactivated in interface IMemoryRenderingpublic void becomesVisible()
IMemoryRenderingbecomesVisible in interface IMemoryRenderingpublic void becomesHidden()
IMemoryRenderingbecomesHidden in interface IMemoryRenderingpublic IMemoryBlock getMemoryBlock()
IMemoryRenderinggetMemoryBlock in interface IMemoryRenderingpublic String getRenderingId()
IMemoryRenderinggetRenderingId in interface IMemoryRenderingIMemoryRenderingTypepublic void addPropertyChangeListener(IPropertyChangeListener listener)
IMemoryRenderingaddPropertyChangeListener in interface IMemoryRenderinglistener - a property change listenerpublic void removePropertyChangeListener(IPropertyChangeListener listener)
IMemoryRenderingremovePropertyChangeListener in interface IMemoryRenderinglistener - a property change listenerpublic Image getImage()
IMemoryRenderinggetImage in interface IMemoryRenderingprotected Image decorateImage(Image image)
image - base imagepublic String getLabel()
IMemoryRenderinggetLabel in interface IMemoryRenderingprotected String decorateLabel(String label)
label - base labelprotected void createPopupMenu(Control control)
To contribute an action to a rendering, an objectContribution can
be used on a rendering implementation class itself using a
popupMenus extension. Additionally, the context menu created
by this method is registered with an identifier of this rendering's container.
Actions may also be contributed to the context menu specifically by using a
viewerContribution on a popupMenus extension
that has a targetID referring to this rendering container's identifier.
Clients are expected to become a menu listener for their pop up menu if they require to fill the context menu for the rendering.
control - - control to create the pop up menu forprotected MenuManager getPopupMenuManager()
null
if none.nullprotected void firePropertyChangedEvent(PropertyChangeEvent event)
event - the event to firepublic IMemoryRenderingContainer getMemoryRenderingContainer()
public boolean isVisible()
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.