Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tigerstripe-dev] Selection Conversion concept

So with the fix you included to Bug 234233, I think what remains is that the
SelectionConverter is used in the selection of the annotation to display in
the view, but not on the right-click actions. This is still a problem as you
have 2 different behaviors.

However, here again to avoid race conditions, you want to look at all
converted selections and build the list on that, rather than taking the
first selection...

Eric


On 5/28/08 8:07 AM, "Eric Dillon" <erdillon@xxxxxxxxx> wrote:

> Hi Yuri,
> 
> Thanks for you quick response.... However... :-)
> 
> I removed the SelectionConverter and as expected annotations now do appear
> in the UI (although not the ones defined for IModelComponent which is
> "correct" from a TAF point of view!), but they are attached to Iresource or
> IJavaElement. And this is to be expected since the Objects from the Explorer
> are indeed IJavaElement, but they correspond to to IModelComponent. "I" know
> that, how would the TAF know????
> 
> This is why the selection converter was a key here. Even further, when
> selecting an EditPart on a diagram I need to map it to the corresponding
> IModelComponent. There is no way around it.
> 
> So I NEED to be using the SelectionConverter all over the place, include in
> the Explorer. Which means the problem is still there. That "adaptation" will
> continue failing.
> 
> Eric
> 
> 
> On 5/28/08 2:36 AM, "Yuri Strot" <yuri@xxxxxxxxx> wrote:
> 
>> Hi Eric,
>> 
>>> From the Tigerstripe perspective, it is currently impossible to create
>>> annotations on any Model Artifact as displayed in the Tigerstripe Explorer.
>>> 
>>> Here is what is going on:
>>> 
>>> When the user selects a Model Artifact from the Tigerstripe Explorer, the
>>> selection is propagated as a usual ISelection to the TAF. The selection will
>>> contain a ICompilationUnit as Tigerstripe Artifacts are stored in .java
>>> files.
>>> In fact, the Tigerstripe explorer is a PackageExplorer with changes to the
>>> Label provider and the content provider.
>>> The TAF routes this selection through all Selection Converters that may have
>>> been registered to populate the Annotation properties view. In our case, we
>>> have a TSModelSelectionConverter that will recognize the ICompilationUnit as
>>> being a valid TS model component and return a "converted selection" to
>>> IModelComponent. As a result, the URI is calculated correctly to be
>>> "tigerstripe:/....".
>> 
>> As I see, there are some misunderstanding of the Selection Conversion
>> concept,
>> so
>> I'll try to explain it better.
>> 
>> Selection Converter is an auxiliary component which help to convert
>> *non-component*
>> selection to *component* selection. For example, Java Editor using
>> ITextSelection as
>> every text document editor. To show annotations in the Java Editor we'll need
>> to convert
>> ITextSelection to java elements selection. We can't create annotation
>> provider
>> for
>> ITextSelection, because it haven't URI. There is why we need to use Selection
>> Converter
>> which show as java elements by document selection.
>> 
>> Converting ICompilationUnit to IModelComponent will be done with the
>> framework
>> automatically. So if there are all what TSModelSelectionConverter do, please
>> remove it.
>> 
>> --
>> Best regards,
>> Yuri Strot.
>> _______________________________________________
>> tigerstripe-dev mailing list
>> tigerstripe-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/tigerstripe-dev
> 
> _______________________________________________
> tigerstripe-dev mailing list
> tigerstripe-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tigerstripe-dev



Back to the top