Exemple #1
0
 /**
  * Invoke the save operation.
  *
  * @throws IOException if the object could not be saved
  */
 public void save() throws java.io.IOException {
   // Do not use findCloneableOpenSupport; it will not work if the
   // DataObject has both an EditorSupport and an OpenSupport attached
   // at once.
   EditorSupport es = (EditorSupport) getDataObject().getCookie(EditorSupport.class);
   if (es == null) throw new IOException("no EditorSupport found on this data object"); // NOI18N
   else es.saveDocument();
 }
Exemple #2
0
    /**
     * Gives notification that the DataObject was changed.
     *
     * @param ev PropertyChangeEvent
     */
    public void propertyChange(PropertyChangeEvent ev) {
      if (DataObject.PROP_PRIMARY_FILE.equals(ev.getPropertyName())) {
        changeFile();
      }
      if (DataObject.PROP_NAME.equals(ev.getPropertyName())) {
        EditorSupport es = (EditorSupport) getDataObject().getCookie(EditorSupport.class);
        if (es != null) {
          es.updateTitles();
        }
      }

      super.propertyChange(ev);
    }