public CloseOperationState canCloseElement() {
   // if this is not the last cloned xml editor component, closing is OK
   if (!mDataObject.getEditorSupport().isModified()
       || !CasaDataEditorSupport.isLastView(multiViewObserver.getTopComponent())) {
     return CloseOperationState.STATE_OK;
   }
   AbstractAction save =
       new AbstractAction() {
         public void actionPerformed(ActionEvent arg0) {
           // save changes
           try {
             mDataObject.getEditorSupport().saveDocument();
             mDataObject.setModified(false);
           } catch (IOException ex) {
           }
         }
       };
   save.putValue(
       Action.LONG_DESCRIPTION,
       NbBundle.getMessage(
           DataObject.class,
           "MSG_SaveFile", // NOI18N
           mDataObject.getPrimaryFile().getNameExt()));
   return MultiViewFactory.createUnsafeCloseState(
       "ID_CASA_CLOSING", // NOI18N
       save,
       MultiViewFactory.NOOP_CLOSE_ACTION);
   // return a placeholder state - to be sure our CloseHandler is called
   /*return MultiViewFactory.createUnsafeCloseState(
   "ID_TEXT_CLOSING", // dummy ID // NOI18N
   MultiViewFactory.NOOP_CLOSE_ACTION,
   MultiViewFactory.NOOP_CLOSE_ACTION);*/
 }