public static void editTag(final JFrame parent,final CTag tag){
  final CViewCommentDialog dlg=new CViewCommentDialog(parent,"Edit Tag",tag.getName(),tag.getDescription());
  dlg.setVisible(true);
  if (!dlg.wasCancelled()) {
    try {
      tag.setName(dlg.getName());
    }
 catch (    final CouldntSaveDataException e) {
      CUtilityFunctions.logException(e);
      final String innerMessage="E00126: " + "Could not change tag name";
      final String innerDescription=CUtilityFunctions.createDescription(String.format("The name of the tag '%s' could not be changed.",tag.getName()),new String[]{"There was a problem with the database connection."},new String[]{"The tag name could not be changed."});
      NaviErrorDialog.show(parent,innerMessage,innerDescription,e);
    }
    try {
      tag.setDescription(dlg.getComment());
    }
 catch (    final CouldntSaveDataException e) {
      CUtilityFunctions.logException(e);
      final String innerMessage="E00127: " + "Could not change tag description";
      final String innerDescription=CUtilityFunctions.createDescription(String.format("The description of the tag '%s' could not be changed.",tag.getName()),new String[]{"There was a problem with the database connection."},new String[]{"The tag description could not be changed."});
      NaviErrorDialog.show(parent,innerMessage,innerDescription,e);
    }
  }
}

public static void editTag ( final JFrame parent , final CTag tag ) { final CViewCommentDialog dlg = new CViewCommentDialog ( parent , "Edit Tag" , tag . getName ( ) , tag . getDescription ( ) ) ; dlg . setVisible ( true ) ; if ( ! dlg . wasCancelled ( ) ) { try { tag . setName ( dlg . getName ( ) ) ; } catch ( final CouldntSaveDataException e ) { CUtilityFunctions . logException ( e ) ; final String innerMessage = "E00126: " + "Could not change tag name" ; final String innerDescription = CUtilityFunctions . createDescription ( String . format ( "The name of the tag '%s' could not be changed." , tag . getName ( ) ) , new String [ ] { "There was a problem with the database connection." } , new String [ ] { "The tag name could not be changed." } ) ; NaviErrorDialog . show ( parent , innerMessage , innerDescription , e ) ; } try { tag . setDescription ( dlg . getComment ( ) ) ; } catch ( final CouldntSaveDataException e ) { CUtilityFunctions . logException ( e ) ; final String innerMessage = "E00127: " + "Could not change tag description" ; final String innerDescription = CUtilityFunctions . createDescription ( String . format ( "The description of the tag '%s' could not be changed." , tag . getName ( ) ) , new String [ ] { "There was a problem with the database connection." } , new String [ ] { "The tag description could not be changed." } ) ; NaviErrorDialog . show ( parent , innerMessage , innerDescription , e ) ; } } }
used to edit the name and description of a tag .
