Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[FIXED] Save icon not getting enabled when editing from xml editor design view
https://www.eclipse.org/forums/index.php/mv/msg/212142/681396/#msg_681396
Max]]>Max Mising name2011-06-09T16:41:52-00:00Re: Save icon not getting enabled when editing from xml editor design view
https://www.eclipse.org/forums/index.php/mv/msg/212142/681779/#msg_681779
I don't really have any ideas as to why this is happening, but you might have some luck tracking things down if you put a breakpoint in org.eclipse.ui.internal.handlers.SaveHandler#evaluate(IEvaluationContext). Something might be causing this to return an evaluation result of false.]]>Nick Sandonato2011-06-09T20:44:57-00:00Re: Save icon not getting enabled when editing from xml editor design view
https://www.eclipse.org/forums/index.php/mv/msg/212142/681836/#msg_681836
Max]]>Max Mising name2011-06-09T23:16:49-00:00Re: Save icon not getting enabled when editing from xml editor design view
https://www.eclipse.org/forums/index.php/mv/msg/212142/683373/#msg_683373
Nick Sandonato2011-06-13T15:59:12-00:00Re: Save icon not getting enabled when editing from xml editor design view
https://www.eclipse.org/forums/index.php/mv/msg/212142/684431/#msg_684431
I ended up putting a breakpoint in ToolItem.setEnabled(...) and noticed that when i switch pages, it gets toggled for Save. The Save CommandContributionItem.updateToolItem() function gets called when I switch pages and somehow when I go to "design" CommandContributionItem.isEnabled() returns false and when I go to "source" it returns true (CommandContributionItem line 661-665). Unfortunately for some reason I can't debug CommandContributionItem even though I can see the source. Not sure why eclipse doesn't let me put breakpoints in the class but it is making it harder to figure out what is happening. Does anyone have any ideas?
Thanks,
Max]]>Max Mising name2011-06-15T15:02:33-00:00[FIXED] Save icon not getting enabled when editing from xml editor design view
https://www.eclipse.org/forums/index.php/mv/msg/212142/695416/#msg_695416
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.