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.
|
getAdapter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createControl, getControl
getAdapter
public AbstractMemoryRendering(String renderingId)
renderingId
- memory rendering type identifierpublic void init(IMemoryRenderingContainer container, IMemoryBlock block)
IMemoryRendering
init
in interface IMemoryRendering
container
- container hosting this renderingblock
- the memory block to renderpublic void dispose()
IMemoryRendering
dispose
in interface IMemoryRendering
public void activated()
IMemoryRendering
activated
in interface IMemoryRendering
public void deactivated()
IMemoryRendering
deactivated
in interface IMemoryRendering
public void becomesVisible()
IMemoryRendering
becomesVisible
in interface IMemoryRendering
public void becomesHidden()
IMemoryRendering
becomesHidden
in interface IMemoryRendering
public IMemoryBlock getMemoryBlock()
IMemoryRendering
getMemoryBlock
in interface IMemoryRendering
public String getRenderingId()
IMemoryRendering
getRenderingId
in interface IMemoryRendering
IMemoryRenderingType
public void addPropertyChangeListener(IPropertyChangeListener listener)
IMemoryRendering
addPropertyChangeListener
in interface IMemoryRendering
listener
- a property change listenerpublic void removePropertyChangeListener(IPropertyChangeListener listener)
IMemoryRendering
removePropertyChangeListener
in interface IMemoryRendering
listener
- a property change listenerpublic Image getImage()
IMemoryRendering
getImage
in interface IMemoryRendering
protected Image decorateImage(Image image)
image
- base imagepublic String getLabel()
IMemoryRendering
getLabel
in interface IMemoryRendering
protected 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.null
protected void firePropertyChangedEvent(PropertyChangeEvent event)
event
- the event to firepublic IMemoryRenderingContainer getMemoryRenderingContainer()
public boolean isVisible()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.