[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.technology.imp] Re: What is a ModelTreeNode category?
|
Hi Robert
I think that you might be able to achieve the effect you want
if you could (optionally) use a different LabelProvider just for
the Outline view, and that LabelProvider could supply the prefix
as well as the rest of the label in your example.
This augmented LabelProvider could always instantiate the "normal"
LabelProvider implementation, and add to whatever it produces.
Does that sound like it addresses your need?
My primary concern was what is the semantic definition of a category
and who uses it for what, and so to what extent other usages could hijack
it for other purposes. It would be helpful to find the intended usage documented
near the ModelTreeNode.fCategory declaration.
I discovered empirically that I could indeed create an Integer to
MyFormattingAlgorithm mapping and thereby annotate ModelTreeNode
with a required behaviour. I exploit the empirical observation that
0 is the default so I can start my 'algorithm's at 1.
I dislike my empirical approach, because you may break it in a future
release, and I have exploited the only avenue by which extensions of
my code can extend.
The real problem is that IMP supports extension by services
but ignores extension by inheritance. Thus creation of a derived
of ModelTreeNode is not feasible. If this is really required it would
be helpful for a ModelTreeNode to have a counterpart to the
org.eclipse.swt.widgets.Widget.data Object for application
usage. Arguably this is just a redesignation of category as Object rather
than int. Alternatively/additionally a standard Eclipse idiom such as
Adapters could be permitted.
Regards
Ed Willink