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

Bug 92148

Summary: [WorkbenchParts] Global Refactorings disabled after opening editor
Product: [Eclipse Project] Platform Reporter: Michael Valenta <Michael.Valenta>
Component: UIAssignee: Stefan Xenos <sxenos>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: andre_weinand, douglas.pollock, Mike_Wilson
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Valenta CLA 2005-04-20 16:26:16 EDT
In build Build id: I20050419-1200, I selected some code in a class that was 
read only for the purpose of extracting a method. All the entries in the 
refactor menu were disabled. Making the file writable made all the menu items 
enabled. This is regression since this used to work OK for me.
Comment 1 Dirk Baeumer CLA 2005-04-21 04:36:08 EDT
Michael, extract method goes through validateEdit in this case. I tested it with
I20050419-1200 and it works for me. Could it be that the file isn't on the build
path ?

Any additional steps to reprodcue.
Comment 2 Dirk Baeumer CLA 2005-04-21 04:59:44 EDT
OK, doing some more testing this looks like a part activation problem. It has
nothing to do with read-onyl.The context menu contains all menu entries and they
are enabled. Steps to reproduce:

- new workpsace
- new project, package, CU
- open CU in editor
- select type name

Observe: refactoring actions in context menu are enabled, however in global menu
the actions are disabled.

- give focus to package explorer
- give focus back to editor

observe: actions in global menu bar are enabled.

Moving to Platform/UI
Comment 3 Stefan Xenos CLA 2005-04-27 15:38:04 EDT
The main menubar's contributions seem to be 1 editor out-of-synch. Also try this:

- select text in java editor
- edit->copy
- switch to another java editor
- edit->paste

Pastes into the previous editor.
Comment 4 Stefan Xenos CLA 2005-04-27 15:39:57 EDT
Mike: this seems to be the bug you were observing.

This seems to occur when switching between two editors of the same type, but not
when switching between two different editor types. (If you switch from a java
editor to a plugin manifest editor, all the actions point to the right spot...
but switch between two manifest editors and everything goes crazy).
Comment 5 Mike Wilson CLA 2005-04-27 15:56:07 EDT
Agree that this sounds like the same problem. Note that I was seeing it on the Mac, but MichaelV uses 
Windows.
Comment 6 Stefan Xenos CLA 2005-04-27 19:21:37 EDT
The editor action bars were being updated after the activate event was fired,
but the activate listeners for retargetable actions expect the action bars to be
up-to-date. 

This event ordering bug was caused by recent workbenchpage refactoring.

Fixed in HEAD.
Comment 7 Kim Horne CLA 2005-04-28 10:50:42 EDT
*** Bug 93032 has been marked as a duplicate of this bug. ***
Comment 8 Stefan Xenos CLA 2005-05-10 23:04:44 EDT
Verified in I20050510-0010