Class AbstractMemoryRendering
- java.lang.Object
-
- org.eclipse.core.runtime.PlatformObject
-
- org.eclipse.debug.ui.memory.AbstractMemoryRendering
-
- All Implemented Interfaces:
IAdaptable,IMemoryRendering
- Direct Known Subclasses:
org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering
public abstract class AbstractMemoryRendering extends PlatformObject implements IMemoryRendering
Abstract implementation of a memory rendering.To contribute an action to a rendering, an
objectContributioncan be used on a rendering implementation class itself using apopupMenusextension. Additionally, the context menu created bycreatePopupMenu()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 aviewerContributionon apopupMenusextension that has atargetIDreferring to this rendering container's identifier.Clients implementing memory renderings must subclass this class.
- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description AbstractMemoryRendering(String renderingId)Constructs a new rendering of the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivated()Notification this rendering has become the active rendering.voidaddPropertyChangeListener(IPropertyChangeListener listener)Adds a listener for property changes to this rendering.voidbecomesHidden()Notification this rendering has become hidden in its container.voidbecomesVisible()Notification this rendering has become visible in its container.protected voidcreatePopupMenu(Control control)Helper method for creating a pop up menu in the rendering for a control.voiddeactivated()Notification this rendering is no longer the active rendering.protected ImagedecorateImage(Image image)Decorates and returns this rendering's image.protected StringdecorateLabel(String label)Decorates and returns this rendering's label.voiddispose()Disposes this rendering.protected voidfirePropertyChangedEvent(PropertyChangeEvent event)Fires the given event to all registered listeners.ImagegetImage()Returns an image for this rendering.StringgetLabel()Returns a label for this rendering.IMemoryBlockgetMemoryBlock()Returns the memory block displayed by this rendering.IMemoryRenderingContainergetMemoryRenderingContainer()Returns the container hosting this memory rendering.protected MenuManagergetPopupMenuManager()Returns the pop up menu manager for this rendering, ornullif none.StringgetRenderingId()Returns the identifier associated with this rendering's type.voidinit(IMemoryRenderingContainer container, IMemoryBlock block)Initializes this rendering to be hosted in the given container, displaying the given memory block.booleanisVisible()Returns whether this rendering is currently visible.voidremovePropertyChangeListener(IPropertyChangeListener listener)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 Detail
-
AbstractMemoryRendering
public AbstractMemoryRendering(String renderingId)
Constructs a new rendering of the given type.- Parameters:
renderingId- memory rendering type identifier
-
-
Method Detail
-
init
public void init(IMemoryRenderingContainer container, IMemoryBlock block)
Description copied from interface:IMemoryRenderingInitializes 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:
initin interfaceIMemoryRendering- Parameters:
container- container hosting this renderingblock- the memory block to render
-
dispose
public void dispose()
Description copied from interface:IMemoryRenderingDisposes this rendering.- Specified by:
disposein interfaceIMemoryRendering
-
activated
public void activated()
Description copied from interface:IMemoryRenderingNotification 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:
activatedin interfaceIMemoryRendering
-
deactivated
public void deactivated()
Description copied from interface:IMemoryRenderingNotification this rendering is no longer the active rendering.- Specified by:
deactivatedin interfaceIMemoryRendering
-
becomesVisible
public void becomesVisible()
Description copied from interface:IMemoryRenderingNotification this rendering has become visible in its container. Note that a rendering does not have to be active to be visible.- Specified by:
becomesVisiblein interfaceIMemoryRendering
-
becomesHidden
public void becomesHidden()
Description copied from interface:IMemoryRenderingNotification this rendering has become hidden in its container.- Specified by:
becomesHiddenin interfaceIMemoryRendering
-
getMemoryBlock
public IMemoryBlock getMemoryBlock()
Description copied from interface:IMemoryRenderingReturns the memory block displayed by this rendering.- Specified by:
getMemoryBlockin interfaceIMemoryRendering- Returns:
- the memory block displayed by this rendering
-
getRenderingId
public String getRenderingId()
Description copied from interface:IMemoryRenderingReturns the identifier associated with this rendering's type.- Specified by:
getRenderingIdin interfaceIMemoryRendering- Returns:
- the identifier associated with this rendering's type
- See Also:
IMemoryRenderingType
-
addPropertyChangeListener
public void addPropertyChangeListener(IPropertyChangeListener listener)
Description copied from interface:IMemoryRenderingAdds a listener for property changes to this rendering. Has no effect if an identical listener is already registered.- Specified by:
addPropertyChangeListenerin interfaceIMemoryRendering- Parameters:
listener- a property change listener
-
removePropertyChangeListener
public void removePropertyChangeListener(IPropertyChangeListener listener)
Description copied from interface:IMemoryRenderingRemoves the given property change listener from this rendering. Has no effect if the identical listener is not registered.- Specified by:
removePropertyChangeListenerin interfaceIMemoryRendering- Parameters:
listener- a property change listener
-
getImage
public Image getImage()
Description copied from interface:IMemoryRenderingReturns 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:
getImagein interfaceIMemoryRendering- Returns:
- an image for this rendering
-
decorateImage
protected Image decorateImage(Image image)
Decorates and returns this rendering's image.- Parameters:
image- base image- Returns:
- decorated image
- Since:
- 3.2
-
getLabel
public String getLabel()
Description copied from interface:IMemoryRenderingReturns a label for this rendering.- Specified by:
getLabelin interfaceIMemoryRendering- Returns:
- a label for this rendering
-
decorateLabel
protected String decorateLabel(String label)
Decorates and returns this rendering's label.- Parameters:
label- base label- Returns:
- decorated label
- Since:
- 3.2
-
createPopupMenu
protected void createPopupMenu(Control control)
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
objectContributioncan be used on a rendering implementation class itself using apopupMenusextension. 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 aviewerContributionon apopupMenusextension that has atargetIDreferring 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
protected MenuManager getPopupMenuManager()
Returns the pop up menu manager for this rendering, ornullif none.- Returns:
- the pop up menu manager for this rendering, or
null
-
firePropertyChangedEvent
protected void firePropertyChangedEvent(PropertyChangeEvent event)
Fires the given event to all registered listeners.- Parameters:
event- the event to fire
-
getMemoryRenderingContainer
public IMemoryRenderingContainer 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
-
-