Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Adding Javadoc to the Model
Adding Javadoc to the Model [message #1446554] Fri, 17 October 2014 01:50 Go to next message
Ole Ersoy is currently offline Ole ErsoyFriend
Messages: 205
Registered: July 2009
Senior Member
Hi,

I'm trying to figure out the correct way of adding documentation to ecore. If anyone has a snippet example that would be great. I tried this:

<eAnnotations
source="http://www.eclipse.org/emf/2002/GenModel">
<details
key="documentation"
value="Inserted Javadoc Inserted Javadoc Inserted Javadoc Inserted Javadoc Inserted Javadoc.;"/>
</eAnnotations>

But no luck. Also I was reading through Lars Vogel's tutorial:

http://www.vogella.com/tutorials/EclipseEMF/article.html#javadoc

And in section 7 he says that the properties view of the diagram editor is supposed to have a "GenModel Doc" tab, but when I open the properties view all I see is a single "Core tab". Any ideas on what I need to do to get the rest of the tabs?

TIA,
- Ole
Re: Adding Javadoc to the Model [message #1446634 is a reply to message #1446554] Fri, 17 October 2014 04:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30653
Registered: July 2009
Senior Member
Ole,

I'd expect to see a tab like this:



You're using the latest Ecore Tools editor?

This is how EcoreUtil finds documentation:

protected static final String GEN_MODEL_PACKAGE_NS_URI =
"http://www.eclipse.org/emf/2002/GenModel";

public static String getDocumentation(EModelElement eModelElement)
{
EAnnotation eAnnotation =
eModelElement.getEAnnotation(GEN_MODEL_PACKAGE_NS_URI);
return eAnnotation == null ? null :
(String)eAnnotation.getDetails().get("documentation");
}

so what you show below looks correct. What did you annotate and where
are you looking for the result?


On 17/10/2014 3:50 AM, Ole Ersoy wrote:
> Hi,
>
> I'm trying to figure out the correct way of adding documentation to
> ecore. If anyone has a snippet example that would be great. I tried
> this:
>
> <eAnnotations
> source="http://www.eclipse.org/emf/2002/GenModel">
> <details
> key="documentation"
> value="Inserted Javadoc Inserted Javadoc Inserted Javadoc
> Inserted Javadoc Inserted Javadoc.;"/>
> </eAnnotations>
>
> But no luck. Also I was reading through Lars Vogel's tutorial:
>
> http://www.vogella.com/tutorials/EclipseEMF/article.html#javadoc
>
> And in section 7 he says that the properties view of the diagram
> editor is supposed to have a "GenModel Doc" tab, but when I open the
> properties view all I see is a single "Core tab". Any ideas on what I
> need to do to get the rest of the tabs?
>
> TIA,
> - Ole
Re: Adding Javadoc to the Model [message #1446635 is a reply to message #1446634] Fri, 17 October 2014 05:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30653
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I think I have to post as HTML from Thunderbird for the diagram to
come out:<br>
<br>
<img src="https://www.eclipse.org/forums/index.php?t=getfile&amp;id=19545" alt=""><br>
<br>
<div class="moz-cite-prefix">On 17/10/2014 6:59 AM, Ed Merks wrote:<br>
</div>
<blockquote cite="mid:m1q7pq$tgn$1@xxxxxxxxe.org" type="cite">Ole,
<br>
<br>
I'd expect to see a tab like this:
<br>
<br>
<br>
<br>
You're using the latest Ecore Tools editor?
<br>
<br>
This is how EcoreUtil finds documentation:
<br>
<br>
  protected static final String GEN_MODEL_PACKAGE_NS_URI =
<a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/emf/2002/GenModel">"http://www.eclipse.org/emf/2002/GenModel"</a>;
<br>
<br>
  public static String getDocumentation(EModelElement
eModelElement)
<br>
  {
<br>
    EAnnotation eAnnotation =
eModelElement.getEAnnotation(GEN_MODEL_PACKAGE_NS_URI);
<br>
    return eAnnotation == null ? null :
(String)eAnnotation.getDetails().get("documentation");
<br>
  }
<br>
<br>
so what you show below looks correct.   What did you annotate and
where are you looking for the result?
<br>
<br>
<br>
On 17/10/2014 3:50 AM, Ole Ersoy wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
I'm trying to figure out the correct way of adding documentation
to ecore.  If anyone has a snippet example that would be great. 
I tried this:
<br>
<br>
    &lt;eAnnotations
<br>
        source=<a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/emf/2002/GenModel">"http://www.eclipse.org/emf/2002/GenModel"</a>&gt;
<br>
      &lt;details
<br>
          key="documentation"
<br>
          value="Inserted Javadoc Inserted Javadoc Inserted
Javadoc Inserted Javadoc Inserted Javadoc.;"/&gt;
<br>
    &lt;/eAnnotations&gt;
<br>
<br>
But no luck.  Also I was reading through Lars Vogel's tutorial:
<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.vogella.com/tutorials/EclipseEMF/article.html#javadoc">http://www.vogella.com/tutorials/EclipseEMF/article.html#javadoc</a>
<br>
<br>
And in section 7 he says that the properties view of the diagram
editor is supposed to have a "GenModel Doc" tab, but when I open
the properties view all I see is a single "Core tab".  Any ideas
on what I need to do to get the rest of the tabs?
<br>
<br>
TIA,
<br>
- Ole
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>
  • Attachment: ebghcgje.png
    (Size: 8.10KB, Downloaded 111 times)
Re: Adding Javadoc to the Model [message #1447158 is a reply to message #1446635] Fri, 17 October 2014 22:05 Go to previous messageGo to next message
Ole Ersoy is currently offline Ole ErsoyFriend
Messages: 205
Registered: July 2009
Senior Member
I'm going to try answering in small segments, because my messages will not send after I switched to hml editing.
So this is just a test. Ignore the below.

On 10/17/2014 12:00 AM, Ed Merks wrote:
> I think I have to post as HTML from Thunderbird for the diagram to come out:
>
>
>
> On 17/10/2014 6:59 AM, Ed Merks wrote:
>> Ole,
>>
>> I'd expect to see a tab like this:
>>
>>
>>
>> You're using the latest Ecore Tools editor?
>>
>> This is how EcoreUtil finds documentation:
>>
>> protected static final String GEN_MODEL_PACKAGE_NS_URI = "http://www.eclipse.org/emf/2002/GenModel";
>>
>> public static String getDocumentation(EModelElement eModelElement)
>> {
>> EAnnotation eAnnotation = eModelElement.getEAnnotation(GEN_MODEL_PACKAGE_NS_URI);
>> return eAnnotation == null ? null : (String)eAnnotation.getDetails().get("documentation");
>> }
>>
>> so what you show below looks correct. What did you annotate and where are you looking for the result?
>>
>>
>> On 17/10/2014 3:50 AM, Ole Ersoy wrote:
>>> Hi,
>>>
>>> I'm trying to figure out the correct way of adding documentation to ecore. If anyone has a snippet example that would be great. I tried this:
>>>
>>> <eAnnotations
>>> source="http://www.eclipse.org/emf/2002/GenModel">
>>> <details
>>> key="documentation"
>>> value="Inserted Javadoc Inserted Javadoc Inserted Javadoc Inserted Javadoc Inserted Javadoc.;"/>
>>> </eAnnotations>
>>>
>>> But no luck. Also I was reading through Lars Vogel's tutorial:
>>>
>>> http://www.vogella.com/tutorials/EclipseEMF/article.html#javadoc
>>>
>>> And in section 7 he says that the properties view of the diagram editor is supposed to have a "GenModel Doc" tab, but when I open the properties view all I see is a single "Core tab". Any ideas on what I need to do to get the rest of the tabs?
>>>
>>> TIA,
>>> - Ole
>>
>
Re: Adding Javadoc to the Model [message #1447184 is a reply to message #1446635] Fri, 17 October 2014 22:59 Go to previous messageGo to next message
Ole Ersoy is currently offline Ole ErsoyFriend
Messages: 205
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/17/2014 12:00 AM, Ed Merks wrote:<br>
</div>
<blockquote cite="mid:m1q7ra$tgn$2@xxxxxxxxe.org" type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
I think I have to post as HTML from Thunderbird for the diagram to
come out:<br>
<br>
<img src="cid:part1.05010006.03040208@xxxxxxxx" alt=""><br>
<br>
</blockquote>
I'm using the latest Luna download.  I went to Help &gt; Install
Modeling Components and selected Ecore Tools.  After the install, I
right clicked the ecore model and created the corresponding
ecore_diagram model.  The tabs look like this:<br>
<br>
<img alt="image" src="https://www.eclipse.org/forums/index.php?t=getfile&amp;id=19564"
height="395" width="1432"><br>
<br>
I'll answer the second half in different email, in case my markup is
throwing off thunderbird.<br>
<br>
Cheers,<br>
- Ole<br>
<br>
</body>
</html>
  • Attachment: Eclass.png
    (Size: 30.83KB, Downloaded 85 times)
Re: Adding Javadoc to the Model [message #1447191 is a reply to message #1446635] Fri, 17 October 2014 23:10 Go to previous message
Ole Ersoy is currently offline Ole ErsoyFriend
Messages: 205
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<blockquote cite="mid:m1q7ra$tgn$2@xxxxxxxxe.org" type="cite">
<blockquote cite="mid:m1q7pq$tgn$1@xxxxxxxxe.org" type="cite">
You're using the latest Ecore Tools editor? <br>
<br>
This is how EcoreUtil finds documentation: <br>
<br>
  protected static final String GEN_MODEL_PACKAGE_NS_URI = <a
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="http://www.eclipse.org/emf/2002/GenModel">"http://www.eclipse.org/emf/2002/GenModel"</a>;
<br>
<br>
  public static String getDocumentation(EModelElement
eModelElement) <br>
  { <br>
    EAnnotation eAnnotation =
eModelElement.getEAnnotation(GEN_MODEL_PACKAGE_NS_URI); <br>
    return eAnnotation == null ? null :
(String)eAnnotation.getDetails().get("documentation"); <br>
  } <br>
<br>
so what you show below looks correct.   What did you annotate
and where are you looking for the result? <br>
</blockquote>
</blockquote>
<br>
OK - This part works - Thanks!  Tested from scratch with the library
project instead of using my own.<br>
<br>
Thanks again,<br>
- Ole<br>
</body>
</html>
Previous Topic:Create Ecore file programmatically with unique id for every elements
Next Topic:Performance problem: how to speed up loadPackage() in EPackageImpl class
Goto Forum:
  


Current Time: Thu Nov 21 18:55:30 GMT 2019

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

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

Back to the top