|MultiPageEditor and getSelection() for Actions [message #997137]
||Thu, 03 January 2013 22:25
| David Scherzinger
Registered: January 2013
Hi, new forum member and Eclipse Platform newbie here, so apologies if I mix up concepts or terms here. I'll try to explain what I mean as well as I can.|
I'm working on a project where one ECore object has several different editors, so I've recently been tasked to condense them into one MultiPageEditor per object. One of our editors is a diagram editor, and we're building a context menu off of several Actions (really AbstractActionHandlers). However, stuffing the diagram editor into a page in a MultiPageEditor causes several of our context menu items to be disabled due to getSelection() returning null.
I've seen and successfully implemented the solution described here: http://www.eclipse.org/forums/index.php/m/325901/
by overriding getSelection() in each of the Actions defined in our code base. Unfortunately, this means I've been copy-pasting code between several files. Given that this is terrible in practice and will be impossible to do upkeep on in the future, is there a better place to override the getSelection() functionality? I think it's worth mentioning that each of our Actions extends a different AbstractAction, which I can't edit, and which makes superclassing all of our own classes impossible, unless there's something I'm missing.
Basically, I'd like to know if there is another point in the call stack where I can get a selection from a page in a MultiPageEditor instead of its containing window, because I haven't been able to find such a solution so far. Also, I'd like to do as little damage to the overall structure of our software as possible.
Thanks in advance! Please let me know if you need clarification on any of this
Powered by FUDForum
. Page generated in 0.16921 seconds