Author: scabanovich
Date: 2012-01-24 15:53:12 -0500 (Tue, 24 Jan 2012)
New Revision: 38117
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java
Log:
JBIDE-10698
https://issues.joss.org/browse/JBIDE-10698
Method XContentProvider.hasChildren() is improved for the case of IFile element.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2012-01-24 20:19:48 UTC (rev
38116)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2012-01-24 20:53:12 UTC (rev
38117)
@@ -414,6 +414,8 @@
<or>
<instanceof
value="org.eclipse.core.resources.IFile" />
+ <instanceof
+ value="org.eclipse.core.resources.IProject" /> <!-- for
activation -->
</or>
</triggerPoints>
<possibleChildren>
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java 2012-01-24
20:19:48 UTC (rev 38116)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java 2012-01-24
20:53:12 UTC (rev 38117)
@@ -13,9 +13,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
@@ -24,13 +22,11 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.navigator.TreeViewerModelListenerImpl;
import org.jboss.tools.common.model.ui.preferences.DecoratorPreferencesListener;
import org.jboss.tools.common.model.ui.views.navigator.FilteredTreesCache;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelTreeListenerSWTASync;
-import org.jboss.tools.jst.web.ui.WebUiPlugin;
public class XContentProvider implements ITreeContentProvider {
protected Viewer viewer = null;
@@ -39,6 +35,9 @@
DecoratorPreferencesListener decoratorListener = null;
+ public XContentProvider() {
+ }
+
protected TreeViewerModelListenerImpl createListener() {
return new TreeViewerModelListenerImpl();
}
@@ -92,6 +91,13 @@
}
public boolean hasChildren(Object element) {
+ if(element instanceof IFile) {
+ IFile f = (IFile)element;
+ element = EclipseResourceUtil.createObjectForResource(f);
+ if(element == null) {
+ return false;
+ }
+ }
if(element instanceof XModelObject) {
XModelObject o = (XModelObject)element;
XFilteredTree filteredTree = getFilteredTree(o);