-
Notifications
You must be signed in to change notification settings - Fork 936
[NETBEANS-3362] Show inherited members on the navigator pane #3296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,12 +42,27 @@ public interface StructureItem { | |
| long getEndPosition(); | ||
| /** Icon to use instead of the default implied by the ElementKind */ | ||
| @CheckForNull ImageIcon getCustomIcon(); | ||
|
|
||
| @Override | ||
| public abstract boolean equals(Object o); | ||
| @Override | ||
| public abstract int hashCode(); | ||
|
|
||
| /** | ||
| * Check whether the StructureItem is an inherited item. | ||
| * | ||
| * @since 2.72.0 | ||
| * @param structureItem the structure item | ||
| * @return {@code true} if it is an inherited item (a class doesn't override | ||
| * that member), otherwise {@code false} (a class declares it as an | ||
| * overriding member) | ||
| */ | ||
| public static boolean isInherited(StructureItem structureItem) { | ||
| // see also http://wiki.apidesign.org/wiki/ExtendingInterfaces | ||
| return structureItem instanceof StructureItem.InheritedItem | ||
| && ((StructureItem.InheritedItem) structureItem).isInherited(); | ||
| } | ||
|
|
||
| public interface CollapsedDefault extends StructureItem { | ||
|
|
||
| /** | ||
|
|
@@ -60,4 +75,25 @@ public interface CollapsedDefault extends StructureItem { | |
|
|
||
| } | ||
|
|
||
| public interface InheritedItem extends StructureItem { | ||
|
|
||
| /** | ||
| * Check whether this StructureItem is an inherited item. | ||
| * | ||
| * @since 2.72.0 | ||
| * @return {@code true} if it is an inherited item (a class doesn't | ||
| * override that member), otherwise {@code false} (a class declares it | ||
| * as an overriding member) | ||
| */ | ||
| boolean isInherited(); | ||
|
|
||
| /** | ||
| * Get the declaring element handle. e.g. class | ||
| * | ||
| * @since 2.72.0 | ||
| * @return the declaring element handle of the inherited item | ||
| */ | ||
| @NonNull | ||
| ElementHandle getDeclaringElement(); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally, I suppose this doesn't return |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,10 @@ public void run(Result result, SchedulerEvent event) { | |
|
|
||
| while (!todo.isEmpty()) { | ||
| StructureItem i = todo.remove(0); | ||
| if (i instanceof StructureItem.InheritedItem | ||
| && ((StructureItem.InheritedItem) i).isInherited()) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than spreading these instance checks all over the place, there could be a helper method: public static boolean isInherited(StructureItem i) {
}it could actually be in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your review! Will do that.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| continue; | ||
| } | ||
|
|
||
| todo.addAll(i.getNestedItems()); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.