PreviousNextTracker indexSee it online !

(9/22) 3612759 - Patch for bug ID 3598585 NullPointerException .....

Patch for bug ID 3598585 posted here:

The reason for NullPointerException wasnt specified well. The real problem was, that if user wanted to add new tool to toolbar and forgot to select an action to be performed by the new toolbar icon, then the NullPointerException occured, but the user didnt see any action. It could be quite confusing.

My simple patch gives the user more info, when he forgets to select an action and presses the OK button in toolbar Add dialog.
When user presses OK and action is not selected, the message dialog appears and warns him.

Submitted danisluk - 2013-05-06 - 11:55:34z Assigned nobody
Priority 5 Category None
Status Open Group None
Resolution None Visibility No


2013-05-06 - 11:56:48z
Index: jEdit/trunk/org/gjt/sp/jedit/options/
--- jEdit/trunk/org/gjt/sp/jedit/options/ 22966)
+++ jEdit/trunk/org/gjt/sp/jedit/options/ copy)
@@ -656,13 +656,16 @@
ToolBarOptionPane.Button button =
+JOptionPane.showMessageDialog(null, "No action was selected");
+return null;
label = button.label;
actionName = button.actionName;
throw new InternalError();
return new ToolBarOptionPane.Button(actionName,
2013-05-06 - 12:39:05z
I updated the patch to use text resource from properties
2013-05-07 - 09:50:42z
Maybe it would be better to not activate the buttons if the action is not selected ?
2013-05-07 - 10:21:34z
Ok, I can do as you suggested.
2013-05-08 - 22:53:09z
To kpouer : I have made another patch, which does what you suggested to me. The OK button is disabled when is not set any action or the separator radio button is not selected, otherwise the OK button is enabled.
2013-05-16 - 09:09:41z
I think there is something wrong. If you do control+click on the list you can unselect the action and the button will remains activated.
Also could you following coding rules (place opening braces on next line)


2013-05-06 - 12:37:54z

better patch with updated localization properties

2013-05-08 - 22:50:24z

fixed , as kpouer suggested by disabling ok button