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
This commit is contained in:
@@ -189,6 +189,17 @@ public class RadialMenu
|
|||||||
return false;
|
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
|
* Adds a listener that will be notified when a menu item is
|
||||||
* selected. When the the menu is popped down, all listeners will be
|
* 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
|
// deactivate the active item and post a command for it
|
||||||
if (_activeItem != null) {
|
if (_activeItem != null) {
|
||||||
// only process the selection if the item is enabled
|
// 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
|
// if the item has an overriding argument, use that
|
||||||
Object itemArg = _activeItem.argument;
|
Object itemArg = _activeItem.argument;
|
||||||
Object arg = (itemArg == null) ? _argument : itemArg;
|
Object arg = (itemArg == null) ? _argument : itemArg;
|
||||||
|
|||||||
Reference in New Issue
Block a user