Author: scabanovich
Date: 2011-07-29 16:52:11 -0400 (Fri, 29 Jul 2011)
New Revision: 33372
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java 2011-07-29
20:39:09 UTC (rev 33371)
+++
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java 2011-07-29
20:52:11 UTC (rev 33372)
@@ -12,6 +12,7 @@
import java.util.*;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.meta.action.impl.*;
import org.jboss.tools.jst.web.model.ReferenceObject;
@@ -29,12 +30,8 @@
public boolean isEnabled(XModelObject object) {
if(object == null || !object.isActive()) return false;
- XModelObject f = object.getParent();
- while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
- if(f == null ||
!f.getModelEntity().getName().startsWith(SeamPagesConstants.ENT_FILE_SEAM_PAGES)) {
- return false;
- }
- return true;
+ XModelObject f = FileSystemsHelper.getFile(object);
+ return (f != null &&
f.getModelEntity().getName().startsWith(SeamPagesConstants.ENT_FILE_SEAM_PAGES));
}
public void executeHandler(XModelObject object, Properties p) throws XModelException {
Show replies by date