Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tigerstripe-dev] Delegation Solution

Hi Yuri,

This behavior is indeed correct, but we never get a chance to call
IAnnotationManager.addAnnotation( (IModelComponent) ..., content) because
the adaptation can't create IModelComponent the way the Classloader is used.

(See my response to other post).

Eric


On 5/28/08 3:36 AM, "Yuri Strot" <yuri@xxxxxxxxx> wrote:

>> So I read once again Yuri's email about what delegation is for, and I think
>> that if I was to define our Provider as a delegate of IResource, it would
>> lead
>> to having all Annotations defined on IResource instead of IModelComponent,
>> but
>> they would probably appear in the UI.
>> I don't this is a viable solution though since we need to access the
>> Annotations programmatically at code generation from the model, and we'd need
>> to have the annotations defined against proper IModelComponents instead...
> 
> As I understand, framework works exactly what you need. So, I'll explain
> delegation
> solution by the example:
> 
> Let's IModelComponent delegate to IJavaElement and IJavaElement delegate to
> IResource. Say we have following POJOs which represent the same project:
> 
>  ITigerstripeModelProject tProject;
>  IJavaProject jProject;
>  IProject rProject;
> 
> So, we can create following annotations;
> 
>  IAnnotationManager.addAnnotation(tProject, content1);
>  IAnnotationManager.addAnnotation(jProject, content2);
>  IAnnotationManager.addAnnotation(rProject, content3);
> 
> Now we can use IAnnotationManager.getAnnotations(Object object, boolean
> delegate)
> to get all annotations by POJO object:
> 
>  IAnnotationManager.getAnnotations(tProject, false) return 1 annotation
>  IAnnotationManager.getAnnotations(jProject, false) return 1 annotation
>  IAnnotationManager.getAnnotations(rProject, false) return 1 annotation
> 
>  IAnnotationManager.getAnnotations(tProject, true) return 3 annotations
>  IAnnotationManager.getAnnotations(jProject, true) return 2 annotations
>  IAnnotationManager.getAnnotations(rProject, true) return 1 annotation
> 
> Is it the right way?
> 
> --
> Best regards,
> Yuri Strot.
> _______________________________________________
> tigerstripe-dev mailing list
> tigerstripe-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tigerstripe-dev



Back to the top