Author: scabanovich
Date: 2011-07-29 16:26:56 -0400 (Fri, 29 Jul 2011)
New Revision: 33369
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java 2011-07-29
20:25:16 UTC (rev 33368)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java 2011-07-29
20:26:56 UTC (rev 33369)
@@ -19,6 +19,7 @@
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.*;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.util.PositionSearcher;
@@ -105,8 +106,7 @@
if(selection instanceof IStructuredSelection && !selection.isEmpty()
&& ((IStructuredSelection)selection).getFirstElement() instanceof
XModelObject) {
XModelObject o = (XModelObject)((IStructuredSelection)selection).getFirstElement();
- XModelObject f = o;
- while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
+ XModelObject f = FileSystemsHelper.getFile(o);
if(((JSPMultiPageEditor)multiPageEditor).getModelObject() == f) {
String text = ((FileAnyImpl)f).getAsText();
PositionSearcher searcher = new PositionSearcher();
Show replies by date