Bug 506369: [1.9] Support IJavaElements for modules in UI
Change-Id: Iaa560343901e4c36f819becd1508bcfec2b19b51
diff --git a/org.eclipse.jdt.ui/icons/full/obj16/module_obj@2x.png b/org.eclipse.jdt.ui/icons/full/obj16/module_obj@2x.png
new file mode 100644
index 0000000..8cd875d
--- /dev/null
+++ b/org.eclipse.jdt.ui/icons/full/obj16/module_obj@2x.png
Binary files differ
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
index 5bedf68..86d95ae 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -100,7 +100,6 @@
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IModuleDescription;
import org.eclipse.jdt.core.IParent;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.ISourceReference;
@@ -297,7 +296,7 @@
@Override
public Object[] getChildren(Object parent) {
- if (parent instanceof IParent && !(parent instanceof IModuleDescription)) {
+ if (parent instanceof IParent) {
IParent c= (IParent) parent;
try {
return filter(c.getChildren());
@@ -339,7 +338,7 @@
@Override
public boolean hasChildren(Object parent) {
- if (parent instanceof IParent && !(parent instanceof IModuleDescription)) {
+ if (parent instanceof IParent) {
IParent c= (IParent) parent;
try {
IJavaElement[] children= filter(c.getChildren());
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/StandardJavaElementContentProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/StandardJavaElementContentProvider.java
index 746e670..6b8ef86 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/StandardJavaElementContentProvider.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/StandardJavaElementContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,6 @@
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IModuleDescription;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IParent;
@@ -189,8 +188,7 @@
return ((IJarEntryResource) element).getChildren();
}
- if (getProvideMembers() && element instanceof ISourceReference && element instanceof IParent
- && !(element instanceof IModuleDescription)) {
+ if (getProvideMembers() && element instanceof ISourceReference && element instanceof IParent) {
return ((IParent)element).getChildren();
}
} catch (CoreException e) {
@@ -222,7 +220,7 @@
}
}
- if (element instanceof IParent && !(element instanceof IModuleDescription)) {
+ if (element instanceof IParent) {
try {
// when we have Java children return true, else we fetch all the children
if (((IParent)element).hasChildren())