editable text area
338245
def textarea config={}, &block
      require 'canis/rtextarea'
      # TODO confirm events many more
      events = [ :CHANGE,  :LEAVE, :ENTER ]
      block_event = events[0]
      #_process_args args, config, block_event, events
      #config[:width] = config[:display_length] unless config.has_key? :width
      # if no width given, expand to flows width
      #config[:width] ||= @stack.last.width if @stack.last
      useform = nil
      #useform = @form if @current_object.empty?
      w = TextArea.new useform, config
      w.width = :expand unless w.width
      w.height ||= 8 # TODO
      _position(w)
      # need to expand to stack's width or flows itemwidth if given
      if block
        w.bind(block_event, &block)
      end
      return w
    end
74385
function initAceEditor(themeId, folderName, fileName, text, mode) {
        hideImageHolder();
        $("#" + editorId).show();
        var doc = new Document(text);
        var session = new EditSession(doc, "ace/mode/" + mode);
        session.setUndoManager(new UndoManager());
        editor.setSession(session);

        //bind change event for text changes in opened file and save them.
        doc.on('change', function (e) {
            // e.type, etc
            console.log(e);
            saveFileChanges(themeId, folderName, fileName, doc.getValue());
        });
    }
761604
def configure_widget_for_editing(self, widget):
        
        
        if not 'editor_varname' in widget.attributes:
            return
        widget.onclick.do(self.on_widget_selection)
        
        #setup of the on_dropped function of the widget in order to manage the dragNdrop 
        widget.__class__.on_dropped = on_dropped

        #drag properties
        #widget.style['resize'] = 'both'
        widget.style['overflow'] = 'auto'
        widget.attributes['draggable'] = 'true'
                
        widget.attributes['tabindex']=str(self.tabindex)
        #if not 'position' in widget.style.keys():
        #    widget.style['position'] = 'absolute'
        #if not 'left' in widget.style.keys():
        #    widget.style['left'] = '1px'
        #if not 'top' in widget.style.keys():
        #    widget.style['top'] = '1px'
        self.tabindex += 1
822743
def edit(self, text):
        
        url = self.reddit_session.config['edit']
        data = {'thing_id': self.fullname,
                'text': text}
        response = self.reddit_session.request_json(url, data=data)
        self.reddit_session.evict(self.reddit_session.config['user'])
        return response['data']['things'][0]
726063
function highlightText(){
                var text = $scope.areaData,
                    html = htmlEncode(text);

                if(typeof($scope.areaConfig.autocomplete) === 'undefined' || $scope.areaConfig.autocomplete.length === 0){
                    return;
                }

                $scope.areaConfig.autocomplete.forEach(function(autoList){
                    for(var i=0; i<autoList.words.length; i++){
                        if(typeof(autoList.words[i]) === "string"){
                            html = html.replace(new RegExp("([^\\w]|\\b)("+autoList.words[i]+")([^\\w]|\\b)", 'g'), '$1<span class="'+autoList.cssClass+'">$2</span>$3');
                        }else{
                            html = html.replace(autoList.words[i], function(match){
                                return '<span class="'+autoList.cssClass+'">'+match+'</span>';
                            });
                        }
                    }
                });
                // Add to the fakeArea
                $scope.fakeArea = $sce.trustAsHtml(html);
            }
1076749
function editors () {
  editors.textBox = form.textBox = ace.edit("text-box");
  form.textBox.setTheme(ACE_THEME);
  var session = form.textBox.getSession();
  session.setMode("ace/mode/yaml");
  session.setTabSize(2);

  editors.results = $("#results");
  editors.tabs = editors.results.find(".nav-tabs");
  editors.panes = editors.results.find(".tab-content");
}
823886
def _makeTextWidgets(self):
        
        self.prompt = urwid.Edit(self.promptText, multiline=False)
        return [self.prompt]
1004399
def editCell(self, vcolidx=None, rowidx=None, **kwargs):
        ''

        if vcolidx is None:
            vcolidx = self.cursorVisibleColIndex
        x, w = self.visibleColLayout.get(vcolidx, (0, 0))

        col = self.visibleCols[vcolidx]
        if rowidx is None:
            rowidx = self.cursorRowIndex
        if rowidx < 0:  # header
            y = 0
            currentValue = col.name
        else:
            y = self.rowLayout.get(rowidx, 0)
            currentValue = col.getDisplayValue(self.rows[self.cursorRowIndex])

        editargs = dict(value=currentValue,
                        fillchar=options.disp_edit_fill,
                        truncchar=options.disp_truncator)
        editargs.update(kwargs)  # update with user-specified args
        r = self.vd.editText(y, x, w, **editargs)
        if rowidx >= 0:  # if not header
            r = col.type(r)  # convert input to column type, let exceptions be raised

        return r
504357
function () {
            var t = this,
                prefix = t.o.prefix;

            if (t.isTextarea) {
                t.$box.after(
                    t.$ta
                        .css({height: ''})
                        .val(t.html())
                        .removeClass(prefix + 'textarea')
                        .show()
                );
            } else {
                t.$box.after(
                    t.$ed
                        .css({height: ''})
                        .removeClass(prefix + 'editor')
                        .removeAttr('contenteditable')
                        .removeAttr('dir')
                        .html(t.html())
                        .show()
                );
            }

            t.$ed.off('dblclick', 'img');

            t.destroyPlugins();

            t.$box.remove();
            t.$c.removeData('trumbowyg');
            $('body').removeClass(prefix + 'body-fullscreen');
            t.$c.trigger('tbwclose');
            $(window).off('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace);
        }
993541
function() {
      var t = this,
          isEditMode = t.$el.hasClass('edit-mode'),
          text = isEditMode ? 'Lock Components' : 'Edit Components',
          icon = isEditMode ? 'lock' : 'edit';
      t.$('.nm-pvm-lock').text(text);
      t.$('.nm-pvm-edit i').attr('class', 'icon-' + icon);
    }
122125
private void adaptText() {
        if (editText != null) {
            editText.setText(text);

            if (text != null) {
                editText.setSelection(text.length());
            }
        }
    }
400914
def setEditorData(self, editor, index):
        """"""
        text = from_qvariant(index.model().data(index, Qt.DisplayRole), str)
        editor.setText(text)
588132
function(keypath, attributes) {
      var current;
      attributes = $.extend(this._attributesForKeyPath(keypath), attributes);
      current = attributes.value;
      delete attributes['value'];
      return simple_element('textarea', attributes, current);
    }
856468
def _set_textarea(el, value):
        
        if isinstance(value, dict):
            el.text = value["val"]
        elif type(value) in [list, tuple]:
            el.text = "\n\n".join(
                "-- %s --\n%s" % (item["source"], item["val"])
                for item in value
            )
        else:
            el.text = value
761708
function() {
    this.textarea.style.width = this.getTdEl().offsetWidth + "px";
    this.textarea.style.height = "3em";
    YAHOO.widget.TextareaCellEditor.superclass.move.call(this);
}
1129576
function (text, color, x, y, width) {
                        ctx.fillStyle = color;
                        var metric = ctx.measureText(text);
                        if (metric.width > width) {
                            while (text !== "") {
                                metric = ctx.measureText(text + "...");
                                if (metric.width <= width) {
                                    text += "...";
                                    break;
                                }
                                text = text.substr(0, text.length - 1);
                            }
                        }
                        ctx.fillText(text, x, y, width);
                    }
1025353
public static JTextComponent textComponentAsLabel(JTextComponent textcomponent) {
        //  Make the text component non editable
        textcomponent.setEditable(false);
        // Make the text area look like a label
        textcomponent.setBackground((Color)UIManager.get("Label.background"));
        textcomponent.setForeground((Color)UIManager.get("Label.foreground"));
        textcomponent.setBorder(null);
        return textcomponent;
    }