Hi all,
I am struggling a bit understanding how to add a comment to an element;
public IctElementComment(IModelElement element, String comment, Date date){
if(element==null||comment.equals(null)){
eCheck.sendMessage(MessageType.ERROR,
"IctElementComment() - specify element and comment please");
}
factory = IModelElementFactory.instance();
IComment newComment = factory.createComment();
newComment.setAuthor("ictengineer");
newComment.setDateTime(date.toString());
newComment.setName(element.getName()+" - "+comment);
newComment.setDocumentation("Documentation");
try{
((IComment)element).addComment(newComment);
} catch (Exception ex) {
eCheck.sendMessage(MessageType.ERROR,
"IctElementComment() - " + ex.getMessage() + "" + ex.getLocalizedMessage());
}
}
I cannot find any info other that the API detail.
Any help or pointers will be appreciated.
George