Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Diagram Partition: in single editor
Diagram Partition: in single editor [message #165712] Tue, 18 December 2007 09:03 Go to next message
Eclipse UserFriend
Originally posted by: zzhangh.cn.ibm.com

Hi,
As used diagram partition feature, when a subdiagram is double clicked,
a new editor will be opened to edit the subdiagram. Is it possible to
open subdiagram in same window (in place of parent diagram)?

I tried modifying OpenDiagramEditPolicy#doExecuteWithResult() in my
application as following:

IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();

//Comment this line
//page.openEditor(editorInput, getEditorID());

//Add this line
((MyDiagramEditor)page.getActiveEditor()).setInput(editorInp ut);

But it takes about 10~20 seconds to display the subdiagram, much slower
than original approach. Any other places do I need to modify?

Regards,
Hao
Re: Diagram Partition: in single editor [message #165720 is a reply to message #165712] Tue, 18 December 2007 09:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zzhangh.cn.ibm.com

I forgot one thing, my model files are quite large (diagram file 3.5M,
model file 1.3M). I traced and found the slowest part is in
MyDocumentProvider#setDocumentContent(), domain.getResourceSet()
contains no resource hence resource has to be reloaded, the load() costs
more than 10 seconds to complete.

Any suggestion? for example, any way to avoid reloading the files
because they are already in memory.

I traced

Hao Zhang wrote:
> Hi,
> As used diagram partition feature, when a subdiagram is double clicked,
> a new editor will be opened to edit the subdiagram. Is it possible to
> open subdiagram in same window (in place of parent diagram)?
>
> I tried modifying OpenDiagramEditPolicy#doExecuteWithResult() in my
> application as following:
>
> IWorkbenchPage page =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
>
> //Comment this line
> //page.openEditor(editorInput, getEditorID());
>
> //Add this line
> ((MyDiagramEditor)page.getActiveEditor()).setInput(editorInp ut);
>
> But it takes about 10~20 seconds to display the subdiagram, much slower
> than original approach. Any other places do I need to modify?
>
> Regards,
> Hao
Re: Diagram Partition: in single editor [message #166090 is a reply to message #165720] Thu, 20 December 2007 11:37 Go to previous message
Jacques LESCOT is currently offline Jacques LESCOTFriend
Messages: 247
Registered: July 2009
Senior Member
Hi GMF guys,

I do not know whether it is the good place to ask about it, but as Hao
talk about the possibility to use the same editor to open a subdiagram,
I have a question : what about the openAsEclipseEditor attribute in the
OpenDiagramBehaviour in the GMFGen metamodel ? As I understand it could
be useful to indicate the opening mode we would like (in the same editor
or not which is the default behavior). Unfortunately it seems that it is
not used in the generator templates : is there any enhancement about
that ? What is the aim of that attribute ? I could probably help to work
on this. Another interesting point of using the same editor to edit
different part of a model through multiple diagrams would be that the
same EditingDomain would be shared automatically : a very good point
that would avoid many problems while trying to perform that by hand.

Regards,
Jacques

Hao Zhang a écrit :
> I forgot one thing, my model files are quite large (diagram file 3.5M,
> model file 1.3M). I traced and found the slowest part is in
> MyDocumentProvider#setDocumentContent(), domain.getResourceSet()
> contains no resource hence resource has to be reloaded, the load() costs
> more than 10 seconds to complete.
>
> Any suggestion? for example, any way to avoid reloading the files
> because they are already in memory.
>
> I traced
>
> Hao Zhang wrote:
>> Hi,
>> As used diagram partition feature, when a subdiagram is double clicked,
>> a new editor will be opened to edit the subdiagram. Is it possible to
>> open subdiagram in same window (in place of parent diagram)?
>>
>> I tried modifying OpenDiagramEditPolicy#doExecuteWithResult() in my
>> application as following:
>>
>> IWorkbenchPage page =
>> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
>>
>> //Comment this line
>> //page.openEditor(editorInput, getEditorID());
>>
>> //Add this line
>> ((MyDiagramEditor)page.getActiveEditor()).setInput(editorInp ut);
>>
>> But it takes about 10~20 seconds to display the subdiagram, much slower
>> than original approach. Any other places do I need to modify?
>>
>> Regards,
>> Hao
Previous Topic:TreeRouter Problem
Next Topic:How to implement MultiDiagram support
Goto Forum:
  


Current Time: Wed Apr 24 13:51:43 GMT 2024

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

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

Back to the top