The Meta-Environment API

asf-gui-listeners.tb

Go to the documentation of this file.
00001 #ifndef __ASF_GUI_LISTENERS__
00002 #define __ASF_GUI_LISTENERS__
00003 
00004 #include <undefined.h>
00005 #include <sdf-module-utils.tb>
00006 
00007 process LanguageFeatureMenuListener(Feature : str, Action : str, Info : str) is
00008 let
00009   Event: attribute-changed-event,
00010   ModuleId: module-id,
00011   Path: term,
00012   Menu: term,
00013   Modulename: str,
00014   FeatureModulename: str,
00015   Languagename: str,
00016   MenuName: str,
00017   OldValue: term,
00018   Pid: int,
00019   Tip: str
00020 in
00021   MM-Subscribe-Attribute-Changed(<module-id>,SDF_NAMESPACE,"status",identified,<term>) 
00022   .
00023   (
00024     rec-note(mm-attribute-changed(Event?))
00025     . ACE-GetModuleId(Event, ModuleId?)
00026     . MM-GetAttribute(ModuleId, SDF_NAMESPACE, "name", Modulename?)
00027     .
00028     if not-equal(Modulename, UNDEFINED) then
00029       ComputeFeatureModulename(Modulename, Feature, FeatureModulename?)
00030       .
00031       if equal(Modulename, FeatureModulename) then
00032          ModulenameBase(Modulename, MenuName?)
00033          . ComputeCanonicalLanguagename(Modulename, Languagename?)
00034          . Tip := concat(Info, concat(" using the equations of ", FeatureModulename))
00035      . Menu := quote(action([description(term-editor(Languagename),menu([label(MenuName),label(Feature)],Tip))],Action))
00036          . snd-msg(cm-remove-system-property(Menu))
00037      . snd-msg(cm-add-system-property(Menu))
00038          . create(LanguageFeatureRemoveListener(ModuleId, Menu), Pid?)
00039       else
00040         tau
00041       fi     
00042     else
00043       tau
00044     fi
00045   )
00046   *
00047   delta
00048 endlet
00049 
00050 toolbus(LanguageFeatureMenuListener("format", "PrettyPrintAction","Format this term"))
00051 toolbus(LanguageFeatureMenuListener("run", "RunAction","Reduce this term"))
00052 toolbus(LanguageFeatureMenuListener("debug", "DebugAction","Debug this term"))
00053 toolbus(LanguageFeatureMenuListener("check", "CheckAction","Check this term"))
00054 toolbus(LanguageFeatureMenuListener("extract", "ExtractAction","Extract data from this term"))
00055 toolbus(LanguageFeatureMenuListener("draw", "DrawAction","Display using Scalable Vestor Graphics"))
00056 toolbus(LanguageFeatureMenuListener("test", "TestAction","Run unit tests"))
00057 toolbus(LanguageFeatureMenuListener("display", "DisplayAction","Display a Swing GUI"))
00058 
00059 process LanguageFeatureRemoveListener(ModuleId: module-id, Property: term) is
00060   subscribe(mm-module-deleted(ModuleId))
00061   .
00062   (
00063     rec-note(mm-module-deleted(ModuleId))
00064     . snd-msg(cm-remove-system-property(Property))
00065   )
00066   *
00067   delta
00068 
00069 #endif

Generated on Fri Sep 12 13:16:07 2008 for asfsdf-meta by  doxygen 1.4.6