Class 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 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 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: 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 interface IMemoryRendering
        Parameters:
        container - container hosting this rendering
        block - the memory block to render
      • 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 interface IMemoryRendering
      • deactivated

        public void deactivated()
        Description copied from interface: IMemoryRendering
        Notification this rendering is no longer the active rendering.
        Specified by:
        deactivated in interface IMemoryRendering
      • 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 interface IMemoryRendering
      • getImage

        public Image 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 interface IMemoryRendering
        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
      • 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 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.

        Parameters:
        control - - control to create the pop up menu for
      • getPopupMenuManager

        protected MenuManager getPopupMenuManager()
        Returns the pop up menu manager for this rendering, or null if 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