Add applyToEditor function