Makes the TreeItems' text update when the description of a Category changes (due to i18n).
774723
public void setupCellValueFactory() {
    navigationView.treeView.setCellFactory(param -> new TreeCell<Category>() {
      @Override
      protected void updateItem(Category category, boolean empty) {
        super.updateItem(category, empty);
        textProperty().unbind();
        if (empty || category == null) {
          setText(null);
          setGraphic(null);
        } else {
          textProperty().bind(category.descriptionProperty());
          setGraphic(category.getItemIcon());
        }
      }
    });
  }
866052
private void updateOmissionCategories(String[] cat) {
        short itens = this.omissionsCategoriesDropbox.getItemCount();
        if(itens > 0) {
            this.omissionsCategoriesDropbox.removeItems((short)0, itens);
        }
        this.omissionsCategoriesDropbox.addItem(I18nLabelsLoader.ADDON_OMISSION_CATEGORY_CUSTOM, (short)0);
        this.omissionsCategoriesDropbox.addItem(I18nLabelsLoader.ADDON_OMISSION_CATEGORY_UNKNOWN, (short)1);
        this.omissionsCategoriesDropbox.addItems(cat, (short)2);

    }
168696
private synchronized void myupdate(WSStats newStats, boolean keepOld, boolean recursiveUpdate) {
        if (newStats == null)
            return;

        StatsImpl newStats1 = (StatsImpl) newStats;
        // update the level and description of this collection
        this.instrumentationLevel = newStats1.getLevel();

        // update data
        updateMembers(newStats, keepOld);

        // update subcollections
        if (recursiveUpdate)
            updateSubcollection(newStats, keepOld, recursiveUpdate);
    }
890672
private void adjustWidgets(String implCategory) {
        // adjust to add script language options param
        Map<Integer,Widget> companions = new HashMap<>();
        for (int i = 0; i < widgets.size(); i++) {
            Widget widget = widgets.get(i);
            if ("expression".equals(widget.type) || ("edit".equals(widget.type) && !"Java".equals(widget.name))) {
                Widget companion = new Widget("SCRIPT", "dropdown");
                companion.setAttribute("label", "Language");
                companion.options = Arrays.asList(widget.getAttribute("languages").split(","));
                if (companion.options.contains("Groovy"))
                    companion.setAttribute("default", "Groovy");
                else if (companion.options.contains("Kotlin Script"))
                    companion.setAttribute("default", "Kotlin Script");
                String section = widget.getAttribute("section");
                if (section != null)
                    companion.setAttribute("section", section);
                companions.put(i, companion);
            }
        }
        int offset = 0;
        for (int idx : companions.keySet()) {
            widgets.add(idx + offset, companions.get(idx));
            offset++;
        }
    }
1267219
private void updateBundleDescriptorContent() throws CmsXmlException {

        if (m_descContent.hasLocale(Descriptor.LOCALE)) {
            m_descContent.removeLocale(Descriptor.LOCALE);
        }
        m_descContent.addLocale(m_cms, Descriptor.LOCALE);

        int i = 0;
        Property<Object> descProp;
        String desc;
        Property<Object> defaultValueProp;
        String defaultValue;
        Map<String, Item> keyItemMap = getKeyItemMap();
        List<String> keys = new ArrayList<String>(keyItemMap.keySet());
        Collections.sort(keys, CmsCaseInsensitiveStringComparator.getInstance());
        for (Object key : keys) {
            if ((null != key) && !key.toString().isEmpty()) {

                m_descContent.addValue(m_cms, Descriptor.N_MESSAGE, Descriptor.LOCALE, i);
                i++;
                String messagePrefix = Descriptor.N_MESSAGE + "[" + i + "]/";

                m_descContent.getValue(messagePrefix + Descriptor.N_KEY, Descriptor.LOCALE).setStringValue(
                    m_cms,
                    (String)key);
                descProp = keyItemMap.get(key).getItemProperty(TableProperty.DESCRIPTION);
                if ((null != descProp) && (null != descProp.getValue())) {
                    desc = descProp.getValue().toString();
                    m_descContent.getValue(messagePrefix + Descriptor.N_DESCRIPTION, Descriptor.LOCALE).setStringValue(
                        m_cms,
                        desc);
                }

                defaultValueProp = keyItemMap.get(key).getItemProperty(TableProperty.DEFAULT);
                if ((null != defaultValueProp) && (null != defaultValueProp.getValue())) {
                    defaultValue = defaultValueProp.getValue().toString();
                    m_descContent.getValue(messagePrefix + Descriptor.N_DEFAULT, Descriptor.LOCALE).setStringValue(
                        m_cms,
                        defaultValue);
                }

            }
        }

    }
402911
def update_text(self, mapping):
        """"""
        found = False
        for node in self._page.iter("*"):
            if node.text or node.tail:
                for old, new in mapping.items():
                    if node.text and old in node.text:
                        node.text = node.text.replace(old, new)
                        found = True
                    if node.tail and old in node.tail:
                        node.tail = node.tail.replace(old, new)
                        found = True
        if not found:
            raise KeyError("Updating text failed with mapping:{}".format(mapping))
1111926
function () {
            newEdit = {
                type: "textInsert",
                content: newChild.content,
                parentID: newChild.parent.tagID
            };

            // text changes will generally have afterID and beforeID, but we make
            // special note if it's the first child.
            if (textAfterID) {
                newEdit.afterID = textAfterID;
            } else {
                newEdit.firstChild = true;
            }
            newEdits.push(newEdit);

            // The text node is in the new tree, so we move to the next new tree item
            newIndex++;
        }
551614
protected void fireTreeStructureChanged(Object source, Object[] path,
        int[] childIndices, Object[] children)
    {
        for (TreeModelListener listener : treeModelListeners)
        {
            listener.treeStructureChanged(
                new TreeModelEvent(source, path, childIndices, children));
        }
    }
1008527
protected void updateLocaleNodeSorting() {

        // check if the locale nodes require sorting
        List<Locale> locales = new ArrayList<Locale>(m_locales);
        Collections.sort(locales, new Comparator<Locale>() {

            public int compare(Locale o1, Locale o2) {

                return o1.toString().compareTo(o2.toString());
            }
        });
        List<Element> localeNodes = new ArrayList<Element>(m_document.getRootElement().elements());
        boolean sortRequired = false;
        if (localeNodes.size() != locales.size()) {
            sortRequired = true;
        } else {
            int i = 0;
            for (Element el : localeNodes) {
                if (!locales.get(i).toString().equals(el.attributeValue("language"))) {
                    sortRequired = true;
                    break;
                }
                i++;
            }
        }

        if (sortRequired) {
            // do the actual node sorting, by removing the nodes first
            for (Element el : localeNodes) {
                m_document.getRootElement().remove(el);
            }

            Collections.sort(localeNodes, new Comparator<Object>() {

                public int compare(Object o1, Object o2) {

                    String locale1 = ((Element)o1).attributeValue("language");
                    String locale2 = ((Element)o2).attributeValue("language");
                    return locale1.compareTo(locale2);
                }
            });
            // re-adding the nodes in alphabetical order
            for (Element el : localeNodes) {
                m_document.getRootElement().add(el);
            }
        }
    }
920554
def on_lstCategories_itemSelectionChanged(self):
        
        self.clear_further_steps()
        # Set widgets
        purpose = self.selected_purpose()
        # Exit if no selection
        if not purpose:
            return
        # Set description label
        self.lblDescribeCategory.setText(purpose["description"])
        self.lblIconCategory.setPixmap(QPixmap(
            resources_path('img', 'wizard', 'keyword-category-%s.svg'
                           % (purpose['key'] or 'notset'))))
        # Enable the next button
        self.parent.pbnNext.setEnabled(True)
512686
private static void addTranslation(String text, int type) {
        TEXTS.put(type, text);
        LOOKUP.put(text, type);
    }
8239
def text_changed(self):
        """"""
        # Save text as bytes, if it was initially bytes
        if self.is_binary:
            self.text = to_binary_string(self.edit.toPlainText(), 'utf8')
        else:
            self.text = to_text_string(self.edit.toPlainText())
        if self.btn_save_and_close:
            self.btn_save_and_close.setEnabled(True)
            self.btn_save_and_close.setAutoDefault(True)
            self.btn_save_and_close.setDefault(True)
1111633
private void updateStatsTree() {
        if (myStatsWithChildren == null)
            return;

        ArrayList colMembers = myStatsWithChildren.subCollections();
        if (colMembers == null)
            return;

        colMembers.clear();

        // getStats from children
        ModuleItem[] items = children();
        if (items != null) {
            for (int i = 0; i < items.length; i++)
                colMembers.add(items[i].getStats(true));
        }
    }
475272
function() {
            var
              activeText   = text.active   || $module.data(metadata.storedText),
              inactiveText = text.inactive || $module.data(metadata.storedText)
            ;
            if( module.is.textEnabled() ) {
              if( module.is.active() && activeText) {
                module.verbose('Resetting active text', activeText);
                module.update.text(activeText);
              }
              else if(inactiveText) {
                module.verbose('Resetting inactive text', activeText);
                module.update.text(inactiveText);
              }
            }
          }
1191441
function onAddChild(e) {
        var self = this;
        if (e.target === self) {
            updateSubTreeStatus(self, e.component, self.get('depth'), e.index);
        }
    }
374312
def help_center_category_update(self, id, data, locale=None, **kwargs):
        ""
        api_path = "/api/v2/help_center/categories/{id}.json"
        api_path = api_path.format(id=id)
        if locale:
            api_opt_path = "/api/v2/help_center/{locale}/categories/{id}.json"
            api_path = api_opt_path.format(id=id, locale=locale)
        return self.call(api_path, method="PUT", data=data, **kwargs)
376337
function () {
          for (var key in translationIds) {
            if (translationIds.hasOwnProperty(key) && translationIds[key] !== undefined) {
              updateTranslation(key, translationIds[key], scope, scope.interpolateParams, scope.defaultText, scope.translateNamespace);
            }
          }
        }