Geertjan's Blog

  • August 15, 2005

Tricking the NetBeans IDE Source Editor's Tab Labels

Geertjan Wielenga
Product Manager
At the end of Declarative MIME Type Resolvers, NetBeans IDE, and Shakespeare, I ended up with several XML files, each containing either successful or failed returns from a web service that retrieves Shakespeare quotations. Thanks to declarative MIME resolvers, each successful return had a William Shakespeare icon, while each failed return came with an Alfred E. Neuman icon. The final screenshot of that blog entry shows the Source Editor, with one tab per file, with the name of the file plus the file extension -- as well as the accompanying icon -- as the label of the tab. This is how I got the filename to equal the search string (the relevant line is emboldened below):

 String quotation = request.getParameter("quotation");
String ret_quotation = getShakespeareSoap().getSpeech(quotation);OutputStream fout= new FileOutputStream(quotation + ".xml");
OutputStream bout= new BufferedOutputStream(fout);
OutputStreamWriter out1 = new OutputStreamWriter(bout, "UTF-8");
out1.write("<?xml version=\\"1.0\\" ");

But now I've got one tiny step further -- I now know (thanks to a recent thread on nbusers@netbeans.org), that you can use the Options window to hide file extensions. As a result, thanks to the filenames being equal to the search strings, it now seems as if I've done something magical to the labels of the Source Editor tabs -- it seems that I've put the search strings in the labels of the Source Editor tabs, while all I've done is made the filenames equal to the search strings and then hid the file extensions (click to enlarge):

The screenshot above also shows where you should go in the Options window to hide the file extensions.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.