public boolean save() {
   for (Object component : genericTagPropertiesEditPanel.getComponents()) {
     if (component instanceof GenericTagEditor) {
       try {
         ((GenericTagEditor) component).validateValue();
         ((GenericTagEditor) component).save();
       } catch (IllegalArgumentException iex) {
         return false;
       }
     }
   }
   SWF swf = tag.getSwf();
   assignTag(tag, editedTag);
   tag.setModified(true);
   tag.setSwf(swf);
   setTagText(tag);
   return true;
 }
  public void setEditMode(boolean edit, Tag tag) {
    if (tag == null) {
      tag = this.tag;
    }

    this.tag = tag;
    this.editedTag = Helper.deepCopy(tag);
    generateEditControls(editedTag, !edit);

    if (edit) {
      remove(genericTagPropertiesEditorPaneScrollPanel);
      add(genericTagPropertiesEditPanelScrollPanel, BorderLayout.CENTER);
    } else {
      genericTagPropertiesEditPanel.removeAll();
      genericTagPropertiesEditPanel.setSize(0, 0);
      remove(genericTagPropertiesEditPanelScrollPanel);
      add(genericTagPropertiesEditorPaneScrollPanel, BorderLayout.CENTER);
      setTagText(this.tag);
    }
    revalidate();
    repaint();
  }