rem: commandTable.registerCommand("cmd_saveAsCharset",  nsSaveAsCharsetCommand); 
add: commandTable.registerCommand("cmd_saveAndChangeEncoding",  nsSaveAndChangeEncodingCommand); 
context: function SetupComposerWindowCommands(){  // Don't need to do this if already done  if (gComposerWindowControllerID)    return;  // Create a command controller and register commands  //   specific to Web Composer window (file-related commands, HTML Source...)  //   We can't use the composer controller created on the content window else  //     we can't process commands when in HTMLSource editor  // IMPORTANT: For each of these commands, the doCommand method   //            must first call FinishHTMLSource()   //            to go from HTML Source mode to any other edit mode  var windowControllers = window.controllers;  if (!windowControllers) return;  var commandTable;  var composerController;  var editorController;  try {    composerController = Components.classes["@mozilla.org/embedcomp/base-command-controller;1"].createInstance();    editorController = composerController.QueryInterface(Components.interfaces.nsIControllerContext);    editorController.init(null); // init it without passing in a command table    // Get the nsIControllerCommandTable interface we need to register commands    var interfaceRequestor = composerController.QueryInterface(Components.interfaces.nsIInterfaceRequestor);    commandTable = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandTable);  }  catch (e)  {    dump("Failed to create composerController\n");    return;  }  if (!commandTable)  {    dump("Failed to get interface for nsIControllerCommandManager\n");    return;  }  // File-related commands  commandTable.registerCommand("cmd_open",           nsOpenCommand);  commandTable.registerCommand("cmd_save",           nsSaveCommand);  commandTable.registerCommand("cmd_saveAs",         nsSaveAsCommand);  commandTable.registerCommand("cmd_exportToText",   nsExportToTextCommand);  commandTable.registerCommand("cmd_saveAsCharset",  nsSaveAsCharsetCommand);  commandTable.registerCommand("cmd_publish",        nsPublishCommand);  commandTable.registerCommand("cmd_publishAs",      nsPublishAsCommand);  commandTable.registerCommand("cmd_publishSettings",nsPublishSettingsCommand);  commandTable.registerCommand("cmd_revert",         nsRevertCommand);  commandTable.registerCommand("cmd_openRemote",     nsOpenRemoteCommand);  commandTable.registerCommand("cmd_preview",        nsPreviewCommand);  commandTable.registerCommand("cmd_editSendPage",   nsSendPageCommand);  commandTable.registerCommand("cmd_print",          nsPrintCommand);  commandTable.registerCommand("cmd_printSetup",     nsPrintSetupCommand);  commandTable.registerCommand("cmd_quit",           nsQuitCommand);  commandTable.registerCommand("cmd_close",          nsCloseCommand);  commandTable.registerCommand("cmd_preferences",    nsPreferencesCommand);  // Edit Mode commands  if (GetCurrentEditorType() == "html")  {    commandTable.registerCommand("cmd_NormalMode",         nsNormalModeCommand);    commandTable.registerCommand("cmd_AllTagsMode",        nsAllTagsModeCommand);    commandTable.registerCommand("cmd_HTMLSourceMode",     nsHTMLSourceModeCommand);    commandTable.registerCommand("cmd_PreviewMode",        nsPreviewModeCommand);    commandTable.registerCommand("cmd_FinishHTMLSource",   nsFinishHTMLSource);    commandTable.registerCommand("cmd_CancelHTMLSource",   nsCancelHTMLSource);    commandTable.registerCommand("cmd_updateStructToolbar", nsUpdateStructToolbarCommand);  }  windowControllers.insertControllerAt(0, editorController);  // Store the controller ID so we can be sure to get the right one later  gComposerWindowControllerID = windowControllers.getControllerId(editorController);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/b56593d0ef79a8ae60dde72a46f3796bac3193d4/ComposerCommands.js/clean/editor/ui/composer/content/ComposerCommands.js