Skip to main content
January 4, 2010
Answered

editable and non-editable together?

  • January 4, 2010
  • 1 reply
  • 644 views

Hi,

I wanted to know if it is possible to create 2 spans, one editable and one non-editable together in the same textFlow object?

I have looked into the spark primitives and understood that there I can have only a whole editable/noneditable component (RichEditableText/RichText), So I have to use the framework for it, but how ?

This topic has been closed for replies.
Correct answer rdermer

TextContainerManager is a wrapper for the framework classes that does some optimzations for display only text and provides some cleaner apis that help with gumbo integration.  It may be useful to you but is orthoganol to this problem.

I think the problem is twofold

1) tagging span's that are not editable.

2) preventing those span's from being edited.

Let's assume that you're just worried about changes coming from the EditManager.  I'd think you want to allow changes being done with the model APIs.

1) can be solved by using a user style.For example span.setStyle("editable",false)

2) will require either creating your own subclass of EditManager with your own custom operations that never modify non-editable text OR listening for textFlow flowOperationBegin events and modifying the operations to obey rules that prevent modification of non-editable text.  You'll have to understand each operation and check the span's involved.  You could cancel the operation or modify it.

Hope that helps,

Richard

.

1 reply

Adobe Employee
January 4, 2010

Not supported by TLF at this time.

Richard

January 5, 2010

Well, Do you have an idea which class of the framework should I override and modify in order to achieve this functionality?

I have looked at "TextContainerManager" class documentation. It is specified that th calss "Assumes that it manages all children of the container",

but it's not clear what should i override to change this.

rdermerCorrect answer
Adobe Employee
January 5, 2010

TextContainerManager is a wrapper for the framework classes that does some optimzations for display only text and provides some cleaner apis that help with gumbo integration.  It may be useful to you but is orthoganol to this problem.

I think the problem is twofold

1) tagging span's that are not editable.

2) preventing those span's from being edited.

Let's assume that you're just worried about changes coming from the EditManager.  I'd think you want to allow changes being done with the model APIs.

1) can be solved by using a user style.For example span.setStyle("editable",false)

2) will require either creating your own subclass of EditManager with your own custom operations that never modify non-editable text OR listening for textFlow flowOperationBegin events and modifying the operations to obey rules that prevent modification of non-editable text.  You'll have to understand each operation and check the span's involved.  You could cancel the operation or modify it.

Hope that helps,

Richard

.