Home » Eclipse Projects » GEF » Multi-page GEF editor advice?
Multi-page GEF editor advice? [message #77351] |
Tue, 29 April 2003 13:15  |
Eclipse User |
|
|
|
I'm building a GEF-based editor and I want to implement multiple pages using
the MultiPageEditorPart (e.g. to provide a "Library" page for managing
common elements.)
If anybody else has been down this path, or has words of wisdom, I'd love to
hear what you have to say. In particular, I'm not sure whether to follow the
standard MultiPageEditorPart practice of embedding a wholly independant
editor on each page, or whether I should install a "master" GEF editor on
one page and simply installing lightweight "slave" editors in the other
pages to delegate work to the master.
Given the work I'm doing, once I've finished this I can derive a code sample
and give it back tot he community.
....Richard
|
|
| |
Re: Multi-page GEF editor advice? [message #77395 is a reply to message #77351] |
Tue, 29 April 2003 15:36   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Use MultiPageEditor if each page will be a different *type* of editor.
Supposedly, MultipageEditor is good at switching out the action bar
contributions, such as toolbar, menu, etc.
If every page will display exactly the same type of graphical view, with the
same type of actions, menus, etc. I would write my own Editor that contains
a CTabFolder within it. Each tab would contain its own
ScrollingGraphicalViewer. When you switch tabs, change the site's
selectionprovider to be the active viewer.
But, you need to consider everything else, not just the editor part. For
example, you would need to implement you own outline page that flipped its
own pages.
"Richard Clark" <rdclark@nextquestion.net> wrote in message
news:b8mbta$dpt$1@rogue.oti.com...
> I'm building a GEF-based editor and I want to implement multiple pages
using
> the MultiPageEditorPart (e.g. to provide a "Library" page for managing
> common elements.)
>
> If anybody else has been down this path, or has words of wisdom, I'd love
to
> hear what you have to say. In particular, I'm not sure whether to follow
the
> standard MultiPageEditorPart practice of embedding a wholly independant
> editor on each page, or whether I should install a "master" GEF editor on
> one page and simply installing lightweight "slave" editors in the other
> pages to delegate work to the master.
>
> Given the work I'm doing, once I've finished this I can derive a code
sample
> and give it back tot he community.
>
> ...Richard
>
>
|
|
|
Re: Multi-page GEF editor advice? [message #77412 is a reply to message #77395] |
Tue, 29 April 2003 16:08   |
Eclipse User |
|
|
|
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b8mk8p$lim$1@rogue.oti.com...
> Use MultiPageEditor if each page will be a different *type* of editor.
> Supposedly, MultipageEditor is good at switching out the action bar
> contributions, such as toolbar, menu, etc.
That sounds like what I need then -- I have a diagram where most of the
editing happens but need a second view for defining a bunch of global
values. Each of these views has its own set of actions, menu commands, etc.
These both refer to the same underlying model, which is why I'm wondering if
I should have one GEF editor and divide up the pages into "master / slave",
"editor / child component", or split the tasks between two subclasses of
Editor.
> If every page will display exactly the same type of graphical view, with
the
> same type of actions, menus, etc. I would write my own Editor that
contains
> a CTabFolder within it.
Though, if I ever decide to break the diagram into multiple "pages" itself,
I'll keep the custom Editor approach in mind.
....R
|
|
|
Re: Multi-page GEF editor advice? [message #78137 is a reply to message #77368] |
Tue, 06 May 2003 16:03  |
Eclipse User |
|
|
|
> However, MultiPageEditPart also allows a page to be a simple SWT Control.
> So, a third way might be:
> 3) Wrap a GEF EditPart in a SWT Control.
I am currently doing something like this with my own multi-page editor.
One of the editor's pages contains an SWT composite which, among other
controls, contains a GEF GraphicalEditorWithPalette.
One major problem I encountered with this approach concerns the
SelectionProvider. GEF registers its own SelectionProvider on the edit
site, and this SelectionProvider is needed for several GEF
functionalities. But the MultiPageEditPart assumes that the
SelectionProvider for the site is an instance of
MultiPageSelectionProvider. The result: ClassCastExceptions from the
MultiPageEditPart.
To circumvent this problem, I created a subclass of
MultiPageSelectionProvider called AggregateSelectionProvider. I override
MultiPageEditPart's init() method to register the
AggregateSelectionProvider instance. Then, I override
GraphicalEditorWithPalette's hookGraphicalViewer() method to add the
editor as a delegate of the AggregateSelectionProvider rather than setting
the editor as the site SelectionProvider. The AggregateSelectionProvider
then forwards selection events to its delegate. (There was a little more
to it than that, but that's the gist of it.) A kludgy solution, but
workable.
I am still in the midst of implementation, so I may encounter further
issues as I continue. Overall, I would not recommend using the "GEF
EditPart in an SWT Control" approach. Neither MultiPageEditPart nor GEF
appear to be designed to accomodate this configuration.
|
|
|
Goto Forum:
Current Time: Sun Jun 08 18:00:37 EDT 2025
Powered by FUDForum. Page generated in 0.24494 seconds
|