Integrating Jacobe Beautifier for Java with TextPad

General questions about using TextPad

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

Post Reply
roxyproxy
Posts: 4
Joined: Fri Jun 06, 2003 11:55 pm

Integrating Jacobe Beautifier for Java with TextPad

Post by roxyproxy »

Hi,

I am using the Jacobe Code Beautifier which is available from the Jacobe website

I have used it so far from the command-line successfully, but I want to integrate it with TextPad so that when I choose to jacobe a file, it should do that automatically and replace the existing file with the jacobed file. Right now, I have to do the following on the command-line:


1. jacobe file.java
2. delete file.java
3. rename file.java.jacobe file.java

Is there any easy way of doing this in one step from TextPad? I think there must be a way because one of the feedback comments says "just in a few minutes integrated it with Textpad"!

I am new to this, so I will be very grateful if anyone could help me.

Thanks,
RoxyProxy
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

write a batch file doing your 3 steps

Run the batch file as tool instead of running jacobe directly.

When using the tool, confirm when textpad asks whether you want to reload the file as it was changed outside of textpad...
roxyproxy
Posts: 4
Joined: Fri Jun 06, 2003 11:55 pm

Post by roxyproxy »

MudGuard wrote:write a batch file doing your 3 steps
Could you please tell me what exactly the batch file should contain? What I am confused about is how to put the filename in the batch file.

Example:

jacobe ?
delete ?
rename ?.java.jacobe ?.java

What do I put in the "?" fields? I can't just put file.java because every file has its own name. Sorry, I am new to this, so any help will be appreciated. I could always replace ? with *.java, but I want to do this for the current file that I want to jacobe.

Thanks,
roxyproxy
roxyproxy
Posts: 4
Joined: Fri Jun 06, 2003 11:55 pm

Post by roxyproxy »

I figured something out; here's what I did:

jacobe %1.java
delete %1.java
rename %1.java.jacobe %1.java


This works if I pass $BaseName as a parameter, but I don't want the second and third steps (delete and rename) to occur if the jacobe step is unsuccessful. How do I do this?

Thanks a lot!
roxyproxy
roxyproxy
Posts: 4
Joined: Fri Jun 06, 2003 11:55 pm

Post by roxyproxy »

I figured out something more too!

This works well now:

jacobe %1.java
IF NOT EXIST %1.java.jacobe GOTO ENDBAT
delete %1.java
rename %1.java.jacobe %1.java
:ENDBAT


Is there a more efficient way of doing this?

Thanks,
roxyproxy
Post Reply