Bug 1908 - Project references Property Page doesn't show up in packages view (1GBYXIX)
Summary: Project references Property Page doesn't show up in packages view (1GBYXIX)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Kevin Haaland CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:22 EDT by Erich Gamma CLA
Modified: 2002-01-22 09:09 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erich Gamma CLA 2001-10-10 22:22:02 EDT
EG (4/10/01 3:11:15 PM)
	The Project References Property page should also be available on an IJavaProject.
	The problem is that IJavaProject has an IResource but isn't one.
	One solution is to make the ReferencePropertyPage class API and we will contribute
	it for IJavaProject.

	Another solution is to add support to the plugin.xml markup for specifying that 
	getAdapter(IResource) should be called for an object first before going through
	the contribution mechanism.

NOTES:
EG (4/18/01 5:26:05 PM)
	The solution implemented in the debugger is register the propery page
	against both the IProject and IJavaProject:
<extension point = "com.ibm.eclipse.ui.propertyPages">
	<page
		id = "com.ibm.dt.internal.ui.LauncherPropertyPage"
		class="com.ibm.dt.internal.ui.LauncherPropertyPage"
		objectClass="com.ibm.eclipse.core.resources.IProject"
		name= "%LauncherPropertyPage.name">
	</page>
	<page
		id = "com.ibm.dt.internal.ui.LauncherPropertyPage"
		class ="com.ibm.dt.internal.ui.LauncherPropertyPage"
		objectClass="com.ibm.jdt.core.IJavaProject"
		name= "%LauncherPropertyPage.name">
	</page>
</extension>

	This would be a layer breaker for the workbench and this solution
	isn't applicable in this case. 
	What we could do in the Java tooling is to register the ProjectReferencePage.
	However, this would require that we refer to the internal ProjectReferencePage.
	   	<page name="Project References"
  	   id="com.ibm.eclipse.ui.propertypages.project.reference"
           objectClass="com.ibm.eclipse.core.resources.IProject"
           class="com.ibm.eclipse.internal.ui.dialogs.ProjectReferencePage">
   	</page>

	To make this clean would require to make the ProjectReferencePage accessible
	as API. Since we will not call any method on the ProjectReferencePage the API
	is basically the class name.

EG (4/18/01 7:40:17 PM)
	Tried the above but it didn't work since the ProjectReferencePage does a 
	hard cast on IProject without checking for the IResource adapter.
	See the code below.

	private void initialize() {
		>>>>project= (IProject) getElement();
		noDefaultAndApplyButton();
		StringBuffer buf= new StringBuffer();
		buf.append("Projects may refer to other projects in the workspace.\n");
		buf.append("Use this page to specify what other projects are referenced\n");
		buf.append("by project ");
		buf.append(project.getName());
		buf.append(".");
		setDescription(buf.toString());

TC (5/1/01 4:48:32 PM) - this has been changed to the following 
project = (IProject) getElement().getAdapter(IResource.class);

but we still need to determine what the final answer should be as this is an internal class
Comment 1 Kevin Haaland CLA 2002-01-21 20:53:55 EST
Is this still an issue for you?
Comment 2 Erich Gamma CLA 2002-01-22 03:01:18 EST
issue is addressed, you can close
Comment 3 Kevin Haaland CLA 2002-01-22 09:09:45 EST
Thanks Erich