+{TextEditor} = require 'atom'
+
 class FormView extends HTMLElement
 
   initialize: () ->

  # {value: 123, text: "XXXX"}
  createField: (id, type, cssClass, options) ->
    td = document.createElement("td")
    field = document.createElement("input") if type != "select" || type != "progress"
    field = document.createElement("select") if type == "select"
    field = document.createElement("progress") if type == "progress"
    field.id = id

    @fields.push field

    field.setAttribute("type", if type != "directory" then type else "text")
    field.classList.add(cssClass) if cssClass?

    if type == "directory"

      field.setAttribute "value", 0
      field.setAttribute "max", 100

    if type != "text"
      td.appendChild field
    else
      td.appendChild field.getElement()
    # console.log "Created field", field, field.id
    return td

