Alex Milowski wrote:
> Suppose, for an experiment, I wanted to develop a "plug-in component" 
> that could
> edit MathML content.  Ideally, I'd want the ability to edit inline so 
> that it would
> be most natural for users.
> 
> For example, if I wanted a subscribed variable I'd need to have:
> 
>    <math xmlns="http://www.w3.org/1998/Math/MathML";>
>     <msub>
>     <mi>S</mi>
>     <mrow><mi>d</mi><mo>+</mo><mn>1</mn></mrow>
>     </msub>
>    </math>
> 
> which would give me the variable S with a subscribe of d+1.
> 
> Obviously, looking at the above, I'd want this to be formatted as an S 
> with d+1 as
> the subscribe because the above markup isn't pretty.  Ignoring the 
> interface issues
> for the moment, is this possible?  If I have some java component that 
> can use AWT+Swing
> to render an appropriate editing interface, can this be plugged into the 
> XMLEditor?
> ...and have that GUI bit modify the document appropriately?

Yes. This is called a custom view.

So custom views are pure views (i.e. they cannot be used to edit the 
document). Other custom views may register themselves with XXE as 
element, attribute or even subtree editors.


> I'd want the following:
> 
>    * Ultimately, I'd need the component to be able to tell the editor 
> whether it
>      should be block, inline-block, or inline.

This is specified in the CSS style sheet, for custom views like for 
ordinary views.



>    * The size of the rendered component would be dependent on the MathML 
> content
>      read from the document.  This, the bounding box (CSS box) would be 
> dependent
>      on feedback from the GUI component.

This is probably possible. I'm not sure.



>    * I'd like to be able to take advantage of the character palette as most
>      mathematics characters are available through unicode.

No. The character palette can just be used to insert a character before 
the caret of a XXE document view.



> How difficult is this to integrate? 

Integrating any Java AWT/Swing component in XXE as a custom view is not 
a difficult task.



> Are there any examples?

XHTML form elements (input, textarea, etc) are custom views.

The Developer's Guide of XXE V2.5 will contain a section explaining how 
to write a custom view.



PS: See http://www.xmlmind.com/xmleditor/features.html#planned


Reply via email to