NetBeans 8.2 Annotations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NetBeans 8.2 Annotations

Andreas Stefik
Folks,

I'm porting an application from NetBeans 8.0.2 to 8.2 (finally) and am trying to manage a few of the changes that broke backward compatibility. In 8.0.2, if you had an icon (e.g., like in a logical view provider), you could annotate it with git annotations or something else like so:

@Override
        public Image getIcon(int type) {
            Image icon = ImageUtilities.loadImage(QuorumProject.QUORUM_PROJECT_ICON);
            
            if(fileObject != null) {
                try {
                    icon = fileObject.getFileSystem().getStatus().annotateIcon(icon, type, Collections.singleton(fileObject));
                } catch (FileStateInvalidException e) {
                    // no fs, do nothing
                }
            }
            return icon;
        }

However, in 8.2, getStatus is a compiler error, it appears. I've dug around and am aware the methods were removed, but I can't seem to find any documentation on what the new way to tackle these things is. Does anyone know?

Stefik
Reply | Threaded
Open this post in threaded view
|

Re: NetBeans 8.2 Annotations

Andreas Stefik
Wait, I found it, answering my own question. For anyone else that has run into it, the answer appears to be this:

FileUIUtils.getImageDecorator(fileObject.getFileSystem())

annotateIcon is then called on that instead.

Stefik

On Wed, Jan 4, 2017 at 9:03 PM, Andreas Stefik <[hidden email]> wrote:
Folks,

I'm porting an application from NetBeans 8.0.2 to 8.2 (finally) and am trying to manage a few of the changes that broke backward compatibility. In 8.0.2, if you had an icon (e.g., like in a logical view provider), you could annotate it with git annotations or something else like so:

@Override
        public Image getIcon(int type) {
            Image icon = ImageUtilities.loadImage(QuorumProject.QUORUM_PROJECT_ICON);
            
            if(fileObject != null) {
                try {
                    icon = fileObject.getFileSystem().getStatus().annotateIcon(icon, type, Collections.singleton(fileObject));
                } catch (FileStateInvalidException e) {
                    // no fs, do nothing
                }
            }
            return icon;
        }

However, in 8.2, getStatus is a compiler error, it appears. I've dug around and am aware the methods were removed, but I can't seem to find any documentation on what the new way to tackle these things is. Does anyone know?

Stefik