Home » Modeling » GMF (Graphical Modeling Framework) » Creating more than one gmfmodel from one ecore model.
Creating more than one gmfmodel from one ecore model. [message #148696] |
Fri, 31 August 2007 09:18  |
Eclipse User |
|
|
|
Originally posted by: biju_gopinathan.rediffmail.com
Hi friends,
Is it possible to create more than one gmf model and digram
plugin from the same ecore model.
I tried it and is able to run it seperately. But when I run
it from a single rcp application, one digram works correctly, but in
the another digram file, I am not able to place any figurs from pallete,
and if I create Items on canvas using the pop up menu it throws an
StackOverflow Exception.
1. Is it possible to run multiple digram's(with slight difference)
made of same ecore model inside a single rcp application?
2. If yes, what might be wrong in my case?
Thanks and regards Biju
|
|
| | | | | | |
Re: Creating more than one gmfmodel from one ecore model. [message #149180 is a reply to message #148944] |
Thu, 06 September 2007 06:23   |
Eclipse User |
|
|
|
hi,
I 've the similar problem, I need multiple editors to show different
views of the same model.
I use a shared editingDomain for each editors, and make sure that the
each editor reference the GMF diagram with different type.
and use the DiagramEditorInput instead of the FileEditorInput, and the
some small changes in DiagramEditor class and XXXDocumentProvider class.
it will be ok.
-------------------------------------
hi,
I 've the similar problem, I need multiple editors to show different
views of the same model.
I use a shared editingDomain for each editors, and make sure that the
each editor reference the GMF diagram with different type.
and use the DiagramEditorInput instead of the FileEditorInput, and the
some small changes in DiagramEditor class and XXXDocumentProvider class.
it will be ok.
Marsha wrote:
> Hi,
> Sorry this I don't know. And I still didn't get how I can draw on the
> canvas from etditor1 with editor2.
> Someone can tell me which class or method checks if the creation tool has
> the right to "work" or not?
> Thanks
> Marsha
|
|
| |
Re: Creating more than one gmfmodel from one ecore model. [message #149448 is a reply to message #149411] |
Thu, 06 September 2007 22:20   |
Eclipse User |
|
|
|
hi, Marsha,
sorry for not express it clearly. my way is that use a shared
EditingDomain to manage the resources for multiple editor, and use
diagramEditorInput as input for each editor.
env: GMF1.0.3
-- XXXDiagramEditor -------------------------------------
/* (non-Javadoc)
* @see
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor#getDiagram()
*/
@Override
public Diagram getDiagram() {
// TODO Auto-generated method stub
IEditorInput input = getEditorInput();
if(input instanceof DiagramEditorInput){
DiagramEditorInput dinput = (DiagramEditorInput)input;
return dinput.getDiagram();
}
return super.getDiagram();
}
/**
* @generated
*/
protected TransactionalEditingDomain createEditingDomain() {
TransactionalEditingDomain editingDomain =
XXXEditingDomainManager.getInstance().getCurrentXXXEditingDo main(getEditingDomainID());
editingDomain.setID(getEditingDomainID());
return editingDomain;
}
--- 2. XXXDocumentProvider --------------
/* (non-Javadoc)
* @see
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDiagramDocumentProvider#createInputWithEditingDomai n(org.eclipse.ui.IEditorInput,
org.eclipse.emf.transaction.TransactionalEditingDomain)
*/
@Override
public IEditorInput createInputWithEditingDomain(IEditorInput
editorInput, TransactionalEditingDomain domain) {
return editorInput;
// // TODO Auto-generated method stub
// return super.createInputWithEditingDomain(editorInput, domain);
}
/* (non-Javadoc)
* @see
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider#getStatus(java.lang.Object)
*/
@Override
public IStatus getStatus(Object element) {
return STATUS_OK;
}
/* (non-Javadoc)
* @see
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDocumentProvider#isModifiable(java.lang.Object)
*/
@Override
public boolean isModifiable(Object element) {
if(element instanceof DiagramEditorInput){
return true;
}
return super.isModifiable(element);
}
/* (non-Javadoc)
* @see
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.StorageDocumentProvider#createDocument(java.lang.Object )
*/
@Override
protected IDocument createDocument(Object element) throws CoreException {
// TODO Auto-generated method stub
IDocument document = super.createDocument(element);
if(document == null){
if (element instanceof DiagramEditorInput) {
document= createEmptyDocument();
if (setDocumentContent(document, (IEditorInput) element)) {
setupDocument(element, document);
}
}
}
return document ;
}
--------------------------------------------------------
3. and when editor actived, the EditingDomain id should be set as the
active editor's domain id. and so, it will support multiple editor to open
a file or multiple files.
Marsha wrote:
> Hi
> Thanks a lot for your answer, that sounds promising but I have some
> problems with understanding.
> Hui wrote:
>> I 've the similar problem, I need multiple editors to show different
>> views of the same model.
>> I use a shared editingDomain for each editors, and make sure that the
>> each editor reference the GMF diagram with different type.
> So you use the same sharedEditingDomain for all editors, like described in
> the tutorials I mentionned earlier?
> What do you mean with different type? Which type? Do you mean the file
> extension of the editor?
> Would be cool if you could clarify those points for me...
> Thanks
> Marsha
|
|
| |
Re: Creating more than one gmfmodel from one ecore model. [message #149465 is a reply to message #149448] |
Fri, 07 September 2007 09:12   |
Eclipse User |
|
|
|
Originally posted by: biju_gopinathan.rediffmail.com
ZhangHui wrote:
> hi, Marsha, sorry for not express it clearly. my way is that use a
> shared EditingDomain to manage the resources for multiple editor, and
> use diagramEditorInput as input for each editor.
> env: GMF1.0.3
> -- XXXDiagramEditor -------------------------------------
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor#getDiagram()
>
> */
> @Override
> public Diagram getDiagram() {
> // TODO Auto-generated method stub
> IEditorInput input = getEditorInput();
>
> if(input instanceof DiagramEditorInput){
> DiagramEditorInput dinput = (DiagramEditorInput)input;
> return dinput.getDiagram();
> }
>
> return super.getDiagram();
> }
> /**
> * @generated
> */
> protected TransactionalEditingDomain createEditingDomain() {
> TransactionalEditingDomain editingDomain =
> XXXEditingDomainManager.getInstance().getCurrentXXXEditingDo main(getEditingDomainID());
>
> editingDomain.setID(getEditingDomainID());
>
> return editingDomain;
> }
>
> --- 2. XXXDocumentProvider --------------
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDiagramDocumentProvider#createInputWithEditingDomai n(org.eclipse.ui.IEditorInput,
> org.eclipse.emf.transaction.TransactionalEditingDomain)
> */
> @Override
> public IEditorInput createInputWithEditingDomain(IEditorInput
> editorInput, TransactionalEditingDomain domain) {
> return editorInput;
> // // TODO Auto-generated method stub
> // return super.createInputWithEditingDomain(editorInput, domain);
> }
>
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider#getStatus(java.lang.Object)
>
> */
> @Override
> public IStatus getStatus(Object element) {
> return STATUS_OK;
> }
>
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDocumentProvider#isModifiable(java.lang.Object)
>
> */
> @Override
> public boolean isModifiable(Object element) {
> if(element instanceof DiagramEditorInput){
> return true;
> }
> return super.isModifiable(element);
> }
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.StorageDocumentProvider#createDocument(java.lang.Object )
>
> */
> @Override
> protected IDocument createDocument(Object element) throws
> CoreException {
> // TODO Auto-generated method stub
> IDocument document = super.createDocument(element);
> if(document == null){
> if (element instanceof DiagramEditorInput) {
> document= createEmptyDocument();
> if (setDocumentContent(document, (IEditorInput) element)) {
> setupDocument(element, document);
> }
> }
> }
> return document ;
> }
>
>
> --------------------------------------------------------
> 3. and when editor actived, the EditingDomain id should be set as the
> active editor's domain id. and so, it will support multiple editor to
> open a file or multiple files.
Hi ,
Thanks for the reply,
Where can I find the getEditingDomainID 'XXXEditingDomainManager'
class. I am not able to find it in my generated digram code. I am using
gmf 2.0
Thanks again Biju
>
>
> Marsha wrote:
>
>> Hi
>
>> Thanks a lot for your answer, that sounds promising but I have some
>> problems with understanding.
>
>> Hui wrote:
>>> I 've the similar problem, I need multiple editors to show
>>> different views of the same model. I use a shared editingDomain
>>> for each editors, and make sure that the each editor reference the
>>> GMF diagram with different type.
>
>> So you use the same sharedEditingDomain for all editors, like
>> described in the tutorials I mentionned earlier?
>> What do you mean with different type? Which type? Do you mean the file
>> extension of the editor?
>
>> Would be cool if you could clarify those points for me...
>
>> Thanks
>
>> Marsha
>
>
|
|
| | |
Re: Creating more than one gmfmodel from one ecore model. [message #149482 is a reply to message #149448] |
Sat, 08 September 2007 01:32   |
Eclipse User |
|
|
|
Originally posted by: biju_gopinathan.rediffmail.com
Hi friends,
I am not able to see the following discussed classes in my
generated digram code(XXXEditingDomainManager,
FileDiagramDocumentProvider, AbstractDocumentProvider,
FileDocumentProvider, StorageDocumentProvider). Are you using GMF 1.0 ,
I am using GMF2.0, so how can I do this.
Thanks for the help Biju
ZhangHui wrote:
> hi, Marsha, sorry for not express it clearly. my way is that use a
> shared EditingDomain to manage the resources for multiple editor, and
> use diagramEditorInput as input for each editor.
> env: GMF1.0.3
> -- XXXDiagramEditor -------------------------------------
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor#getDiagram()
>
> */
> @Override
> public Diagram getDiagram() {
> // TODO Auto-generated method stub
> IEditorInput input = getEditorInput();
>
> if(input instanceof DiagramEditorInput){
> DiagramEditorInput dinput = (DiagramEditorInput)input;
> return dinput.getDiagram();
> }
>
> return super.getDiagram();
> }
> /**
> * @generated
> */
> protected TransactionalEditingDomain createEditingDomain() {
> TransactionalEditingDomain editingDomain =
> XXXEditingDomainManager.getInstance().getCurrentXXXEditingDo main(getEditingDomainID());
>
> editingDomain.setID(getEditingDomainID());
>
> return editingDomain;
> }
>
> --- 2. XXXDocumentProvider --------------
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDiagramDocumentProvider#createInputWithEditingDomai n(org.eclipse.ui.IEditorInput,
> org.eclipse.emf.transaction.TransactionalEditingDomain)
> */
> @Override
> public IEditorInput createInputWithEditingDomain(IEditorInput
> editorInput, TransactionalEditingDomain domain) {
> return editorInput;
> // // TODO Auto-generated method stub
> // return super.createInputWithEditingDomain(editorInput, domain);
> }
>
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider#getStatus(java.lang.Object)
>
> */
> @Override
> public IStatus getStatus(Object element) {
> return STATUS_OK;
> }
>
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDocumentProvider#isModifiable(java.lang.Object)
>
> */
> @Override
> public boolean isModifiable(Object element) {
> if(element instanceof DiagramEditorInput){
> return true;
> }
> return super.isModifiable(element);
> }
> /* (non-Javadoc)
> * @see
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.StorageDocumentProvider#createDocument(java.lang.Object )
>
> */
> @Override
> protected IDocument createDocument(Object element) throws
> CoreException {
> // TODO Auto-generated method stub
> IDocument document = super.createDocument(element);
> if(document == null){
> if (element instanceof DiagramEditorInput) {
> document= createEmptyDocument();
> if (setDocumentContent(document, (IEditorInput) element)) {
> setupDocument(element, document);
> }
> }
> }
> return document ;
> }
>
>
> --------------------------------------------------------
> 3. and when editor actived, the EditingDomain id should be set as the
> active editor's domain id. and so, it will support multiple editor to
> open a file or multiple files.
>
>
> Marsha wrote:
>
>> Hi
>
>> Thanks a lot for your answer, that sounds promising but I have some
>> problems with understanding.
>
>> Hui wrote:
>>> I 've the similar problem, I need multiple editors to show
>>> different views of the same model. I use a shared editingDomain
>>> for each editors, and make sure that the each editor reference the
>>> GMF diagram with different type.
>
>> So you use the same sharedEditingDomain for all editors, like
>> described in the tutorials I mentionned earlier?
>> What do you mean with different type? Which type? Do you mean the file
>> extension of the editor?
>
>> Would be cool if you could clarify those points for me...
>
>> Thanks
>
>> Marsha
>
>
|
|
| | | | |
Re: Creating more than one gmfmodel from one ecore model. [message #150498 is a reply to message #150392] |
Thu, 13 September 2007 00:27  |
Eclipse User |
|
|
|
Originally posted by: biju_gopinathan.rediffmail.com
Hi Marsha,
You are right, there is no need in sharing the editing
domain, to create two digram plugins. Their Editing Domain ID in gmfgen
should also be unique
Thanks and Regards Biju
Marsha wrote:
> Alex Shatalin wrote:
>
>> Hello biju,
>
>> Yes, it is possible. Please read
>> http://wiki.eclipse.org/GMF_GenModel_Hints and check all the
>> properties marked as "unique" in this document was
> modified
>> in both .gmfgen models prior to the code generation and are unique
>> among the scope of .gmfgen models you are working with.
>
>> -----------------
>> Alex Shatalin
>
> Hi Alex,
>
> So, if I get it right you don't use a shared editing domain here,
> since the Editing Domain ID must be unique too.
>
> Marsha
>
>
|
|
|
Goto Forum:
Current Time: Mon Jul 14 00:28:23 EDT 2025
Powered by FUDForum. Page generated in 0.08461 seconds
|