Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsWhat is a ModelTreeNode category?
https://www.eclipse.org/forums/index.php/mv/msg/8445/25963/#msg_25963
I would like to be able to enhance an outline with a 'category'
on labels so that an outline might appear as:
<if> ...
<then> ...
<else> ...
with the ... provided by a standard label provider and the
<then> provided by a prefix.
A plausible approach might be to create a PrefixedModelTreeNode.
However this is a bit klunky since new ModelTreeNode occurs in many
places; factoring creation into a createTreeItem() would help.
A derived ModelTreeNode is actually impossible since nodes are
maintained in an array rather than a list. Gioven the use of an
arraycopy for each addition it is far from clear that the array
gives a performance benefit.
So perhaps the category integer could be annexed by creating an
integer-to-prefix string map; but who else uses categories, so
how can the category integers avoid conflict?
Regards
Ed Willink]]>Ed Willink2008-11-28T17:06:46-00:00Re: What is a ModelTreeNode category?
https://www.eclipse.org/forums/index.php/mv/msg/8445/574794/#msg_574794
[Sorry for the delay in responding; we've been very busy
working on various aspects of the next release over the last
couple of months.]
To answer the subject question, a ModelTreeNode category is a
category associated with a given ModelTreeNode. It's presently
used to permit the grouping of sets of related items in the
Outline view.
> I would like to be able to enhance an outline with a 'category'
> on labels so that an outline might appear as:
> <if> ...
> <then> ...
> <else> ...
>
> with the ... provided by a standard label provider and the
> <then> provided by a prefix.
The issue here is that what gets handed to a LabelProvider is
*not* a ModelTreeNode, but rather the AST that the ModelTreeNode
represents.
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?
--
Cheers,
-- Bob
--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center
IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
X10: Productive High-Performance Parallel Programming (http://x10.sf.net)]]>Robert M. Fuhrer2009-02-09T16:31:26-00:00Re: What is a ModelTreeNode category?
https://www.eclipse.org/forums/index.php/mv/msg/8445/26296/#msg_26296
[Sorry for the delay in responding; we've been very busy
working on various aspects of the next release over the last
couple of months.]
To answer the subject question, a ModelTreeNode category is a
category associated with a given ModelTreeNode. It's presently
used to permit the grouping of sets of related items in the
Outline view.
> I would like to be able to enhance an outline with a 'category'
> on labels so that an outline might appear as:
> <if> ...
> <then> ...
> <else> ...
>
> with the ... provided by a standard label provider and the
> <then> provided by a prefix.
The issue here is that what gets handed to a LabelProvider is
*not* a ModelTreeNode, but rather the AST that the ModelTreeNode
represents.
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?
--
Cheers,
-- Bob
--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center
IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
X10: Productive High-Performance Parallel Programming (http://x10.sf.net)]]>Robert M. Fuhrer2009-02-09T16:31:26-00:00Re: What is a ModelTreeNode category?
https://www.eclipse.org/forums/index.php/mv/msg/8445/26411/#msg_26411
"Robert M. Fuhrer" <rfuhrer@watson.ibm.com>
??????:49905A5E.70304@watson.ibm.com...
> Ed Willink wrote:
>
> [Sorry for the delay in responding; we've been very busy
> working on various aspects of the next release over the last
> couple of months.]
>
> To answer the subject question, a ModelTreeNode category is a
> category associated with a given ModelTreeNode. It's presently
> used to permit the grouping of sets of related items in the
> Outline view.
>
>> I would like to be able to enhance an outline with a 'category'
>> on labels so that an outline might appear as:
>> <if> ...
>> <then> ...
>> <else> ...
>>
>> with the ... provided by a standard label provider and the
>> <then> provided by a prefix.
>
> The issue here is that what gets handed to a LabelProvider is
> *not* a ModelTreeNode, but rather the AST that the ModelTreeNode
> represents.
>
> 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?
>
> --
> Cheers,
> -- Bob
>
> --------------------------------
> Robert M. Fuhrer
> Research Staff Member
> Programming Technologies Dept.
> IBM T.J. Watson Research Center
>
> IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
> X10: Productive High-Performance Parallel Programming (http://x10.sf.net)]]>Jin Missing name2009-02-10T09:18:28-00:00Re: What is a ModelTreeNode category?
https://www.eclipse.org/forums/index.php/mv/msg/8445/574835/#msg_574835
"Robert M. Fuhrer" <rfuhrer@watson.ibm.com>
??????:49905A5E.70304@watson.ibm.com...
> Ed Willink wrote:
>
> [Sorry for the delay in responding; we've been very busy
> working on various aspects of the next release over the last
> couple of months.]
>
> To answer the subject question, a ModelTreeNode category is a
> category associated with a given ModelTreeNode. It's presently
> used to permit the grouping of sets of related items in the
> Outline view.
>
>> I would like to be able to enhance an outline with a 'category'
>> on labels so that an outline might appear as:
>> <if> ...
>> <then> ...
>> <else> ...
>>
>> with the ... provided by a standard label provider and the
>> <then> provided by a prefix.
>
> The issue here is that what gets handed to a LabelProvider is
> *not* a ModelTreeNode, but rather the AST that the ModelTreeNode
> represents.
>
> 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?
>
> --
> Cheers,
> -- Bob
>
> --------------------------------
> Robert M. Fuhrer
> Research Staff Member
> Programming Technologies Dept.
> IBM T.J. Watson Research Center
>
> IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
> X10: Productive High-Performance Parallel Programming (http://x10.sf.net)]]>Jin Missing name2009-02-10T09:18:28-00:00Re: What is a ModelTreeNode category?
https://www.eclipse.org/forums/index.php/mv/msg/8445/26446/#msg_26446
> 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]]>Ed Willink2009-02-10T17:56:33-00:00Re: What is a ModelTreeNode category?
https://www.eclipse.org/forums/index.php/mv/msg/8445/574851/#msg_574851
> 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.