Syntax Highlighting

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
daveabrock
Posts: 6
Joined: Tue Mar 31, 2009 3:29 pm

Syntax Highlighting

Post by daveabrock »

Hello,

When using TextPad for a Java program, I cannot see syntax highlighting. I have enabled Java functionality and even have the "Enable Syntax Highlighting" checkbox enabled. I've saved the file as a Java file, rebooted, and tried everything that could come to mind. Advice?
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

What syntax file are you using? text.syn (possibly the default) or something like java.syn

Assuming it's java.syn, click the Open button on the syntax tab and it should open a file that looks approximately like

; TextPad syntax definitions for Java
; Copyright (C) 1998-2000, Helios Software Solutions

C=1
{snip}
I choose to fight with a sack of angry cats.
daveabrock
Posts: 6
Joined: Tue Mar 31, 2009 3:29 pm

Post by daveabrock »

Thanks for the reply.

When I go to Configure > Preferences > Document Classes > Java >Syntax, "java.syn" is listed. When clicking open, the file opens exactly as you stated.
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

In order to enable the syntax highlighting, you will need to implement the following procedure for each document class, as in the example below:

Click on:

1. Configure
2. Preferences
3. Plus sign next to Document Classes
4. Plus sign next to "Java"
5. Syntax
6. Check the "Enable syntax highlighting" box.
7. Under the heading "Syntax definition file" Select
"java.syn".
8. Click Apply / OK

Please ensure that *.java is a member of the Files in class as follows:

1. Configure
2. Preferences
3. Plus sign next to Document Classes
4. Click on Java(not the plus sign next to "Java")
5. Under the heading "Files in class", make sure that *.java is in the list. If it is not there, then you will need to add it to the list, along with any other file extensions that you are using for Java files.
6.Click Apply / OK

New documents must be saved with the relevant extension, in order for the syntax highlighting to be activated.

This information is also available from here:

http://www.textpad.com/forum/viewforum.php?f=9


I hope this helps.
Helios Software Solutions
daveabrock
Posts: 6
Joined: Tue Mar 31, 2009 3:29 pm

Post by daveabrock »

I saw that post and tried that and I am still not able to see highlighting enabled.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

It's possible your changes were not retained. Be sure to do this:

1. Close all other copies of TextPad.
2. Close all open documents in TextPad, including any default blank document.
3. Make the Configuration changes detailed in earlier solution
4. Apply and OK your way out and close TextPad.
5. Reopen TextPad and confirm the settings were retained.
Hope this was helpful.............good luck,
Bob
daveabrock
Posts: 6
Joined: Tue Mar 31, 2009 3:29 pm

Post by daveabrock »

Bob,

Thanks for the reply. I tried that with no luck. This is very mysterious as to why this is not occurring.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

What is your filename and extension?
Is the extension listed in the extensions for the Java Class?

It was noted to have *.java in your class group. You should include any extenstions you might use for java. I have three in my Java Class:
*.JAVA / *.JAV / *.JS
Hope this was helpful.............good luck,
Bob
daveabrock
Posts: 6
Joined: Tue Mar 31, 2009 3:29 pm

Post by daveabrock »

Yes, I have Java extensions listed in my classes.
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Is this a home machine or a work machine? If work, then perhaps a permission issue?
I choose to fight with a sack of angry cats.
daveabrock
Posts: 6
Joined: Tue Mar 31, 2009 3:29 pm

Post by daveabrock »

I have no restrictions on this machine.
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

In order to confirm that the syntax highlighting really is enabled for that specific document, please try right clicking in the document and choose Properties/Syntax.
Helios Software Solutions
Post Reply