| Summary: | Activation of a newly added view does not work | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Oleg Besedin <ob1.eclipse> | ||||||||
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | bokowski, emoffatt, remy.suen | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 156265 [details]
StackRenderer patch v2
Remy's patch looks like it goes in the right direction. Eric - any comments, or should Remy just commit the change? <rcjsuen> emoffatt: if i add a part to a stack that has no children, should it be selected? <emoffatt> rcjsuen: seems reasonable to me Do we want to open a separate bug on this topic? I can't get editors to render when they're opened (but views work @_@), I don't know if it's related or not. Created attachment 156398 [details]
A simpler patch
The PRE already listens to children being added/removed and calls the renderer's showChild/hideChild methods (that's why the tab gets created).
Since the code that's opening the view has already declared that the new element is the selected one (i.e. the stack's getActiveChild is already correct) all this code does is make sure that when a child gets added or removed that the active child is handled correctly.
Committed in >20100118. Applied my patch. |
Created attachment 155868 [details] Illustrative patch - not a general fix - not meant to be applied The activation of a newly added view does not seem to work as the activation request is processed before the actual ETab item is created in the ETabFolder. To reproduce: - Launch the product from the "org.eclipse.e4.ide.application" bundle to create launch configuration - Add the photo demo bundle to the launch configuration - Launch the product + photo demo bundle; use Window -> Show View item. Select "Library" view, press OK, - Note that the "Library" view is added to the correct primary navigation stack on the left, but not activated. - Clicking on the tab for the "Library" view will activate it and make content visible. The code called to activate is PartServiceImpl#showPart() -> PartServiceImpl#activate(MPart). Attached patch makes couple funny changes to make activation work. The patch, of course, is for illustration only and not meant to be applied.