// Generated by CoffeeScript 1.12.7
var BaseMigrationNodePresets,
  extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  hasProp = {}.hasOwnProperty;

BaseMigrationNodePresets = (function(superClass) {
  extend(BaseMigrationNodePresets, superClass);

  function BaseMigrationNodePresets() {
    return BaseMigrationNodePresets.__super__.constructor.apply(this, arguments);
  }

  BaseMigrationNodePresets.prototype.getDisplayText = function() {
    return $$("base.migration.node.presets.text");
  };

  BaseMigrationNodePresets.prototype.getActionPane = function() {
    var pane;
    pane = this.getActionPaneBase();
    return pane;
  };

  BaseMigrationNodePresets.prototype.checkMigrateButton = function() {
    return this.__migrateBtn.enable();
  };

  BaseMigrationNodePresets.prototype.getActionFields = function() {
    return [
      {
        type: CUI.Options,
        name: "mode",
        radio: true,
        form: {
          label: $$("base.migration.common.options")
        },
        options: [
          {
            text: $$("base.migration.common.replace"),
            value: "replace"
          }, {
            text: $$("base.migration.common.add"),
            value: "add"
          }
        ]
      }
    ];
  };

  BaseMigrationNodePresets.prototype.migrate = function(ev, actionData) {
    var child, i, len, migratePromises, ref;
    migratePromises = [];
    ref = this.children;
    for (i = 0, len = ref.length; i < len; i++) {
      child = ref[i];
      migratePromises.push(child.migrate(ev, actionData));
    }
    return CUI.when(migratePromises);
  };

  return BaseMigrationNodePresets;

})(BaseMigrationNodeData);
