Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » multiple diagrams, one editor + navigator
multiple diagrams, one editor + navigator [message #221826] Wed, 18 March 2009 19:45 Go to next message
Idelman Andro is currently offline Idelman AndroFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,
I'm working on project with multiple diagrams and I want to achieve the
folowing:

1) only one diagram can be edit at a given moment, when a new diagram is
open, its open in the same editor (same tab in the working space).

2) navigating between the diagrams can be done by the project explorer
(Navigator).

right now I have multiple diagrams (no shared model), when I open a new
diagram it opened in a new editor. the generated project explorer shows
only sub diagrams of 'Top Nodes' and they are represented in the project
explorer as siblings of the main element (while they should be children).

what is the recommended solution in this case?
and is it necessary to to use shared model (I want to avoid it) ?

Thanks,
- Andro
Re: multiple diagrams, one editor + navigator [message #221865 is a reply to message #221826] Thu, 19 March 2009 09:24 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Inline comments.

Idelman Andro wrote:
> Hi,
> I'm working on project with multiple diagrams and I want to achieve the
> folowing:
>
> 1) only one diagram can be edit at a given moment, when a new diagram is
> open, its open in the same editor (same tab in the working space).
Are you familiar with multipage editors, it's the same top tab, but
below there will be multiple tabs, each could have a diagram. Is this
what you want?

If not, an alternative could be to close programmaticly the currently
open editor, and open a new one which will take the place of the
previous. (Giving the visual impression that it;s the same tab).

> 2) navigating between the diagrams can be done by the project explorer
> (Navigator).
>
This is simply triggering opening an editor (And closing the previous
one) based on a navigator selection.

> right now I have multiple diagrams (no shared model), when I open a new
> diagram it opened in a new editor. the generated project explorer shows
> only sub diagrams of 'Top Nodes' and they are represented in the project
> explorer as siblings of the main element (while they should be children).
>
> what is the recommended solution in this case? and is it necessary to to
> use shared model (I want to avoid it) ?
>
It's not if you do the "close" trick i think, haven't tried it the
screen could actually flicker.
Cheers Christophe

> Thanks,
> - Andro
>
Re: multiple diagrams, one editor + navigator [message #222076 is a reply to message #221865] Fri, 20 March 2009 07:47 Go to previous messageGo to next message
Idelman Andro is currently offline Idelman AndroFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Christophe, Thanks for the quick replay.
What about the generated Project Explorer -
when a new sub diagram is opened, it is not represented in the right place
of the Project Explorer tree.
Actually, only sub diagrams that are 'Top Nodes' of the main diagram are
represented in the Project Explorer.

how can I fix this?
if I'll use one shared model for all the diagrams,will it affect the
project explorer?

-Andro


Christophe Bouhier wrote:

> Inline comments.

> Idelman Andro wrote:
>> Hi,
>> I'm working on project with multiple diagrams and I want to achieve the
>> folowing:
>>
>> 1) only one diagram can be edit at a given moment, when a new diagram is
>> open, its open in the same editor (same tab in the working space).
> Are you familiar with multipage editors, it's the same top tab, but
> below there will be multiple tabs, each could have a diagram. Is this
> what you want?

> If not, an alternative could be to close programmaticly the currently
> open editor, and open a new one which will take the place of the
> previous. (Giving the visual impression that it;s the same tab).

>> 2) navigating between the diagrams can be done by the project explorer
>> (Navigator).
>>
> This is simply triggering opening an editor (And closing the previous
> one) based on a navigator selection.

>> right now I have multiple diagrams (no shared model), when I open a new
>> diagram it opened in a new editor. the generated project explorer shows
>> only sub diagrams of 'Top Nodes' and they are represented in the project
>> explorer as siblings of the main element (while they should be children).
>>
>> what is the recommended solution in this case? and is it necessary to to
>> use shared model (I want to avoid it) ?
>>
> It's not if you do the "close" trick i think, haven't tried it the
> screen could actually flicker.
> Cheers Christophe

>> Thanks,
>> - Andro
>>
Re: multiple diagrams, one editor + navigator [message #222089 is a reply to message #222076] Fri, 20 March 2009 13:46 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Idelman,

You can customize generated ProjectExplorer content provider in .gmfgen model.

-----------------
Alex Shatalin
Re: multiple diagrams, one editor + navigator [message #222266 is a reply to message #222089] Sun, 22 March 2009 13:19 Go to previous messageGo to next message
Idelman Andro is currently offline Idelman AndroFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Alex,
because I'm using multiple diagrams, I have more the one '.gmfgen' file.
I have tried to customize "____NavigatorContentProvider" both in the main
and the sub '.gmfgen' file as following:
1) adding reference to the other '.gmfgen'
2) changing the relevant "Gen Navigator Child Reference" parent attribute
to point to the desired Node.
but without success.

am I missing something?
or maybe there should be only one "____NavigatorContentProvider" in the
main '.gmfgen' file ?

Thanks,
Andro


Alex Shatalin wrote:

> Hello Idelman,

> You can customize generated ProjectExplorer content provider in .gmfgen
model.

> -----------------
> Alex Shatalin
Re: multiple diagrams, one editor + navigator [message #222419 is a reply to message #222266] Mon, 23 March 2009 20:25 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Idelman,

> but without success.
What was the result?

> or maybe there should be only one "____NavigatorContentProvider" in
> the main '.gmfgen' file ?
No. Each .gmfgen describes own diagram structure, so there should be several
content providers.

-----------------
Alex Shatalin
Re: multiple diagrams, one editor + navigator [message #222936 is a reply to message #222419] Fri, 27 March 2009 09:54 Go to previous messageGo to next message
Idelman Andro is currently offline Idelman AndroFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Alex,
Before I've changed the "____NavigatorContentProvider" in ".gmfgen" of the
sub diagram, the sub diagram appeared as a main node in the project
explorer.
when I change its "Gen Navigator Child Reference" parent attribute to
point to a Node in the Main Diagram, the result is -
the sub diagram does not appear at all in the project explorer.

is this the right course of action?

is there any other way to define where the sub diagram will appear in the
project explorer?

Thanks
Andro.



Alex Shatalin wrote:

> Hello Idelman,

>> but without success.
> What was the result?

>> or maybe there should be only one "____NavigatorContentProvider" in
>> the main '.gmfgen' file ?
> No. Each .gmfgen describes own diagram structure, so there should be several
> content providers.

> -----------------
> Alex Shatalin
Re: multiple diagrams, one editor + navigator [message #223241 is a reply to message #222936] Mon, 30 March 2009 14:31 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Idelman,

Here is a use cases i found for NavigatorContentProvider (this document can
clarify something for you) http://wiki.eclipse.org/GMF_Diagram_Navigator_Use_Cases.
AFAIKSee from the code generation templates, it is not possible now to modify
navigator structure in a way you requested. So, looks like you have to modify
code manually.

-----------------
Alex Shatalin
Previous Topic:Disable node selection
Next Topic:how to link node from compartment to another node
Goto Forum:
  


Current Time: Fri Apr 26 04:35:32 GMT 2024

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

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

Back to the top