Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2017-05-13 06:00:18 +0000
committerAnsgar Radermacher2017-05-15 08:42:10 +0000
commit34603aa37b6f5552d1381c35e59bce89d29bb92f (patch)
tree2d803550b8e132a0e30d9db599e0d50052e585c4 /plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui
parent94a6263dde28452b0118c92fa9f9043341225519 (diff)
downloadorg.eclipse.papyrus-34603aa37b6f5552d1381c35e59bce89d29bb92f.tar.gz
org.eclipse.papyrus-34603aa37b6f5552d1381c35e59bce89d29bb92f.tar.xz
org.eclipse.papyrus-34603aa37b6f5552d1381c35e59bce89d29bb92f.zip
Bug 444218 - [Project Explorer] Models within C++ projects are not shown, if the DI filter is active
- Also try to adapt input element to IContainer instead of doing only an "instanceof" check
Diffstat (limited to 'plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui')
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/ui/providers/PapyrusContentProvider.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/ui/providers/PapyrusContentProvider.java b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/ui/providers/PapyrusContentProvider.java
index 4f06cac9c5b..c301c0dbd4f 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/ui/providers/PapyrusContentProvider.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/ui/providers/PapyrusContentProvider.java
@@ -26,6 +26,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.papyrus.infra.onefile.internal.ui.Activator;
@@ -86,11 +87,17 @@ public class PapyrusContentProvider extends WorkbenchContentProvider {
}
} else {
IResource[] members = null;
+ IContainer container = null;
if (inputElement instanceof IContainer) {
- IContainer container = (IContainer) inputElement;
- if (container.isAccessible()) {
- members = container.members();
- }
+ container = (IContainer) inputElement;
+ }
+ else if (inputElement instanceof IAdaptable) {
+ // containers in CDT projects (and maybe others) are not instances of IContainer
+ // but can adapt to it.
+ container = ((IAdaptable) inputElement).getAdapter(IContainer.class);
+ }
+ if (container != null && container.isAccessible()) {
+ members = container.members();
}
if (members != null) {
for (IResource r : members) {

Back to the top