Search code examples
eclipseeclipse-plugineclipse-rcposgi-bundle

ViewsPlugin.class is missing in this org.eclipse.ui.views_3.9.0.v20170226-1833.jar Plugin


ViewsPlugin.class is missing in this org.eclipse.ui.views_3.9.0.v20170226-1833.jar plugin.

Anyone know, Please give the suggest me. Any alternate option.


Solution

  • That class was internal, so it shouldn't have been used in other plugins in the first place.

    It was removed in Bug 478242. See the Gerrit change there for details.

    If you need the PLUGIN_ID (for whatever reason), you can use

    FrameworkUtil.getBundle(ContentOutline.class).getBundleId();
    // or use any other class from that bundle instead of `ContentOutline`
    

    If you need the getAdapter utility method which was there earlier, use

    Adapters.getAdapter(object, adapter, true);
    

    as noted in Bug 478333.

    If you need the replacement for getViewImageDescriptor, then use

    private ImageDescriptor createImageDescriptor(String relativeIconPath) 
    {
        String ICONS_PATH = "$nl$/icons/full/";//$NON-NLS-1$
        Bundle bundle = FrameworkUtil.getBundle(ContentOutline.class);
        ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
            String.valueOf(bundle.getBundleId()), 
            ICONS_PATH + relativeIconPath);
        return imageDescriptor;
    }
    

    (taken from this changeset)