Bug 1984 - [View Mgmt] views with undeclared category attribute are tossed (1GD41DV)
Summary: [View Mgmt] views with undeclared category attribute are tossed (1GD41DV)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Debbie Wilson CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2001-10-10 22:23 EDT by Jim des Rivieres CLA
Modified: 2004-02-11 12:22 EST (History)
1 user (show)

See Also:


Attachments
Patch for org.eclipse.ui.workbench (2.14 KB, patch)
2003-06-18 11:20 EDT, Debbie Wilson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jim des Rivieres CLA 2001-10-10 22:23:50 EDT
Nothing happens if the "category" attribute mentions an undeclared category in
the <view> contributed to the org.eclipse.ui.views extension point.

Steps to reproduce:

0. Create a plug-in that contributes a view to the  org.eclipse.ui.views extension point
and mentions the name of an undeclared category in the category attribute on the <view> element.
(See attached plugin.xml and .java source file.)

1. Start eclipse
2. Perspective -> Show View -> Other
3. Expand the all of the categories.

Observe: The new view does not show up any where.

Expectation: If the category is undeclared, I would expect (a) the view to show up 
in the place it would had I omitted the "category" attribute entirely, and perhaps (b)
a helpful entry written to the platform log.

4. Exit the workbench

Observe: No log entry.
Expectation: 

=contents of plugin.xml=========================
<plugin
  name="Hello World View"
  id="com.example.jeem.hello"
  version="1.0"
  provider-name="Jeem">

  <requires>
    <import plugin="org.eclipse.ui"/>
  </requires>

  <runtime>
    <library name="hello.zip"/>
  </runtime>

  <extension
	point="org.eclipse.ui.views">
	<view
       		id="com.example.jeem.hwViewId"
		category="com.example.jeem.hwViewCat"
		name="Hello World View"	
		class="com.example.jeem.HelloWorld">
	</view>
  </extension>

</plugin>

=contents of /com/example/jeem/HelloWorld.java=========================
package com.example.jeem;

import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;

public class HelloWorld extends ViewPart{
	
	Label fLabel;
	
	public void createPartControl(Composite parent) {
		fLabel = new Label(parent, SWT.NONE);
		fLabel.setText("Hello world");
	}
	
	public void setFocus() {
		fLabel.setFocus();
	}
}

=.log excerpt==========================================

Log: Wed May 02 13:53:44 EDT 2001
2 org.eclipse.core.runtime 1 Problems encountered loading the plug-in registry.
	1=============<children>=============
	2 org.eclipse.core.runtime 1 No plugin found for: file:/D:/eclipse102-jdk/eclipse/plugins/org.eclipse.core.boot/plugin.xml
	2 org.eclipse.core.runtime 1 No plugin found for: file:/D:/eclipse102-jdk/eclipse/plugins/org.eclipse.jface.examples/plugin.xml
	2 org.eclipse.core.runtime 1 No plugin found for: file:/D:/eclipse102-jdk/eclipse/plugins/org.eclipse.scripting.examples/plugin.xml
	2 org.eclipse.core.runtime 1 No plugin found for: file:/D:/eclipse102-jdk/eclipse/plugins/org.eclipse.scripting.examples.adapter.development/plugin.xml
	2 org.eclipse.core.runtime 1 No plugin found for: file:/D:/eclipse102-jdk/eclipse/plugins/org.eclipse.swt.examples/plugin.xml
	2 org.eclipse.core.runtime 1 No plugin found for: file:/D:/eclipse102-jdk/eclipse/plugins/org.eclipse.vcm.core.webdav/plugin.xml
	2 org.eclipse.core.runtime 1 Unknown extension point org.eclipse.ui.editorsActions specified in plug-in org.eclipse.ui.examples.readmetool.
	2 org.eclipse.core.runtime 1 Unknown extension point com.ibm.eclipse.core.help.contribution specified in plug-in org.eclipse.ui.examples.readmetool.
	2 org.eclipse.core.runtime 1 Unknown extension point org.eclipse.ui.makerImageProvider specified in plug-in org.eclipse.debug.ui.
	1=============</children>=============


NOTES:
Comment 1 DJ Houghton CLA 2001-10-29 17:43:29 EST
PRODUCT VERSION:

build 102

Comment 2 Kevin Haaland CLA 2002-02-01 11:12:37 EST
Doc could be improved to make the API contract more clear. 
There are no plans to change the current behavior for 2.0. 
Comment 3 Randy Giffen CLA 2002-08-06 17:21:26 EDT
Reopened for investigation
Comment 4 Kevin Haaland CLA 2002-09-03 17:12:35 EDT
Doc could be improved to make the API contract more clear. 
There are no plans to change the current behavior for 2.0. 
Comment 5 Debbie Wilson CLA 2003-06-18 11:20:51 EDT
Created attachment 5230 [details]
Patch for org.eclipse.ui.workbench

Patch to output an error message if an unknown category is specified for a
view.  Doc changes not included in this patch.
Comment 6 Nick Edgar CLA 2003-06-24 10:08:19 EDT
The attached patch file has two copies of the diffs.  How was this generated?  
This may indicate a bug in Compare.
Comment 7 Debbie Wilson CLA 2003-06-24 10:56:06 EDT
In Package Explorer view
- select the project (e.g. org.eclipse.ui.workbench)
- right click on the project (for context menu)
- Team->Create Patch...
- select 'Save in File System'
- enter a path for the patch

Not sure which version of Eclipse I was using to generate the patch but likely 
a 3.0 Integration build shortly before the patch was generated.
Comment 8 Nick Edgar CLA 2003-06-24 12:06:10 EDT
Deb is filing a separate PR against Platform Compare for the patch file problem.

Patch released with a couple of changes:
- do not externalize log error string
- use Category.getName() instead of ICategory.MISC_NAME

Comment 9 Debbie Wilson CLA 2004-02-11 12:22:13 EST
This PR was fixed some time ago but never marked verified.  Verified in 
I20040210800 (candidate for M7).