Community
Participate
Working Groups
HEAD. F4 (open type hierarchy) on a class or interface does show all super classes correctly, but leaves out the super interfaces (by default). This omission is ok in quick type hierarchy, but maybe in F4, interfaces can be included as well. The interfaces only appear when one clicks the "show super type hierarchy" button in the type hierarchy view. Ex: -------------------------------------------------- public class A extends B implements C { // F4 on A } class B { } interface C{ } --------------------------------------------- interface A extends B { // F4 on A } interface B { } ---------------------------------------------- Perhaps for the first example, leaving out superinterfaces was a conscious decision because of performance concerns, but for the second example, it translates to A having no type hierarchy at all, which doesnt make sense. Even in the first case, atleast the super interface of A can be shown.
We don't have a widget to draw a general DAG. For your second example, we could indeed show the super interface, but this doesn't work in general, since a type can always have multiple super interfaces. Showing super interfaces just in some cases would be inconsistent. We don't show them all the time because that would mean we have to duplicate items in the tree, which uses too much space and makes the real hierarchy harder to see. As you found yourself, you should use the supertypes mode to see super interfaces.
(In reply to comment #1) > We don't have a widget to draw a general DAG. Cant we just invert the tree we show in supertypes mode and show it as well?
> Cant we just invert the tree we show in supertypes mode and show it as well? How would that look like? We won't create an "inverted tree widget" that expands towards the upper-left, if you mean that. Or do you want to have two trees? That's what the existing modes are for.
(In reply to comment #1) > We don't have a widget to draw a general DAG. right, we do need this. > We don't show them all the time because that would mean we have to duplicate > items in the tree, which uses too much space and makes the real hierarchy > harder to see. As you found yourself, you should use the supertypes mode to see > super interfaces. I agree with your points about duplicate items and space constraints. But I am not too sure about your point on 'real hierarchy'. Also if you invoke Type Hierarchy on a package the supertype mode is not available. 'org.eclipse.jface.text' package contains a bunch of classes and interfaces, and the type hierarchy for this package essentially shows all the interfaces in (almost) a list form as the Class hierarchy and Interface hierarchy is separate. I think this is a significant loss of information...
(In reply to comment #4) >[..] > Also if you invoke Type Hierarchy on a package the supertype mode is not > available. 'org.eclipse.jface.text' package contains a bunch of classes and > interfaces, and the type hierarchy for this package essentially shows all the > interfaces in (almost) a list form as the Class hierarchy and Interface > hierarchy is separate. I think this is a significant loss of information... To add to it, I think the the main mode should be a combination of the two modes - show subtypes, and show supertypes, and the modes should be convenient ways to filter results based on supertypes and subtypes. Can't this be achieved without a dag? -A -X -B can be used to show "class B extends A implements X"
(In reply to comment #5) > Can't this be achieved without a dag? > -A > -X > -B > can be used to show "class B extends A implements X" B has multiple immediate parents here, in a tree widget an item has a single immediate parent.