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

Bug 59301

Summary: [GlobalActions] View gets uninitialized ViewSite in its init method
Product: [Eclipse Project] Platform Reporter: Ondrej Chylik <ondrej.chylik>
Component: UIAssignee: Douglas Pollock <douglas.pollock>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: eclipse, n.a.edgar
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 75835    

Description Ondrej Chylik CLA 2004-04-20 13:21:22 EDT
I've run into a use case when I wanted to use view's ActionBars in the init 
method of the view.

But this can't be done because site.getActionBars() returns null in the context 
of method IViewPart.init. This is clearly seen in ViewFactory..busyRestoreView:
First a ViewSite object is created, then it is passed to the view's init method 
and _then_ the ViewSite is initialized with action bars (and pane).

I don't see the reason why the ActionBars object isn't initialized _before_ it 
is passed to the view. Could it?

If required, I could provide more information about the motivation of my use 
case.
Comment 1 Nick Edgar CLA 2004-04-21 15:37:02 EDT
Sounds like a bug.
Comment 2 Nick Edgar CLA 2004-05-05 09:48:17 EDT
Stefan, can you look into this one please?  Should also check the editor site case.
Comment 3 Kim Horne CLA 2004-05-13 13:10:30 EDT
Fix in HEAD along with tests that assert that various site fields have been
initialized.
Comment 4 Kim Horne CLA 2004-05-19 11:19:32 EDT
Verified in 200405190010 via the test suites.
Comment 5 Kim Horne CLA 2004-07-06 09:32:18 EDT
Closing to keep a tidy house.  Pardon the spam.
Comment 6 Douglas Pollock CLA 2004-08-18 14:31:17 EDT
The fix for this bug caused Bug 69900.  This is a regression over 2.1.3 
behaviour, and has to be corrected for 3.0.1 and 3.1. 
 
 
Comment 7 Douglas Pollock CLA 2004-08-18 14:34:45 EDT
[dpollock@dev eclipse]$ grep -r 'Fix for 59301' org.eclipse.ui.* 
org.eclipse.ui.tests/Eclipse UI 
Tests/org/eclipse/ui/tests/api/IWorkbenchPartTest.java,v:@Fix for 59301 
org.eclipse.ui.tests/Eclipse UI 
Tests/org/eclipse/ui/tests/api/MockEditorPart.java,v:@Fix for 59301 
org.eclipse.ui.tests/Eclipse UI 
Tests/org/eclipse/ui/tests/api/MockViewPart.java,v:@Fix for 59301 
org.eclipse.ui.tests/Eclipse UI 
Tests/org/eclipse/ui/tests/api/MockWorkbenchPart.java,v:@Fix for 59301 
org.eclipse.ui.tests/Eclipse UI 
Tests/org/eclipse/ui/tests/api/MockPart.java,v:@Fix for 59301 
org.eclipse.ui.workbench/Eclipse 
UI/org/eclipse/ui/internal/ViewFactory.java,v:@Fix for 59301 
org.eclipse.ui.workbench/Eclipse 
UI/org/eclipse/ui/internal/EditorManager.java,v:@Fix for 59301 
org.eclipse.ui.workbench/Eclipse 
UI/org/eclipse/ui/internal/WorkbenchPartReference.java,v:@Fix for 59301 
org.eclipse.ui.workbench/Eclipse 
UI/org/eclipse/ui/internal/ViewPane.java,v:@Fix for 59301 
 
Comment 8 Douglas Pollock CLA 2004-08-18 16:31:05 EDT
My goof; I don't believe this is associated with Bug 69900 anymore. 
Comment 9 Douglas Pollock CLA 2004-08-18 16:31:21 EDT
Moving back to CLOSED 
Comment 10 Douglas Pollock CLA 2004-10-12 17:33:33 EDT
Restoring the original milestone. 
Comment 11 Douglas Pollock CLA 2004-10-12 17:35:05 EDT
Nick: Is this a regression over 2.1.3?  This is causing another problem with 
Bug 75835 that is definitely a regression.  If this change was just additional 
functionality, I would recommend reverting it.