From 237618f8841969360cd04dca82f6801ae442cd26 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 20 Oct 2005 09:47:55 +0000 Subject: [PATCH] Allow menu items to call back for re-layout, don't submit a null command. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1721 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/swing/RadialMenu.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/RadialMenu.java b/projects/samskivert/src/java/com/samskivert/swing/RadialMenu.java index 662f9a48..6f6b9351 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/RadialMenu.java +++ b/projects/samskivert/src/java/com/samskivert/swing/RadialMenu.java @@ -189,6 +189,17 @@ public class RadialMenu return false; } + /** + * May be called by an item when it changes in a material way. + */ + public void itemUpdated () + { + if (_host != null) { + layout(); + repaint(); + } + } + /** * Adds a listener that will be notified when a menu item is * selected. When the the menu is popped down, all listeners will be @@ -449,7 +460,7 @@ public class RadialMenu // deactivate the active item and post a command for it if (_activeItem != null) { // only process the selection if the item is enabled - if (_activeItem.isEnabled(this)) { + if (_activeItem.isEnabled(this) && _activeItem.command != null) { // if the item has an overriding argument, use that Object itemArg = _activeItem.argument; Object arg = (itemArg == null) ? _argument : itemArg;