Applies a list of {@link RichTextChange} to the given area when the {@link UndoManager}'s change stream emits
an event by {@code area.replaceAbsolutely(change.getPosition(), change.getRemovalEnd(), change.getInserted()}.
775979
public static <PS, SEG, S> Consumer<List<RichTextChange<PS, SEG, S>>> applyMultiRichTextChange(
            GenericStyledArea<PS, SEG, S> area) {
        return changeList -> {
            MultiChangeBuilder<PS, SEG, S> builder = area.createMultiChange(changeList.size());
            for (RichTextChange<PS, SEG, S> c : changeList) {
                builder.replaceAbsolutely(c.getPosition(), c.getRemovalEnd(), c.getInserted());
            }
            builder.commit();
        };
    }
448595
private void fireTangoChangeEvent(TangoChange tangoChange, EventData eventData) {
        TangoChangeEvent change_event = new TangoChangeEvent(tangoChange, eventData);
        ArrayList<EventListener>    listeners = event_listeners.getListeners(ITangoChangeListener.class);
        for (EventListener eventListener : listeners) {
            ((ITangoChangeListener) eventListener).change(change_event);
        }
    }
885421
@Override
	public void onMapViewChanged(MapViewChangedEvent event) {
		if (null != activeViewConfig && !event.isSameScaleLevel()) {
			renderViewConfig(activeViewConfig.getViewConfig());
		}
	}
1187116
protected void fireAttributeChangedEvent(String name, AttributeValue oldValue, AttributeValue currentValue) {
		if (this.listeners != null && isEventFirable()) {
			final AttributeChangeEvent event = new AttributeChangeEvent(
					//source
					this,
					//type
					Type.VALUE_UPDATE,
					//old name
					name,
					//old value
					oldValue,
					//current name
					name,
					//current value
					currentValue);
			for (final AttributeChangeListener listener : this.listeners) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}
185925
public void fireChangeEvent() {

        String result = "";
        if (m_textarea.getFormValueAsString() != null) {
            result = m_textarea.getFormValueAsString();
        }

        ValueChangeEvent.fire(this, result);
    }
449631
private boolean applyChange(boolean isChangeAvailable, Supplier<C> changeToApply) {
        if (isChangeAvailable) {
            canMerge = false;

            // perform change
            C change = changeToApply.get();
            this.expectedChange = change;
            performingAction.suspendWhile(() -> apply.accept(change));
            if(this.expectedChange != null) {
                throw new IllegalStateException("Expected change not received:\n"
                        + this.expectedChange);
            }

            invalidateProperties();
            return true;
        } else {
            return false;
        }
    }
1208243
protected final void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
		if (DIRTY_PROPERTY.equals(propertyName)) {
			PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, Boolean.valueOf(oldValue), Boolean
					.valueOf(newValue));
			for (Iterator i = dirtyChangeListeners.iterator(); i.hasNext();) {
				((PropertyChangeListener) i.next()).propertyChange(evt);
			}
		}
	}
555027
protected void applyChange(CmsSitemapChange change) {

        // update the clip board data
        if (change.getClipBoardData() != null) {
            getData().getClipboardData().setDeletions(change.getClipBoardData().getDeletions());
            getData().getClipboardData().setModifications(change.getClipBoardData().getModifications());
        }
        switch (change.getChangeType()) {
            case bumpDetailPage:
                CmsDetailPageTable detailPageTable = getData().getDetailPageTable();
                if (detailPageTable.contains(change.getEntryId())) {
                    detailPageTable.bump(change.getEntryId());
                }
                break;
            case clipboardOnly:
                // nothing to do
                break;
            case remove:
                CmsClientSitemapEntry entry = getEntryById(change.getEntryId());
                entry.setInNavigation(false);
                CmsPropertyModification propMod = new CmsPropertyModification(
                    entry.getId(),
                    CmsClientProperty.PROPERTY_NAVTEXT,
                    null,
                    true);
                executePropertyModification(propMod);
                propMod = new CmsPropertyModification(entry.getId(), CmsClientProperty.PROPERTY_NAVTEXT, null, true);
                executePropertyModification(propMod);
                entry.normalizeProperties();
                break;
            case undelete:
                updateEntry(change.getParentId());
                break;
            case create:
                CmsClientSitemapEntry newEntry = change.getUpdatedEntry();
                getEntryById(change.getParentId()).insertSubEntry(newEntry, change.getPosition(), this);
                newEntry.initializeAll(this);
                if (isDetailPage(newEntry)) {
                    CmsDetailPageInfo info = getDetailPageInfo(newEntry.getId());
                    if (info == null) {
                        info = new CmsDetailPageInfo(
                            newEntry.getId(),
                            newEntry.getSitePath(),
                            newEntry.getDetailpageTypeName(),
                            newEntry.getVfsModeIcon());
                    }
                    addDetailPageInfo(info);
                }
                break;
            case delete:
                removeEntry(change.getEntryId(), change.getParentId());
                break;
            case modify:
                if (change.hasNewParent() || change.hasChangedPosition()) {
                    CmsClientSitemapEntry moved = getEntryById(change.getEntryId());
                    String oldSitepath = moved.getSitePath();
                    CmsClientSitemapEntry sourceParent = getEntry(CmsResource.getParentFolder(oldSitepath));
                    sourceParent.removeSubEntry(moved.getId());
                    CmsClientSitemapEntry destParent = change.hasNewParent()
                    ? getEntryById(change.getParentId())
                    : sourceParent;
                    if (change.getPosition() < destParent.getSubEntries().size()) {
                        destParent.insertSubEntry(moved, change.getPosition(), this);
                    } else {
                        // inserting as last entry of the parent list
                        destParent.addSubEntry(moved, this);
                    }
                    if (change.hasNewParent()) {
                        cleanupOldPaths(oldSitepath, destParent.getSitePath());
                    }
                }
                if (change.hasChangedName()) {
                    CmsClientSitemapEntry changed = getEntryById(change.getEntryId());
                    String oldSitepath = changed.getSitePath();
                    String parentPath = CmsResource.getParentFolder(oldSitepath);
                    String newSitepath = CmsStringUtil.joinPaths(parentPath, change.getName());
                    changed.updateSitePath(newSitepath, this);
                    cleanupOldPaths(oldSitepath, newSitepath);
                }
                if (change.hasChangedProperties()) {
                    for (CmsPropertyModification modification : change.getPropertyChanges()) {
                        executePropertyModification(modification);
                    }
                    getEntryById(change.getEntryId()).normalizeProperties();
                }
                if (change.getUpdatedEntry() != null) {
                    CmsClientSitemapEntry oldEntry = getEntryById(change.getEntryId());
                    CmsClientSitemapEntry parent = getEntry(CmsResource.getParentFolder(oldEntry.getSitePath()));
                    removeEntry(change.getEntryId(), parent.getId());
                    parent.insertSubEntry(change.getUpdatedEntry(), oldEntry.getPosition(), this);
                    change.getUpdatedEntry().initializeAll(this);
                }
                break;
            default:
        }
        if (change.getChangeType() != ChangeType.delete) {
            recomputeProperties();
        }
        m_eventBus.fireEventFromSource(new CmsSitemapChangeEvent(change), this);
    }
567085
protected String applyTextReplacements(Iterable<ITextReplacement> replacements) {
		ITextSegment region = getRegion();
		String input = region.getText();
		ArrayList<ITextReplacement> list = Lists.newArrayList(replacements);
		Collections.sort(list);
		int startOffset = region.getOffset();
		int lastOffset = 0;
		StringBuilder result = new StringBuilder();
		for (ITextReplacement r : list) {
			int offset = r.getOffset() - startOffset;
			result.append(input.subSequence(lastOffset, offset));
			result.append(r.getReplacementText());
			lastOffset = offset + r.getLength();
		}
		result.append(input.subSequence(lastOffset, input.length()));
		return result.toString();
	}
667710
public static void fireSREChanged(PropertyChangeEvent event) {
		for (final Object listener : SRE_LISTENERS.getListeners()) {
			((ISREInstallChangedListener) listener).sreChanged(event);
		}
	}
250318
private ChangeEvent<BsonDocument> getSynthesizedRemoteChangeEventForDocument(
      final MongoNamespace ns,
      final BsonValue documentId,
      final BsonDocument document
  ) {
    // a. When the document is looked up, if it cannot be found the synthesized change event is a
    // DELETE, otherwise it's a REPLACE.
    if (document == null) {
      return ChangeEvents.changeEventForLocalDelete(ns, documentId, false);
    }
    return ChangeEvents.changeEventForLocalReplace(ns, documentId, document, false);
  }
495316
public void setAreasVisible(final boolean VISIBLE) {
        if (null == areasVisible) {
            _areasVisible = VISIBLE;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            areasVisible.set(VISIBLE);
        }
    }
114611
private void adaptAreaPadding() {
        if (areas != null) {
            boolean paddingTopApplied = false;
            Area previousArea = null;
            View previousView = null;
            int scrollViewPaddingTop = 0;
            int scrollViewMarginBottom = 0;
            Iterator<Map.Entry<Area, View>> iterator = areas.entrySet().iterator();

            while (iterator.hasNext()) {
                Map.Entry<Area, View> entry = iterator.next();
                Area area = entry.getKey();
                View view = entry.getValue();

                applyDialogPaddingLeft(area, view);
                applyDialogPaddingRight(area, view);

                if (!paddingTopApplied) {
                    paddingTopApplied = applyDialogPaddingTop(area, view);
                }

                if (!iterator.hasNext()) {
                    applyDialogPaddingBottom(area, view);
                }

                if (previousArea != null) {
                    if (area == Area.BUTTON_BAR) {
                        applyDialogPaddingBottom(previousArea, previousView);
                    }

                    Pair<Integer, Integer> pair = addViewSpacing(previousArea, previousView, area);
                    scrollViewPaddingTop += pair.first != null ? pair.first : 0;
                    scrollViewMarginBottom += pair.second != null ? pair.second : 0;
                }

                previousArea = area;
                previousView = view;
            }

            if (scrollView != null) {
                LinearLayout.LayoutParams layoutParams =
                        (LayoutParams) scrollView.getLayoutParams();
                layoutParams.bottomMargin = scrollViewMarginBottom;
                scrollView.setPadding(scrollView.getPaddingLeft(),
                        scrollView.getPaddingTop() + scrollViewPaddingTop,
                        scrollView.getPaddingRight(), scrollView.getPaddingBottom());
            }
        }
    }
13636
function moveToNextCallback(alreadyNew, valueChanged, section)
        {
            if (!moveDirection)
                return;

            // User just tabbed through without changes.
            if (moveTo && moveTo.parent) {
                moveTo.startEditing(!isEditingName ? moveTo.nameElement : moveTo.valueElement);
                return;
            }

            // User has made a change then tabbed, wiping all the original treeElements.
            // Recalculate the new treeElement for the same property we were going to edit next.
            if (moveTo && !moveTo.parent) {
                var propertyElements = section.propertiesTreeOutline.children;
                if (moveDirection === "forward" && blankInput && !isEditingName)
                    --moveToIndex;
                if (moveToIndex >= propertyElements.length && !this._newProperty)
                    createNewProperty = true;
                else {
                    var treeElement = moveToIndex >= 0 ? propertyElements[moveToIndex] : null;
                    if (treeElement) {
                        var elementToEdit = !isEditingName || isPropertySplitPaste ? treeElement.nameElement : treeElement.valueElement;
                        if (alreadyNew && blankInput)
                            elementToEdit = moveDirection === "forward" ? treeElement.nameElement : treeElement.valueElement;
                        treeElement.startEditing(elementToEdit);
                        return;
                    } else if (!alreadyNew)
                        moveToSelector = true;
                }
            }

            // Create a new attribute in this section (or move to next editable selector if possible).
            if (createNewProperty) {
                if (alreadyNew && !valueChanged && (isEditingName ^ (moveDirection === "backward")))
                    return;

                section.addNewBlankProperty().startEditing();
                return;
            }

            if (abandonNewProperty) {
                moveTo = this._findSibling(moveDirection);
                var sectionToEdit = (moveTo || moveDirection === "backward") ? section : section.nextEditableSibling();
                if (sectionToEdit) {
                    if (sectionToEdit.rule())
                        sectionToEdit.startEditingSelector();
                    else
                        sectionToEdit._moveEditorFromSelector(moveDirection);
                }
                return;
            }

            if (moveToSelector) {
                if (section.rule())
                    section.startEditingSelector();
                else
                    section._moveEditorFromSelector(moveDirection);
            }
        }
398302
public static void setDirectTextContent(final Node elementToChange, final String asString) {
        assert elementToChange.getNodeType() != Node.DOCUMENT_NODE;
        if (Node.ATTRIBUTE_NODE == elementToChange.getNodeType()) {
            elementToChange.setTextContent(asString);
            return;
        }
        List<Node> nodes = new LinkedList<Node>();
        List<Node> nodes2 = new LinkedList<Node>();
        for (Node n : nodeListToIterator(elementToChange.getChildNodes())) {
            if (Node.TEXT_NODE == n.getNodeType()) {
                continue;
            }
            nodes.add(n);
        }
        if ((asString != null) && (!asString.isEmpty())) {
            elementToChange.setTextContent(asString);
            for (Node n : nodeListToIterator(elementToChange.getChildNodes())) {
                if (Node.TEXT_NODE != n.getNodeType()) {
                    continue;
                }
                nodes.add(n);
            }
        }
        removeAllChildren(elementToChange);
        for (Node n : nodes) {
            elementToChange.appendChild(n);
        }
        for (Node n : nodes2) {
            elementToChange.appendChild(n);
        }

    }
263009
protected synchronized void fireAttributeRemovedEvent(String name, AttributeValue oldValue) {
		if (this.listenerList != null && isEventFirable()) {
			final AttributeChangeListener[] list = new AttributeChangeListener[this.listenerList.size()];
			this.listenerList.toArray(list);
			final AttributeChangeEvent event = new AttributeChangeEvent(
					this,
					Type.REMOVAL,
					name,
					oldValue,
					name,
					oldValue);
			for (final AttributeChangeListener listener : list) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}
1099633
protected void fireAttributeRemovedEvent(String name, AttributeValue oldValue) {
		if (this.listeners != null && isEventFirable()) {
			final AttributeChangeEvent event = new AttributeChangeEvent(
					//source
					this,
					//type
					Type.REMOVAL,
					//old name
					name,
					//old value
					oldValue,
					//current name
					name,
					//current value
					oldValue);
			for (final AttributeChangeListener listener : this.listeners) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}