Property definitions

nitc $ MPackageTree :: defaultinit
# A simple specialisation of OrderedTree to display packages, groups and modules
class MPackageTree
	super OrderedTree[MConcern]

	# The model where to look for information
	var model: Model

	redef fun display(a) do
		if a isa MGroup then
			if a.parent == null then return "{a.mpackage.name} ({a.filepath or else "?"})"
			return a.name + " (group)"
		else if a isa MModule then
			return a.name
		else
			abort
		end
	end

	private var linex_comparator: nullable LinexComparator = null

	# Sort modules and groups with their names
	fun sort_with_alpha
	do
		sort_with(alpha_comparator)
	end

	# Sort modules and groups with a loosely adaptation of the linearization of modules
	fun sort_with_linex
	do
		var c = linex_comparator
		if c == null then
			c = new LinexComparator(self)
			linex_comparator = c
		end
		sort_with(c)
	end
end
src/model/model_viz.nit:21,1--57,3