Allow action handlers to show a scene object's associated text without having an allowed action (though by default they still don't)

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3917 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Mike Thomas
2006-03-06 23:45:12 +00:00
parent 18418122ea
commit e5c65b95b5
2 changed files with 13 additions and 3 deletions
@@ -1040,7 +1040,7 @@ public class MisoScenePanel extends VirtualMediaPanel
// if we have an object action handler, possibly let them veto
// the display of this tooltip and action
ObjectActionHandler oah = ObjectActionHandler.lookup(action);
if (oah != null && !oah.actionAllowed(action)) {
if (oah != null && !oah.isVisible(action)) {
continue;
}
@@ -40,14 +40,24 @@ public class ObjectActionHandler
{
/**
* Returns true if we should allow this object action, false if we
* should not. This is used to completely hide actions that should not
* be visible without the proper privileges.
* should not.
*/
public boolean actionAllowed (String action)
{
return true;
}
/**
* Returns true if we should display the text for the action. By default
* this returns whether the action is allowed or not, but can be
* overridden by subclasses. This is used to completely hide actions that
* should not be visible without the proper privileges.
*/
public boolean isVisible (String action)
{
return actionAllowed(action);
}
/**
* Get the human readable object tip for the specified action.
*/