Bug 198402 - AdvancedPropertySection extensibility support
Summary: AdvancedPropertySection extensibility support
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-31 10:35 EDT by Anthony Hunter CLA
Modified: 2019-09-06 15:30 EDT (History)
2 users (show)

See Also:


Attachments
registers action bar contributions of the AdvancedPropertySection (3.36 KB, patch)
2007-08-01 04:36 EDT, Carsten Pfeiffer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Hunter CLA 2007-07-31 10:35:07 EDT
In Bug 131855 , extensibility support was requested for AdvancedPropertySection.

Add a protected factory method AdvancedPropertySheetSection.createPropertySheetPage() so that subclasses have
the possibility to provide their own, e.g. to set a custom sorter.

Register and unregister action contributions in the tabbedPropertySheetPage
 (e.g. "Show Advanced Properties"). Also makes the description hint work again 
 (IPropertyDescriptor.getDescription() shown in the status line).

Carsten provided a patch to Bug 131855 as an example.
Comment 1 Carsten Pfeiffer CLA 2007-07-31 11:36:05 EDT
JFTR, the patch about registering and unregistering the toolbar actions and statusbar seems to be incomplete. I noticed multiple actions in the toolbar, so the unregistering probably doesn't always work. I didn't investigate, yet.
Comment 2 Anthony Hunter CLA 2007-07-31 12:34:48 EDT
Yes, the Eclipse Project Explorer uses the AdvancedPropertySection and it gets multiple menu entries.

Note that GMF has this support, in their own AdvancedPropertySection.

Following GMF, we also need to add 

actionBars.getToolBarManager().update(true);

Otherwise the toolbar icons do not show up.

Comment 3 Carsten Pfeiffer CLA 2007-08-01 04:34:59 EDT
(In reply to comment #2)
> Note that GMF has this support, in their own AdvancedPropertySection.
> 
> Following GMF, we also need to add 
> 
> actionBars.getToolBarManager().update(true);
> 
> Otherwise the toolbar icons do not show up.

Even though they do show up here, an update() doesn't seem to hurt. The multiple entries are caused by multiple calls of AdvancedPropertySection.aboutToBeShown(). The first call comes via TabbedPropertySheetPage.handlePartActivated(), the second call comes via  TabbedPropertySheetPage.SelectionChangedListener.selectionChanged() -> showTab().

So all is fine when you only change the selection in a view, but as soon as you switch to another tab, you get the contributions registered a second time.

A simple fix would be to let AdvancedPropertySection remember whether it has already registered its contributions and avoid multiple registrations:

	private void registerPartContributions() {
		if (contributionsRegistered) {
			return;
		}
		
		contributionsRegistered = true;
[...]

I'll attach a new patch for that.
Comment 4 Carsten Pfeiffer CLA 2007-08-01 04:36:19 EDT
Created attachment 75105 [details]
registers action bar contributions of the AdvancedPropertySection
Comment 5 Carsten Pfeiffer CLA 2007-10-01 04:32:12 EDT
Any chance this might go into M3? 
Thanks, Carsten
Comment 6 Philipe Mulet CLA 2008-05-23 04:29:10 EDT
Please adjust the target milestone, so it does not point at a closed milestone in the past.
Comment 7 Boris Bokowski CLA 2009-05-06 16:50:27 EDT
Removing 3.5 target milestone. We are in the end-game now. Please have a look and decide if this should be targeted at 3.6.
Comment 8 Eclipse Webmaster CLA 2019-09-06 15:30:33 EDT
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.