Introduction
Notes about the implementation:
- This is a basic Moin editor applet in Java. (This is my first program in Java so I'd appreciate any constructive feedback.)
The applet was written using Borland's JBuilder8 because the Personal edition is free. Thanks Borland!
I just used a wizard to create the project so I don't know if it's set up properly or not.
It uses the AWT and Swing to display its widget set. I don't know if this is a good idea or not, but it works
It looks like you could turn an applet like this into a full WYSIWYG editor by writing an EditorKit for Moin.
I've tried to keep it simple and use the AWT framework. It uses a JTextArea, which is a simple (non-formatting) text widget. There are currently only two source files. The GUI is in one file and the Moin editing code is in the other. The GUI talks to the editor, which is an ActionListener using action commands.
Implementation environment: It was suggested that I use Eclipse and SWT to implement the applet. Eclipse looks pretty nice but I've started with JBuilder now (which is also very nice). I couldn't find a widget editor. I'm also a little concerned how portable SWT/JFace is since it uses native widgets. Perhaps someone could inform me (to save me having to read lots of docs which I don't have time to do).
- It has since been mentioned to me that SWT is not fully portable because it uses native widgets so I won't be using this solution.
The code is attached as MoinEditorApplet.zip in the structure of a JBuilder8 project. I assume this can be used by other development environments.
Screenshot
This is a sample screen shot showing three formatting groups: text style, list formatting and section formatting.
I can't set a working demo up here as there is no HTML macro and there would probably be some nasty security issues .
Discussion
Please feel free to add any comment here...
Great work, haven't seen the program but nice to have build it. I believe it would be useful for quite a people. Since you have already used Swing (JTextArea is part of Swing and not basic AWT) you are now required to have a new Java plugin in the browser for the applet to work. Older browsers have only upto 1.1.x built in. Why not support a few additional stuffs like Rich Text editor. Why not have bold display a bold text and italic display an italic text instead of just bunch of quotes. Also how about displaying Heading1 ... instead of equals? How about a table?
You might consider Jython to develop the applet so you can use parts of code from MoinMoin to render the stuff as HTML page and display it in the JTextArea (it can do that!). May be I am making it unnecessarily complicated