Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] OverlayDecoratorIcon, Image parameter and dispose

Hi all,

In https://git.eclipse.org/r/82899 , I wrote this piece of code:

  @Override
  protected ImageDescriptor decorateImage(ImageDescriptor input, Object element) {
    ImageDescriptor res = super.decorateImage(input, element);
    // ...
    if (overlay != null) {
      Image baseImage = res.createImage();
      res = new DecorationOverlayIcon(baseImage, overlay, IDecoration.BOTTOM_LEFT);
    }
    return res;
  }


I have multiple questions about that:
* Am I responsible of disposing the "baseImage", as it seems to be used by the DecorationOverlayIcon? Or does the DecorationOverlayIcon take
* If I'm responsible of disposing the image, when should I do it? If I dispose it just after creation of the DecorationOverlayIcon, I get failure later (when the DecorationOverlayIcon tries to create its image); and from this method, I don't see how to get the lifecycle of the image to dispose it at the right time?
* Maybe there's something better to use for that?

Thanks in advance
--
Mickael Istria
Eclipse developer for Red Hat Developers
My blog - My Tweets

Back to the top