Author: scabanovich
Date: 2007-07-11 02:43:31 -0400 (Wed, 11 Jul 2007)
New Revision: 2378
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java
Log:
EXIN-562
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java 2007-07-10
17:41:53 UTC (rev 2377)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java 2007-07-11
06:43:31 UTC (rev 2378)
@@ -79,6 +79,7 @@
public Element getLayoutElement(IResource resource, String elementTag) {
Element element = null;
Document document = getLayoutDocument(resource);
+ if(document == null) return null;
NodeList nodeList = document.getElementsByTagName(elementTag);
if (nodeList==null || nodeList.getLength()==0 || nodeList.item(0)==null) {
// create new element
@@ -162,6 +163,7 @@
layoutLocation = resource.getPersistentProperty(new
QualifiedName("",LAYOUT_PROPERTY));
} catch (CoreException e) {}
if (layoutLocation==null) layoutLocation = createNewLayoutLocation(resource);
+ if(!new File(layoutLocation).isFile()) return null;
//String fullLayoutLocation =
getFullLocation(resource).addFileExtension(LAYOUT_EXT).toString();
Document document = null;
DocumentBuilder builder = null;