tmf: Clean up tmf.ui.project.model
Cleanup the ITmfProjectModelElement hierarchy:
* Make all fields in the abstract class private, replace accesses with
the getter methods.
This also has the advantage of giving us the right type, for elements
that override for example the getResource() return type.
* Make refreshChildren() abstract, the great majority of the
implementations should handle it. It's easy to "forget" to override
a method, while you can't forget an abstract method.
* Remove addChild() and removeChild() from the interface. Ideally
these should be only called by the owners themselves.
* The "parent.addChild(this)" pattern is quite bad. It muddles the
ownership, and calls "this" in a constructor, which is bad practice.
Have the parents add the child to themselves after they create it.
* Implement hasChildren() as a default interface method.
* Have getChildren() return an ImmutableList copy of the original
list. Callers shouldn't be modifying it!
Change-Id: Ie2e8129bef447ecbdce9add0e8cf9bd28ba36783
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/67387
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Hudson CI
This page took 0.027641 seconds and 5 git commands to generate.