Platinum Partner
netbeans

JCite Support in NetBeans IDE

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:

 

 

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}