Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Multipage editor with GEF

I almost feel stupid since this kind of is an obvious solution.
I believed that I had already tried it, but I guess I hadn't.
It works fine - thanks!

-ra

> Hello,
>
> I have gotten GEF working in a multi page editor.  It has been a while
> since I did this so I don't exactly remember all the details.  I do know
> that I ran into the issue that you are stating here.  One of the things
> I did in my subclass of "GraphicalEditorWithFlyoutPalette" was to
> override the selectionChange method like so:
>
> public void selectionChanged(IWorkbenchPart part, ISelection selection)
>     {
>         // If not the active editor, ignore selection changed.
>         // if (this.equals(getSite().getPage().getActiveEditor()))
>             updateActions(getSelectionActions());
>     }
>
>
> The GraphicalEditorWithFlyoutPalette definition of this has the if
> statement intact (not commented out).  I believe that when you are in a
> multi-page editor the getSite().getPage().getActiveEditor() will return
> the multi page part and there for the superclass version won't ever call
> updateActions.
>
> To be fair what I did isn't exactly correct.  The update actions logic
> will be called more often that it needs to be.  What I really should do
> instead of commenting out the if logic is to put correct logic in the if
> statement.  What I should do is check to see if the active editor is the
> GEF Editors parent (the multi page editor) and check to see if the
> current page selected in the multi-page editor is equal to the GEF
> editor.  however at the time I was lazy and this worked (albeit
> inefficiently).
>
> I don't know if this is the solution to your problem or not.  Hopefully
> it will help.
>
> Regards,
> Michael MacFadden
> Rasmus Aveskogh wrote:
>
>>Hello,
>>
>>I'm trying to put a GEF editor in a multipage editor
>>(MultiPageEditorPart). I have tried using the Shapes example as a base
>>just for trying my concepts but the editor this one is based on
>>(GraphicalEditorWithFlyoutPalette) seems to rely on the fact that it's a
>>top editor in the workbench.
>>
>>I've looked through some of the code of the supplied GEF actions and
>>especially actions based on 'SelectionAction' seem to rely on on this.
>>When I put my GEF-editor inside my multipage editor actions such as
>>'Delete' which is a subclass of 'SelectionAction' stop working.
>>I assume mainly because the selection-framework doesn't work as it
>> should.
>>
>>Is there any smooth way to solve this? Do I have to extend and ovveride
>>all the actions myself if I want to solve this? Do I also have to
>> override
>>some of the logics in the GraphicalEditorWithFlyoutPalette-editor? So it
>>doesn't rely on the fact that it's the active editor.
>>
>>-ra
>>
>>Quis custodiet ipsos custodes?
>>
>>_______________________________________________
>>gef-dev mailing list
>>gef-dev@xxxxxxxxxxx
>>https://dev.eclipse.org/mailman/listinfo/gef-dev
>>
>>
>
>
> --
> =====================================================
> Michael MacFadden         mmacfadden@xxxxxxxxxxxx
> Red Oak Software          http://www.redoaksw.com
>
> 69 Cascade Drive          Ph   585-454-3170 x104
> Suite 303                 Fax  585-454-6769
> Rochester, NY 14614
> =====================================================
>
>
>


-ra

Quis custodiet ipsos custodes?



Back to the top