Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » MultiPageEditor and getSelection() for Actions
MultiPageEditor and getSelection() for Actions [message #997137] Thu, 03 January 2013 22:25
David Scherzinger is currently offline David ScherzingerFriend
Messages: 1
Registered: January 2013
Junior Member
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:
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 Smile
Previous Topic:deploy RCP (plus some fragments)
Next Topic:MultiPageEditor within a MultiPageEditor
Goto Forum:

Current Time: Tue Oct 20 18:12:05 GMT 2020

Powered by FUDForum. Page generated in 0.01383 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top