Adam Bien's Weblog
Java EE Gems In NetBeans 7--Milliseconds Incremental Deployment
On every "save" NetBeans deploys your application behind the scenes in milliseconds. This works well with standard NetBeans Java EE projects (ant based), or with maven 3. Maven 3 projects can be also deployed in the "on save" fashion incrementally.
You only have to "Run" your application instead of "Clean and Build" or "Deploy" it. After an initial "Run" (right mouse click on project, then choose "Run") just saving a file causes an incremental redeployment of the application. It works in most of the cases, but sometimes you will have to "Clean and Build" your project. "Clean and Build" causes a recompilation and redeployment of the whole application - it is also fast (but application size dependent) and takes a few seconds.Posted at 09:25AM Sep 06, 2011 by Adam Bien in Netbeans | Comments[8] | Views/Hits: 2415
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
Java EE 6 Makes NetBeans Even Leaner - New Java EE Bundle Available
NetBeans 7 daily builds come with a dedicated Java EE Bundle. For Mac OS X the download size of the Java EE bundle (NetBeans 7 Development) is 152 MB (IDE + everything you need for Java EE 6 development) comparing it to 192 MB NetBeans 7 Beta Java build. Try it.
It also means: the difference between "Plain Java NetBeans" and NetBeans Java EE edition with Glassfish is only 93 MB...Posted at 12:22AM Feb 12, 2011 by Adam Bien in Netbeans | Comments[2] | Views/Hits: 2896
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
Useful JSF 2 / CDI Table Generation Wizard in NetBeans
- You will need a (JPA) domain object with getters / setters. Sample:
public class FireFluid { private long id; private String name; private int amount; public FireFluid() { } public String getName() { return name; } public int getAmount() { return amount; } } - An in EL accessible Collection / List returning the domain objects is also necessary. The simplest way is to use a CDI bean to expose the list to the view:
@Model public class Index { @EJB PalincaCommanderService pcs; public ListgetFireFluids(){ return pcs.all(name); } } - Go to Window -> Palette. Drag the last Entry "JSF Data Table From Entity" and NetBeans will pop-up a dialog with a property and entity suggestion. After confirming the choice, you will only have to import the f: namespace. This can be done with Alt+Enter: The result is:
<h:dataTable id="table" value="#{index.fireFluids}" var="item">
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>
</f:facet>
<h:outputText value="#{item.name}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Amount"/>
</f:facet>
<h:outputText value="#{item.amount}"/>
</h:column>
</h:dataTable>
The freemarker template of the generated code can be also customized. Just click on the link in the pop-up.
[I borrowed the code from Palinca JUG Transylvania sample.]
Posted at 01:55PM Feb 06, 2011 by Adam Bien in Netbeans | Comments[1] | Views/Hits: 5860
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
Swing Looks ...Great (Part IV NetBeans)
NetBeans IDE (Swing again) looks nice, especially on Mac:
It looks also nice on Vista with Nimbus:
Posted at 02:49AM Jan 03, 2011 by Adam Bien in Netbeans | Comments[0] | Views/Hits: 2756
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
Swing Looks ...Great (Part III Nimbus)
Nimbus comes already with JDK 1.6.
Nimbus doesn't have to be installed, it is shipped with JDK 1.6. You only have to activate it.
There is a hacky (because of reflection) but robust way to activate that. This complex approach is needed, because Nimbus was introduced with JDK 1.6u10 and was not available before.
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (UnsupportedLookAndFeelException e) {
// handle exception
} catch (ClassNotFoundException e) {
// handle exception
} catch (InstantiationException e) {
// handle exception
} catch (IllegalAccessException e) {
// handle exception
}
[Code Snippet from:http://download.oracle.com/javase/6/docs/technotes/guides/jweb/otherFeatures/nimbus_laf.html]
The command line option
-Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel can be used as well.With NetBeans you can create a Nimbus mock-up in minutes (actually seconds).
Posted at 10:31AM Nov 30, 2010 by Adam Bien in Netbeans | Comments[3] | Views/Hits: 6268
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
Useful Maven Repository Viewer In NetBeans
NetBeans comes with a useful Maven Repository Viewer:
.
Posted at 11:26AM Nov 26, 2010 by Adam Bien in Netbeans | Comments[2] | Views/Hits: 3651
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
Seamless Terminal Integration ...in NetBeans 6.9.1
NetBeans 6.9.1 comes with seamless Terminal integration. You can open the terminal view from: Window -> Output -> Terminal.
From that you can open several remote and local terminals by clicking on the icons in the left upper corner.
I use the Terminal view to monitor local and remote Glassfish instances, tagging / pushing the hg repository. Enjoy!
Posted at 11:28AM Nov 01, 2010 by Adam Bien in Netbeans | Comments[16] | Views/Hits: 5615
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
Features I Missed In NetBeans 6.8, came with 6.9
NetBeans 6.8 didn't came without toString() generation and "Go To Implementation" navigation. Both features were available for Eclipse / IntelliJ, but not NetBeans. NetBeans 6.9.1 implements both:
- toString() method can be generated with cmd+i (Mac), or Alt+Enter (Win) and choosing toString. It comes, however, with a small bug - some blanks between attributes are missing (e.g. Post{" + "uri=" + uri + "[]title=" + title + "[]numberOfHits=" + numberOfHits + '}').
- You can easily navigate from an interface to its implementations, as well as from the implementations to its interface by clicking on the "I" icon. Interestingly: I do not use this feature a lot, because I was able to delete most of the interfaces with the introduction of Java EE 6 to my projects.
...already looking forward to NetBeans 7.0
Posted at 11:35PM Oct 09, 2010 by Adam Bien in Netbeans | Comments[3] | Views/Hits: 3191
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
JDeveloper vs. NetBeans - The Poll Results
The results are amazing: 434 (NetBeans) vs. 18 (JDeveloper). JDeveloper comes with some interesting stuff - it would be a nice extension of NetBeans. The integration wouldn't be that hard - both IDEs are Swing based...
Posted at 02:37PM Jan 27, 2010 by Adam Bien in Netbeans | Comments[11] | Views/Hits: 9519
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien
NetBeans Is Very Poplular In Germany - Only 4 % Behind Eclipse
JavaMagazin's (one of the largest / the largest German Java magazine) quickvote is closed. The results are interesting:
- Eclipse - 44%
- NetBeans - 40%
- IntelliJ IDEA - 14%
- others - 2 %
Total votes: 2108
JavaMagazin covers a lot of Eclipse stuff. They also publish a dedicated Eclipse Magazin - so the result is really interesting. Btw. the "others" are: JDeveloper, WAS, Notepad, Emacs etc :-).
Posted at 11:05AM Jan 10, 2010 by Adam Bien in Netbeans | Comments[5] | Views/Hits: 1807
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien


