Skip to main content

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

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.

Back to the top