Index: Bundle.properties =================================================================== RCS file: /cvs/web/core/src/org/netbeans/modules/web/dd/Bundle.properties,v retrieving revision 1.7 diff -C3 -r1.7 Bundle.properties *** Bundle.properties 1 Mar 2004 09:35:51 -0000 1.7 --- Bundle.properties 12 Mar 2004 14:13:29 -0000 *************** *** 77,79 **** --- 77,81 ---- LBL_DDCatalog=Web Deployment Descriptors Catalog DESC_DDCatalog=XML Catalog for web deployment descriptor DTD and XML schema files. + + ERR_cannotDeleteDD=web.xml cannot be deleted. Index: DDDataObject.java =================================================================== RCS file: /cvs/web/core/src/org/netbeans/modules/web/dd/DDDataObject.java,v retrieving revision 1.39 diff -C3 -r1.39 DDDataObject.java *** DDDataObject.java 9 Mar 2004 16:14:34 -0000 1.39 --- DDDataObject.java 12 Mar 2004 14:13:30 -0000 *************** *** 43,48 **** --- 43,51 ---- import org.openide.xml.EntityCatalog; import org.netbeans.modules.web.context.WebInfObject; + import org.netbeans.modules.web.context.WebContextObject; + import org.netbeans.modules.web.context.WebContextLoader; + import org.netbeans.modules.web.context.ProjectViewManager; import org.netbeans.modules.web.dd.event.*; import org.netbeans.api.web.dd.*; import org.netbeans.modules.web.core.jsploader.ServletDataObject; *************** *** 317,322 **** --- 320,351 ---- DataObject dObj = super.handleCopy(f); try { dObj.setValid(false); }catch(java.beans.PropertyVetoException e){} return dObj; + } + + public void handleDelete() throws java.io.IOException { + WebContextObject wco; + WebInfObject wio; + try { + super.handleDelete(); + wco = WebContextLoader.findContext(getPrimaryFile().getFileSystem()); + if(wco != null) { + wio = wco.getInfObject(); + wco.setValid(false); + wio.setValid(false); + wco.destroyContext(); + ProjectViewManager.getDefault ().notifyWebContext (getPrimaryFile().getFileSystem(), null); + } + } + catch (FileStateInvalidException e) { + java.io.IOException ioe = new java.io.IOException (NbBundle.getMessage (DDDataObject.class, "ERR_cannotDeleteDD")); + ErrorManager.getDefault().annotate (new java.io.IOException (), e); + throw ioe; + } + catch (PropertyVetoException e) { + java.io.IOException ioe = new java.io.IOException (NbBundle.getMessage (DDDataObject.class, "ERR_cannotDeleteDD")); + ErrorManager.getDefault().annotate (new java.io.IOException (), e); + throw ioe; + } } protected void dispose () {