Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 180902

Summary: [Preferences] No way to get PreferencePage and PropertyPage ID
Product: [Eclipse Project] Platform Reporter: Oleg Krasilnikov <oleg.krasilnikov>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P5 CC: mikhail.sennikovskiy
Version: 3.3Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Oleg Krasilnikov CLA 2007-04-04 05:16:54 EDT
Extension points "preferencePages" and "propertyPages"
contain required attribute "ID" to distinguish pages.
It works nice with xml, but there is no means to obtain 
Id from code of propertyPage instance.

When it's required:
For example, we have the implementation of property page,
which is able to display some sub-elements (tabs) depending
of some conditions. See pseudo-xml below:  tab1 should be
displayed on page1, tab2 - on page2. It would be easy for
page to make decision, if it would able to get its own ID.
 
<propertyPage class="xx" id="page1" title="%page1.title"/>
<propertyPage class="xx" id="page2" title="%page2.title"/>
<tab name="tab1" class="t1" parent="page1"/>
<tab name="tab2" class="t2" parent="page2"/>

But now it is impossible.
So, I propose:
- add getId()/setId() methods to IPreferencePage interface.
- implement it in PreferencePage class. 
- set 
- set Id for pages after creating them from extension.

Is it acceptable in priciple ?
Comment 1 Tod Creasey CLA 2007-04-04 09:53:46 EDT
So you are saying that you need the id of your own page to make a decision about it?

I am not sure why you need this information.
Comment 2 Oleg Krasilnikov CLA 2007-04-05 05:00:33 EDT
Yes, you are right. 
Why we need it ?
Imagine, programmer has created PropertyPage implementation class.
Tool integrator wants to create 2 or more extensions using this class,
but with different IDs, so pages would behave differently depending of
their ID (for example, display only tabs which refer to this ID). 

Currently, we are using class name instead of ID. But it requires
creation "dummy" classes (without own code), and, in fact, tool
integrator is not able to add new extensions without writing java code.

Of course, I understand that it may be too late for API changes.
May be this feature can be implemented later ?
Comment 3 Tod Creasey CLA 2007-04-05 08:04:54 EDT
We are past the point of adding any new features for 3.3 and asthis isn't preventing anyone from working this is not a high proirity for us. having said that it looks low risk so I don't have anything against the idea in principle.

However if you want to attach a patch we can consider it for a later release.
Comment 4 Denis Roy CLA 2009-08-30 02:22:10 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.