<commit_before>/**
 * @license
 * Copyright 2017 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.u2.view',
  name: 'FObjectView',
  extends: 'foam.u2.Controller',

  documentation: 'View for editing FObjects.',

  imports: [
    'setTimeout',
    'strategizer?'
  ],

  requires: [
    'foam.core.Latch'
  ],

  properties: [
    {
      class: 'foam.core.FObjectProperty',
      of: 'foam.core.Latch',
      name: 'choicesLoaded',
      documentation: 'A latch used to wait on choices loaded.',
      factory: function() { return this.Latch.create(); }
    },
    {
      class: 'String',
      name: 'objectClass',
      label: '',
      visibility: function(allowCustom, classIsFinal, choices, data) {
        if ( ! allowCustom && choices.length <= 1  ) return foam.u2.DisplayMode.HIDDEN;
        if ( classIsFinal && this.dataWasProvided_ ) return foam.u2.DisplayMode.HIDDEN;
        return foam.u2.DisplayMode.RW;
      },
      view: function(args, X) {
        return {
          class: X.data.allowCustom ? 'foam.u2.TextField' : 'foam.u2.view.ChoiceView',
          choices$: X.data.choices$
        };
      }
    },
    {
      class: 'FObjectProperty',
      name: 'data',
      label: '',<commit_msg>Leave more space for class name in FObjectView.<commit_after>/**
 * @license
 * Copyright 2017 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.u2.view',
  name: 'FObjectView',
  extends: 'foam.u2.Controller',

  documentation: 'View for editing FObjects.',

  imports: [
    'setTimeout',
    'strategizer?'
  ],

  requires: [
    'foam.core.Latch'
  ],

  properties: [
    {
      class: 'foam.core.FObjectProperty',
      of: 'foam.core.Latch',
      name: 'choicesLoaded',
      documentation: 'A latch used to wait on choices loaded.',
      factory: function() { return this.Latch.create(); }
    },
    {
      class: 'String',
      name: 'objectClass',
      label: '',
      visibility: function(allowCustom, classIsFinal, choices, data) {
        if ( ! allowCustom && choices.length <= 1  ) return foam.u2.DisplayMode.HIDDEN;
        if ( classIsFinal && this.dataWasProvided_ ) return foam.u2.DisplayMode.HIDDEN;
        return foam.u2.DisplayMode.RW;
      },
      view: function(args, X) {
        return {
          class: X.data.allowCustom ? 'foam.u2.TextField' : 'foam.u2.view.ChoiceView',
          displayWidth: 60,
          choices$: X.data.choices$
        };
      }
    },
    {
      class: 'FObjectProperty',
      name: 'data',
      label: '',
{'fraction_non_alphanumeric': 0.14703647416413373, 'fraction_numerical': 0.011398176291793313, 'mean_word_length': 2.40620957309185, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3199417', 'n_tokens_mistral': 885, 'n_tokens_neox': 864, 'n_words': 181}