Diagram Partition: in single editor [message #165712] |
Tue, 18 December 2007 04:03  |
Eclipse User |
|
|
|
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 04:26   |
Eclipse User |
|
|
|
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 06:37  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04192 seconds