Class AbstractMemoryRendering
- All Implemented Interfaces:
IAdaptable
,IMemoryRendering
- Direct Known Subclasses:
org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering
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.
- Since:
- 3.1
-
Constructor Summary
ConstructorDescriptionAbstractMemoryRendering
(String renderingId) Constructs a new rendering of the given type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Notification this rendering has become the active rendering.void
Adds a listener for property changes to this rendering.void
Notification this rendering has become hidden in its container.void
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
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
Fires the given event to all registered listeners.getImage()
Returns an image for this rendering.getLabel()
Returns a label for this rendering.Returns the memory block displayed by this rendering.Returns the container hosting this memory rendering.protected MenuManager
Returns the pop up menu manager for this rendering, ornull
if none.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
Returns whether this rendering is currently visible.void
Removes the given property change listener from this rendering.Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.debug.ui.memory.IMemoryRendering
createControl, getControl
-
Constructor Details
-
AbstractMemoryRendering
Constructs a new rendering of the given type.- Parameters:
renderingId
- memory rendering type identifier
-
-
Method Details
-
init
Description copied from interface:IMemoryRendering
Initializes this rendering to be hosted in the given container, displaying the given memory block. This method is called before this rendering's control has been created.- Specified by:
init
in interfaceIMemoryRendering
- Parameters:
container
- container hosting this renderingblock
- the memory block to render
-
dispose
public void dispose()Description copied from interface:IMemoryRendering
Disposes this rendering.- Specified by:
dispose
in interfaceIMemoryRendering
-
activated
public void activated()Description copied from interface:IMemoryRendering
Notification this rendering has become the active rendering. Only one rendering can be active at once. Generally, the active rendering is visible and has focus.- Specified by:
activated
in interfaceIMemoryRendering
-
deactivated
public void deactivated()Description copied from interface:IMemoryRendering
Notification this rendering is no longer the active rendering.- Specified by:
deactivated
in interfaceIMemoryRendering
-
becomesVisible
public void becomesVisible()Description copied from interface:IMemoryRendering
Notification this rendering has become visible in its container. Note that a rendering does not have to be active to be visible.- Specified by:
becomesVisible
in interfaceIMemoryRendering
-
becomesHidden
public void becomesHidden()Description copied from interface:IMemoryRendering
Notification this rendering has become hidden in its container.- Specified by:
becomesHidden
in interfaceIMemoryRendering
-
getMemoryBlock
Description copied from interface:IMemoryRendering
Returns the memory block displayed by this rendering.- Specified by:
getMemoryBlock
in interfaceIMemoryRendering
- Returns:
- the memory block displayed by this rendering
-
getRenderingId
Description copied from interface:IMemoryRendering
Returns the identifier associated with this rendering's type.- Specified by:
getRenderingId
in interfaceIMemoryRendering
- Returns:
- the identifier associated with this rendering's type
- See Also:
-
addPropertyChangeListener
Description copied from interface:IMemoryRendering
Adds a listener for property changes to this rendering. Has no effect if an identical listener is already registered.- Specified by:
addPropertyChangeListener
in interfaceIMemoryRendering
- Parameters:
listener
- a property change listener
-
removePropertyChangeListener
Description copied from interface:IMemoryRendering
Removes the given property change listener from this rendering. Has no effect if the identical listener is not registered.- Specified by:
removePropertyChangeListener
in interfaceIMemoryRendering
- Parameters:
listener
- a property change listener
-
getImage
Description copied from interface:IMemoryRendering
Returns an image for this rendering. Clients should not dispose this image. This rendering will dispose the image if required when this rendering is disposed.- Specified by:
getImage
in interfaceIMemoryRendering
- Returns:
- an image for this rendering
-
decorateImage
Decorates and returns this rendering's image.- Parameters:
image
- base image- Returns:
- decorated image
- Since:
- 3.2
-
getLabel
Description copied from interface:IMemoryRendering
Returns a label for this rendering.- Specified by:
getLabel
in interfaceIMemoryRendering
- Returns:
- a label for this rendering
-
decorateLabel
Decorates and returns this rendering's label.- Parameters:
label
- base label- Returns:
- decorated label
- Since:
- 3.2
-
createPopupMenu
Helper method for creating a pop up menu in the rendering for a control. Call this method when a context menu is required for a control in a rendering.To contribute an action to a rendering, an
objectContribution
can be used on a rendering implementation class itself using apopupMenus
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 aviewerContribution
on apopupMenus
extension that has atargetID
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.
- Parameters:
control
- - control to create the pop up menu for
-
getPopupMenuManager
Returns the pop up menu manager for this rendering, ornull
if none.- Returns:
- the pop up menu manager for this rendering, or
null
-
firePropertyChangedEvent
Fires the given event to all registered listeners.- Parameters:
event
- the event to fire
-
getMemoryRenderingContainer
Returns the container hosting this memory rendering.- Returns:
- the container hosting this memory rendering
-
isVisible
public boolean isVisible()Returns whether this rendering is currently visible.- Returns:
- whether this rendering is currently visible
-