Geertjan is a DZone Zone Leader and has posted 459 posts at DZone. You can read more from them at their website. View Full User Profile

JCite Support in NetBeans IDE

11.17.2010
| 6731 views |
  • submit to reddit

With JCite, you ensure that two sources are synchronized with each other. In my case, I'm interested in synchronizing the code referenced in tutorials I write with Java code in sample applications. I learned about all the things involved with JCite at Devoxx, from the guy who created JCite, Peter Arrenbrecht.

Simply put, in a template of a tutorial I have this, in the place where I'd like a snippet of code to be:

[jc:org.wordapp.word.engine.WordEngineTopComponent:---fragment] 

Then, in the class referred to above, I have the snippet I need surrounded as follows:

// ---fragment
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    String s = text.getText();
    s = s.toUpperCase();
    text.setText(s);
}
// ---fragment

Then I run the JCite executable, with the arguments -i (input, i.e., the template file), -o (output, i.e., the actual tutorial in the actual folder where I'll check it into the repository), and -sp (source path, i.e., the path to the "src" folder in the sample project where the code snippet above is found).

I've created a small plugin for NetBeans IDE that automates most of this:

What you see above is a new type of file, i.e., with a "jcite" extension, which has specific properties shown in the Properties window, which opens in the HTML editor, and which has a specific menu item for running JCite, using the properties in the Properties window.

Now I'm working on code completion for the placeholder in the template file, which will let you complete the path to the file you're referencing and you'll also be able to use a hyperlink to open that file:

 

 

Published at DZone with permission of its author, Geertjan Wielenga.

Comments

Peter Arrenbrecht replied on Thu, 2010/11/18 - 2:45am

Neat!

Emmanuel Hugonnet replied on Thu, 2010/11/18 - 3:32am

Where can I get it ? I might look into a maven plugin for JCite too

Mateo Gomez replied on Wed, 2012/08/15 - 1:43am

wonderful support for ide...im a amazed by this program

mexican drinks
 

Hair Brazilian replied on Thu, 2014/08/21 - 3:37am

Thank you for you can provide the information china wholesale Malaysian Deep Wave Weave Bundles Of Malaysian Hair

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.