comparison dwtx/core/commands/Command.d @ 90:7ffeace6c47f

Update 3.4M7 to 3.4
author Frank Benoit <benoit@tionex.de>
date Sun, 06 Jul 2008 23:30:07 +0200
parents 4878bef4a38e
children
comparison
equal deleted inserted replaced
89:040da1cb0d76 90:7ffeace6c47f
43 import dwtx.core.commands.ITypedParameter; 43 import dwtx.core.commands.ITypedParameter;
44 import dwtx.core.commands.HandlerEvent; 44 import dwtx.core.commands.HandlerEvent;
45 45
46 import dwt.dwthelper.utils; 46 import dwt.dwthelper.utils;
47 import tango.text.convert.Format; 47 import tango.text.convert.Format;
48 import tango.io.Stdout;
48 49
49 /** 50 /**
50 * <p> 51 * <p>
51 * A command is an abstract representation for some semantic behaviour. It is 52 * A command is an abstract representation for some semantic behaviour. It is
52 * not the actual implementation of this behaviour, nor is it the visual 53 * not the actual implementation of this behaviour, nor is it the visual
860 public final bool isEnabled() { 861 public final bool isEnabled() {
861 if (handler is null) { 862 if (handler is null) {
862 return false; 863 return false;
863 } 864 }
864 865
865 return handler.isEnabled(); 866 try {
867 return handler.isEnabled();
868 } catch (Exception e) {
869 if (DEBUG_HANDLERS) {
870 // since this has the ability to generate megs of logs, only
871 // provide information if tracing
872 Tracing.printTrace("HANDLERS", "Handler " ~ (cast(Object)handler).toString() ~ " for " //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
873 ~ id ~ " threw unexpected exception"); //$NON-NLS-1$
874 ExceptionPrintStackTrace( e, Stdout );
875 }
876 }
877 return false;
866 } 878 }
867 879
868 /** 880 /**
869 * Called be the framework to allow the handler to update its enabled state. 881 * Called be the framework to allow the handler to update its enabled state.
870 * 882 *