CoolEditorActions V1.0.5 released
I’ve been updated my CoolEditorActions NetBeans Plugin which is now compatible with NetBeans 7.1.
Other improvements:
- The Button’s Popup Menu is lazy loaded
- Improved Open & Select Project action
- Added Close Project action
- minor bug fixes
The Plugin can be downloaded from here:
New plugin CoolEditorActions released
Today I released the first version of the CoolEditorActions NetBeans plugin. This plugin adds a drop down button to the editor’s toolbar. From the popup menu, some useful actions are available for all the file path objects:
The plugin can be downloaded from the Kenai Project site. Feel free to write me some feedback!
I will submit this plugin in the next few days also to the NetBeans Plugin Portal.
StatusLine in menu bar
With a simple NetBeans startup parameter the StatusLine can be placed in the menu bar: add the property
netbeans.winsys.statusLine.in.menuBar=true
to the NetBeans configuration file installRoot/etc/netbeans.conf:
# Options used by NetBeans launcher by default, can be overridden by explicit # command line switches: netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Xmx1500m -J-XX:PermSize=32m -J-XX:MaxPermSize=400m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dnetbeans.winsys.statusLine.in.menuBar=true"
Don’t forget to add -J-D before the property name!
See also FaqNetbeansConf
Simple Validation API & DialogDescriptor
This post shows you how the Simple Validation API (HowTo, Project@Kenai) can be usedĀ together with a NetBeans Platform standard dialog (using a DialogDescriptor).
The Simple Validation API gives you a convenience method to show a dialog like (excerpt from the BasicDemo):
JPanel panel = new JPanel();
... // setup panel
ValidationPanel vp = new ValidationPanel();
vp.setInnerComponent(panel);
... // setup validation
// Convenience method to show a simple dialog
if (vp.showOkCancelDialog("URL")) {
System.exit(0);
} else {
System.exit(1);
}
To use a standard NetBeans Platform dialog, the sample above can be replaced with:
... // as above
DialogDescriptor dd = ValidationUtil.createDialogDescriptor(vp, panel, "URL");
Object ret = DialogDisplayer.getDefault().notify(dd);
if (DialogDescriptor.OK_OPTION.equals(ret)) {
System.exit(0);
} else {
System.exit(1);
}
public class ValidationUtil {
private ValidationUtil() {
// default constructor suppressed for non-instantiability
}
public static DialogDescriptor createDialogDescriptor(ValidationPanel vp, Object innerPane, String title) {
final DialogDescriptor dd = new DialogDescriptor(innerPane, title);
ValidationUI okButtonEnabler = new ValidationUI() {
private NotificationLineSupport nls = dd.createNotificationLineSupport();
public void showProblem(Problem problem) {
if (problem != null) {
switch (problem.severity()) {
case FATAL:
nls.setErrorMessage(problem.getMessage());
dd.setValid(false);
break;
case WARNING:
nls.setWarningMessage(problem.getMessage());
dd.setValid(true);
break;
default:
nls.setInformationMessage(problem.getMessage());
dd.setValid(true);
}
} else {
nls.clearMessages();
dd.setValid(true);
}
}
public void clearProblem() {
showProblem(null);
}
};
vp.getValidationGroup().addUI(okButtonEnabler);
vp.getValidationGroup().performValidation();
return dd;
}
}
Welcome
Welcome to my Java Blog. Here I will post some hopefully interesting articles about Java in general and NetBeans Platform related topics. The focus will be on the NetBeans Platform.

