ok, give it a try !

You can edit a page of the play framework manual using this textile editor. You need a pretty recent browser with a fast Javascript engine and full canvas support, including text drawing features. So try with Safari 4, Firefox 3.5 or Chrome 2.

h1. Play framework Overview The "play framework":http://www.playframework.org makes it easier to build Web applications with Java. It's a clean alternative to bloated Enterprise Java stacks. It focuses on developers productivity and targets RESTful architectures. Play is a perfect companion for **agile sofware development**. p(note). Wanna see some code ? Check "Five cool things you can do with play":5things, or try the "hello world tutorial":helloworld. h2. Pure __Java__ framework Play is a pure Java framework and allows you to keep your preferred development tools and libraries. If you already use Java as a development platform you don't need to switch to another language, another IDE and other libraries. __Just switch to a more productive Java environment !__ A Play application looks really coherent to any Java developer: !images/structure! h2. Built over HTTP If you are already using another Java(tm) Web framework like Servlet API or Struts(c) framework, you allready have used an abstract view of the HTTP protocol with ??strange Java APIs and concepts??. We think differently. A Web applications framework should give you full, straightforward access to HTTP and its concepts --this is a fundamental difference between Play and other Java web application frameworks--. HTTP, the Request/Response pattern, REST, content-type negotiation and URI are all major concepts for the Play framework. For instance, binding an URI pattern to a Java call is a matter of one line: bc. GET /clients/{id} Clients.show If AJAX, REST and managing back/forward movement between web pages are some of the issues you face in your day-to-day web development, just give Play a try. h2. Efficient templating engine We like the idea behind JSP & Expression Language. But why are so many configuration files necessary to create a Tag library? Why shouldn't we have full access to the underlying object model? JSP has a lot of limitations and this is indeed frustrating. That's why we've created our custom template system, inspired by JSP but without its constraints ! You and anyone else should be tired of writing things like this: bc(jsp). You've ${fn:size(emails.unread)} unread emails ! You've none unread emails ! We think you would certainly prefer to write the following: bc. You've ${email.unread?.size() ?: 'none'} unread emails ! The expression language used by play template engine is "Groovy":http://groovy.codehaus.org/ which provides a syntax consistent with Java syntax. While play mainly uses the templating system to render HTML responses, you are free to use it to generate any other documents such as email messages, json responses, etc. h2. Fix the bug and hit Reload The Java platform is indeed infamous for its low productivity, mainly because of its repeated and tedious compile-package-deploy cycles. The main goal of the play framework is to reach maximum productivity within the **Java** platform. That's why we rethought the development cycle to make developing with play an efficient process. The framework compiles your Java sources directly and hot-reloads them into the JVM without the need to restart the server. You can then edit, reload and see your modifications immediately, just as in any LAMP environment. Whenever an error occurs, the framework makes its best effort to show you the problem code. No more cryptic errors and recursive stack traces to analyse to find a syntax error. !images/error! h2. Full-stack application framework The play framework was initially inspired by our own Java applications. It has all the tools needed to create a modern web application : * Relational Database support through JDBC. * Object-Relational Mapping using Hibernate. * Memcache support. * Web services consumption either in JSON or XML. * OpenID support for distributed authentication. * Image manipulation API. A plugin architecture lets you combine a Web application with many other Web applications, and reuse Java code, templates or resources like Javascript and CSS. p(note). **Give it a try** "Install the play framework":install and start developing your first application.

Performances are pretty good (almost on my Macbook Pro), it can edit without pain a file of thousands lines. Modern javascript engines rocks. Canvas implementations rocks. To be honest, I was more concerned about performances issues last time I wrote an eclipse editor plugin using Java and SWT so called native bindings.

how to embed it ?

First download the textile-editor.min.js component (or get the uncompressed code if you need to hack it). Then you need JQuery (in fact you can avoid it will a little hack, see bellow).

To integrate an editor in any web page, just create a canvas element, and instantiate an editor on it at load time. Something like :

<canvas id="editor" width="500" height="300">Textile content here ...</canvas> ... <script type="text/javascript"> var init = function() { new Textile.Editor('editor'); } </script>

If you really can't add JQuery to your page, you can avoid it, but you have to monkey patch the editor to provide an alternative implementation of the Textile.Editor.getPosition function that return the canvas position (but I'm sure that your preferred javascript framework will help you to do that). Example:

Textile.Editor.prototype.getPosition = function() { var canvas = this.el; // compute canvas position var x = 0, y = 0; ... // return the result return { top: y, left: x } }

This code is licenced under the Apache 2 licence, and copyrighted zenexity.