[FIXED] Save icon not getting enabled when editing from xml editor design view [message #681396] |
Thu, 09 June 2011 16:41 |
Max Mising name Messages: 54 Registered: September 2010 |
Member |
|
|
I have a perspective for our project which is a glorified file browser. It reuses a lot eclipse code (editors, commands, etc). When I edit an xml file in eclipse (3.6.1) from the "Design" page, if I hit enter or tab or click on a different attribute the editor becomes "dirty" and the save icon is enabled showing I can save the file. When I perform the same action in my perspective on an xml file in the "Design" page, the editor shows that it is dirty (has the *) but the save icons are not enabled and Ctrl+S doesn't work either. Although when I make any edits in the "Source" page in my perspective, everything works perfectly and I don't have any problems, it is only in the design page. Does anyone have any ideas as to why this could be happening? I am using the EditorRegistry to look up what editor to use based on file name.
Max
[Updated on: Mon, 11 July 2011 17:23] Report message to a moderator
|
|
|
|
|
|
|
[FIXED] Save icon not getting enabled when editing from xml editor design view [message #695416 is a reply to message #684431] |
Mon, 11 July 2011 17:20 |
Max Mising name Messages: 54 Registered: September 2010 |
Member |
|
|
I ended up posting to RCP forum to see if anyone there might know why I was seeing this behavior and I actually ended up figuring it out on my own. Here is the link to the other forum: http://www.eclipse.org/forums/index.php/t/219216/
My realization:
Quote:
I ended up figuring out that in Eclipse, there is an IDEWorkbenchWindowAdvisor which creates a WorkbenchActionBuilder for the ActionBarAdvisor. That class creates SaveAction object which becomes a global action object. I made my ActionBarAdivsor create the action object in makeActions and it all works now. The SaveAction I was seeing before was one created for the right click save menu option on the editor. Which is why the handler is null in the "Design" page (there is no menu option to save then). So those SaveActions created for right click menus were effecting the my save CommandContributionItems enable state. When I created the SaveAction like WorkbenchActionBuilder in my ActionBarAdvisor, those right click menu SaveActions stopped effecting the main menu/toolbar items.
[Updated on: Mon, 11 July 2011 17:22] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04607 seconds