Management of the plugin.xml [message #60621] |
Tue, 10 October 2006 08:52  |
Eclipse User |
|
|
|
Hi,
I'd like to know how I can preserve my customizations in the plugin.xml file
when I generate again the diagram code. The plugin.xml is owerwritten every
time, and I lose all my extensions although not the related source code.
What should I do?
I've another problem: I'd like to generate diagram code from two gmfgen
files in the same project in order to share the same source package (each
generated diagram code has its own packages and sub-packages). Every time I
generate the diagram code (from the .gmfgenA or from the .gmfgenB) the
plugin.xml file is overwritten. How can I merge the two generated plugin.xml
files without modify them programmatically by hand?
Thanks in advance.
Best regards,
Fabio.
|
|
|
|
|
|
|
|
|
|
|
|
Re: Management of the plugin.xml [message #67881 is a reply to message #67602] |
Mon, 23 October 2006 10:28   |
Eclipse User |
|
|
|
Hi Alex,
I modified "metamodelType" with "specializationType" (maybe in an incorrect
way, please take a look at the attachments).
In the log file I don't see any error. The method
???VisualIDRegistry.getNodeVisualID() returns a >0 value only when I open
the diagram (for the diagram element); when I try to add an element into a
diagram, this method is never crossed ().
The very strange thing is that the diagram in whicht I declared the
extension point for the editing domain works only if I close the other
project.
If both plugins are loaded, the first one doesn't work any more.
I posted the two plugin.xml: plugin1.xml contains the extension point and
the "metamodelType",
whereas the second one contains "specializationType".
I'm sure that I forget and mistake something, but I don't understand what.
Thanks again and sorry for my insistence.
Best regards,
Fabio.
"Alex Shatalin" <vano@borland.com> ha scritto nel messaggio
news:cd695fb3123d48c8c4b3966acc5b@news.eclipse.org...
> Hello Fabio,
>
> Did you substitute duplicating "metamodelType" with "specializationType"?
> (I've suggested this to one of the corresponding postings).
> Do you see any errors in the log?
> You can debug element creation by putting breakpoints into the generated
> ???VisualIDRegistry.getNodeVisualID() method. VisualIDRegistry is
> responsible
> for determining element type and will be called on each element creation.
> Result should be > 0 for the known elements.
>
> -----------------
> Alex Shatalin
>
>
Attachment: plugin2.xml
(Size: 15.16KB, Downloaded 267 times)
Attachment: plugin1.xml
(Size: 29.38KB, Downloaded 164 times)
|
|
|
|
Re: Management of the plugin.xml [message #70030 is a reply to message #68033] |
Thu, 26 October 2006 06:58   |
Eclipse User |
|
|
|
Hi Alex,
sorry for my late reply but I made a lot of attempts and debug in order to
find my problem.
For simplicity, I used a sample (the shape example posted in the attachment)
which contains only Square, Circle and Connection.
I created two GMF projects (shape and simpleShape) everyone builded from own
..gmfgraph, .gmftool, .gmfmap and gmfgen files; both the editors shared the
same model (shape.uml -> shape.ecore and shape.genmodel).
Starting to these two projects, my aim is to make sharing the same editing
domain among them.
In order to achieve this, I made all the attempts that I told you during
this thread. But also with this simple example, I encountered the same
problems (in both kind of diagrams I can't add any element).
The solution I found has been that one to use the same ClientContextID in
both the plugin.xml for the
org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings extension point.
Both the clientContext already shared the same editingDomainID (setted in
both the gmfgen).
Is this the correct solution ? Is this what I forgotten to do (an unique
clientContex) ?
But also in this way, a problem happens:
1. I create DiagramA (a shape diagram)
2. I create DiagramB (a simpleShape diagram)
3. Both the diagrams work fine.
4. If I create another diagram (a shape diagram or a simpleShape diagram),
the old ones don't work any more. Two exceptions happens:
a) FileDocumentProvider.createElementInfo
org.eclipse.core.runtime.CoreException: Resource contains no diagram
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal .util.DiagramIOUtil.load(DiagramIOUtil.java:197)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal .util.DiagramIOUtil.load(DiagramIOUtil.java:123)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDiagramDocumentProvider.setDocumentContentFromStora ge(FileDiagramDocumentProvider.java:154)
...................................................
b) Unable to create editor ID shape.diagram.part.ShapeDiagramEditorID: An
exception was thrown during initialization
java.lang.NullPointerException
at
org.eclipse.emf.transaction.util.TransactionUtil.getEditingD omain(TransactionUtil.java:50)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .DiagramModificationListener. <init>(DiagramModificationListener.java:52)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDiagramModificationListener. <init>(FileDiagramModificationListener.java:53)
at
shape.diagram.part.ShapeDocumentProvider$CustomModificationL istener. <init>(ShapeDocumentProvider.java:151)
at
shape.diagram.part.ShapeDocumentProvider.createFileInfo(Shap eDocumentProvider.java:102)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.docu ment.FileDocumentProvider.createElementInfo(FileDocumentProv ider.java:486)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.connect(AbstractDocumentProvider.j ava:387)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.doSetInput(DiagramDocumentEditor.java:42 6)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.setInput(DiagramDocumentEditor.java:389)
at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEdito r.java:318)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.init( DiagramEditor.java:643)
...................................................
In the attachment I posted the shape example (model source code, GMF files
for both plugins and the two GMF projects), please take a look.
If using the same clientcontext for both the editor is the right solution,
Do I need to make what is indicated in the thread
MultiPageEditor and ElementBinding (Dynamic editing domain ID) ?
Thanks again Alex and sorry for all the time you spend for me.
Best regards,
Fabio
"Alex Shatalin" <vano@borland.com> ha scritto nel messaggio
news:cd695fb3124068c8c4e986d0a94d@news.eclipse.org...
> Hello Fabio,
>
>> I modified "metamodelType" with "specializationType" (maybe in an
>> incorrect way, please take a look at the attachments).
> Looks like plugin.xml was correctly patched. Did you create corresponding
> HelperAdvice classes?
>
>> ???VisualIDRegistry.getNodeVisualID() returns a >0 value only when I
>> open the diagram (for the diagram element); when I try to add an element
>> into a diagram, this method is never crossed ().
> Really strange. Can you put a breakpoint into both generated
> ???ViewProvider.getNodeViewClass
> ? This method should be called on creating command for creating an element
> (once you pick a tool from the palette and move it upon the diagram).
>
>> If both plugins are loaded, the first one doesn't work any more.
> What about "second" siagram? Does it work? It looks like a conflict across
> two plugins. Looks like you have to spend some time in debugging. BTW, do
> you have DIFFERENT modelIDs specified in genmodels for these two plugins?
>
> -----------------
> Alex Shatalin
>
>
|
|
|
|
|
|
Re: Management of the plugin.xml [message #70473 is a reply to message #70435] |
Thu, 26 October 2006 20:08  |
Eclipse User |
|
|
|
Alex, thank you so much for documenting this topic!
Fabio, if you want to create a client context dynamically I think the
only thing you'll need to consider is that it be registered with the
ClientContextManager before your element types are required. The
diagram editor would be an appropriate spot unless your application has
another way to edit the model without the diagram being open.
--Linda
Alex Shatalin wrote:
> Hello Fabio,
>
> Here is the corresponding wiki page:
> http://wiki.eclipse.org/index.php/GMF_Tips#Sharing_single_Ed itingDomain_instance_across_several_diagrams.
> If you find any errors please notify me.
>
>> thank you so much :-)). I didn't think I had to use the same
>> clientContextID
> Me too. I found it during debugging while writing this wiki page.
>
>> If I would like to create a clientContext through code as described in
>> "MultiPageEditor and ElementBinding (Dynamic editing domain ID) ",
>> where could I create it ? Can I create it in the editor class ?
> Probably yes, but this is a question mostly to the runtime team.
>
> -----------------
> Alex Shatalin
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06124 seconds