// Generated by CoffeeScript 1.12.7
var BaseMigrationNodeGroups,
  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;

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

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

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

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

  BaseMigrationNodeGroups.prototype.getActionFields = function() {
    var c, fields, i, len, ots, ref;
    ots = [];
    ref = this.children;
    for (i = 0, len = ref.length; i < len; i++) {
      c = ref[i];
      ots.push(c.getDisplayText());
    }
    fields = BaseMigrationNodeGroup.prototype.getActionFields.call(this);
    fields[0] = {
      type: CUI.Output,
      form: {
        label: $$("base.migration.node.groups.text")
      },
      text: ots.join(", ")
    };
    return fields;
  };

  BaseMigrationNodeGroups.prototype.migrate = function(ev, action_data) {
    var c, i, len, new_groups, ref;
    new_groups = [];
    ref = this.children;
    for (i = 0, len = ref.length; i < len; i++) {
      c = ref[i];
      new_groups.push.apply(new_groups, c.migrateGroups(action_data));
    }
    if (ev.hasModifierKey()) {
      console.debug("migrate Groups:", CUI.util.dump(new_groups), new_groups);
      return CUI.resolvedPromise();
    }
    return BaseMigrationNodeGroup.prototype.saveGroups.call(this, new_groups);
  };

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

  return BaseMigrationNodeGroups;

})(BaseMigrationNodeData);
