Package ptolemy.actor.gui
Class ActorGraphicalMessageHandler
- java.lang.Object
-
- ptolemy.util.MessageHandler
-
- ptolemy.gui.UndeferredGraphicalMessageHandler
-
- ptolemy.gui.GraphicalMessageHandler
-
- ptolemy.actor.gui.ActorGraphicalMessageHandler
-
- All Implemented Interfaces:
java.lang.Thread.UncaughtExceptionHandler
- Direct Known Subclasses:
VergilGraphicalMessageHandler
public class ActorGraphicalMessageHandler extends GraphicalMessageHandler
A message handler that optionally includes a button that opens the model that contains the actor that caused the exception.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Christopher Brooks
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Field Summary
-
Fields inherited from class ptolemy.gui.UndeferredGraphicalMessageHandler
_context
-
-
Constructor Summary
Constructors Constructor Description ActorGraphicalMessageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object[]
_checkThrowableNameable(java.lang.Object[] options, java.lang.Throwable throwable)
Under certain circumstances, add a "Go To Actor" button to the options array.protected Nameable
_getNameable(java.lang.Throwable throwable)
Given a throwable, return the first Nameable (if any).protected void
_showNameable(java.lang.Throwable throwable)
Open the level of hierarchy of the model that contains the Nameable referred to by the KernelException or KernelRuntimeException.-
Methods inherited from class ptolemy.gui.GraphicalMessageHandler
_error, _error, _message, _warning, _warning, _yesNoCancelQuestion, _yesNoQuestion
-
Methods inherited from class ptolemy.gui.UndeferredGraphicalMessageHandler
_showStackTrace, getContext, setContext
-
Methods inherited from class ptolemy.util.MessageHandler
error, error, getMessageHandler, isNonInteractive, message, setMessageHandler, setStatusHandler, shortDescription, status, uncaughtException, warning, warning, yesNoCancelQuestion, yesNoCancelQuestion, yesNoQuestion
-
-
-
-
Method Detail
-
_checkThrowableNameable
protected java.lang.Object[] _checkThrowableNameable(java.lang.Object[] options, java.lang.Throwable throwable)
Under certain circumstances, add a "Go To Actor" button to the options array. The button is added to the array if the throwable is a KernelException or a KernelRuntimeException with a non-null Nameable and the Nameable is not at the toplevel.- Overrides:
_checkThrowableNameable
in classUndeferredGraphicalMessageHandler
- Parameters:
options
- An array of Strings, suitable for passing to JOptionPane.showOptionDialog().throwable
- The throwable.- Returns:
- An array of Strings. If the throwable is an instance of KernelException and non-null, then the String "Go To Actor" is added to the array as the last element. Otherwise, the options argument is returned.
-
_getNameable
protected Nameable _getNameable(java.lang.Throwable throwable)
Given a throwable, return the first Nameable (if any).- Parameters:
throwable
- The throwable that may or may not be an instance of KernelException or KernelRuntimeException.- Returns:
- The first Nameable or null if the throwable is not a KernelException or KernelRuntimeException.
-
_showNameable
protected void _showNameable(java.lang.Throwable throwable)
Open the level of hierarchy of the model that contains the Nameable referred to by the KernelException or KernelRuntimeException.- Overrides:
_showNameable
in classUndeferredGraphicalMessageHandler
- Parameters:
throwable
- The throwable that may be a KernelException or KernelRuntimeException.
-
-