Wednesday, June 05, 2024

I didn't know this thing is still available.

I do remember a long while ago Google sent something about blogger being archived or shutdown or something.   

But it's still here.  



Friday, November 14, 2008

JSyntaxPane on dzone

Greetjan Wielenga posted a very cool entry on dzone here.
It is very cool with nice screenshots and a mini how-to.
Many Thanks Greetjan.

I haven't blogged for a while. I'll try and keep up with writing a bit more than Java Code.

Thursday, July 17, 2008

Back to Bahrain! and a JSyntaxPane fix

Well, this is my last day in Jeddah, and tomorrow I'm on my way to Bahrain, inshallah.

I had some time at the hotel, and since they have very good high speed in-room internet, and I got my laptop, I fired up Ubuntu, got the latest NetBeans loaded and upgraded, and fixed an outstanding issue with JSyntaxPane. So now, it is bug free :-)

Monday, July 07, 2008

Darken web pages for easy reading

Personally, I prefer reading light text on dark background. Most web-pages use black text on white background, including this blog. I'll probably change the theme on this blog later, but I'm actually lazy because of this amazing tool. All you need to do is drag it on your bookmarks toolbar, and voila! One click, and all the text in the page will be grey on black, and links blue on black.

This only works on Firefox. Internet Explorer users; now you have another reason to switch ;-)

Here is the article and the bookmarklet.

Wednesday, July 02, 2008

Great Leaders

Joel Spolsky has a great article about Bill Gates, and being a great leader. It's not that long and definitely worth reading.
The main point is, to be a good and successful leader, you have to know what your company / department / ministry / whatever is doing. You must have passion about what you are doing. How many times have we seen unfit managers who have no clue what their sub-ordinates are doing?
Enough said...

Sunday, June 29, 2008

JSyntaxPane with more Languages

Some more free time and I had time to fix Java and Groovy Lexers to have better String handling. The older versions did not process String Escape Characters properly.

I also added Property file and SQL lexers and did some refactoring by moving the lexers in their own package.

The Build file was modified to also build the Java lexers from the flex files (you need the JFlex.jar file in your ant/lib folder for this to work).

This may be the last version for a while. I may not have time in the next few weeks to manage this.

The source is now available in the Source Tab and only the binary distribution is available as a download. You can still load and execute the Jar file. It will start the tester.

Have fun!

Monday, June 23, 2008

JSyntaxPane new version - now with auto indentation and undo/redo

I had some more free time to work on JSyntaxPane. I did some refactoring, that should not change the way to use it though.
Refactoring was done by creating a new SyntaxDocument to store the Tokens, instead of having the SyntaxView store them. The former way was actually very stupid!
The Document should know about its own tokens, and the View gets the tokens from the Document. That is how it is done now. And this way you can also retrieve data about the SyntaxDocument by knowing its EditorPane control. And no need for listeners!
The new SyntaxDocument also has built in undo and redo.
A new class SyntaxActions was also created with several useful TextActions thrown in. These include Smart and Java Indentation, and mapping the TAB / Shift-TAB to indent / unindent the selected lines. Also mapped the default undo / redo keys to behave properly.
I also modified the Test application, and now it will display the token details under the cursor. This is very helpful for debugging the lexers.

Also changed is the way Fonts are used. Now the font of the Component is used, and you can only change the style (bold/italic) and color. Which means that the entire EditorPane will have one single font face and size. This actually suites my taste, unlike Notepad++ which by default uses different fonts and sizes for comments.

Again, all you need to do is one line to set the EditorKit. All the above is done for you automatically.

Have a look at the Test Application using Java WebStart here. Java 1.5+ is needed.

Project home is on Google Code here.

Hmm.. what next? Scripting? Nah.. I'm probably done, for now. I needed a simple control to edit scripts in my Java Swing applications, and thats probably it. unless...



Just Google it!