Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 382599 - Help: Icons not taken from IToc2/ITopic2 Implementations
Summary: Help: Icons not taken from IToc2/ITopic2 Implementations
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-14 05:03 EDT by Peter Dell CLA
Modified: 2019-11-27 07:45 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Dell CLA 2012-06-14 05:03:21 EDT
Build Identifier: Version 3.6.2 M20110210-1200

Hello,
I have implemented the extensions point org.eclipse.help.toc and provided new icons which are used by my AbstractTocProvider implementation to indicate which help documents are PDF files.

The problem is that the following code in 
org.eclipse.help.ui.internal.views.AllTopicsPart

Checks for "instanceof Toc" and "instanceof Topic" instead of
checking for "instanceof IToc2" and "instanceof ITopic2".



	class TopicsLabelProvider extends LabelProvider {
		public String getText(Object obj) {
			if (obj instanceof IHelpResource)
				return ((IHelpResource) obj).getLabel();
			return super.getText(obj);
		}

		public Image getImage(Object obj) {
			boolean expanded = treeViewer.getExpandedState(obj);
			boolean expandable = treeViewer.isExpandable(obj);
			if (obj instanceof Toc){
				Toc toc = (Toc) obj;
				Image icon   = HelpUIResources.getImageFromId(toc.getIcon(), expanded, !expandable); 
				if (icon != null) {
					return icon;
				}						
			}
			
			if (obj instanceof Topic) {
				Topic topic = (Topic) obj;			
				Image icon   = HelpUIResources.getImageFromId(topic.getIcon(), expanded, !expandable); 
				if (icon != null) {
					return icon;
				}
			}

Reproducible: Always

Steps to Reproduce:
1. Implemente the extension point org.eclipse.help.toc, add a toc-icon
2. Implement own classes for the interfaces IToc2/ITopic2
3. Open the online help and see the standard icon used despite of coreect implementation.
Comment 1 Lars Vogel CLA 2019-11-27 07:45:00 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.