From: Jean-Marc V. <jea...@gm...> - 2012-03-29 10:55:02
|
Hi With Revision 2980<http://eulergui.svn.sourceforge.net/viewvc/eulergui?view=revision&revision=2980>, the extension point capabilities of EulerGUI are used for real. Now the result display features are set by N3 configuration rules in src/main/resources/eulergui/gui/controller/application-rules.n3<http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/src/main/resources/eulergui/gui/controller/application-rules.n3> These result display features are displayed by 4 buttons on upper right corner of main window, and are implemented by there classes: ResultEditorAction, ResultEditorN3Action, ResultGraphvizAction, ResultTableAction There is just one rule to configure these features : { ?GUI a java:n3_project-ProjectGUI ; javap:resultManagement ?R . } => { ?ResultEditorAction a java:eulergui-gui-actions-ResultEditorAction ; javam:setProjectGUI( ?GUI ). ?ResultEditorN3Action a java:eulergui-gui-actions-ResultEditorN3Action ; javam:setProjectGUI( ?GUI ). ?ResultGraphvizAction a java:eulergui-gui-actions-ResultGraphvizAction ; javam:setProjectGUI( ?GUI ). ?ResultTableAction a java:eulergui-gui-actions-ResultTableAction ; javam:setProjectGUI( ?GUI ). ?R javam:addAction ( ?ResultEditorAction ) ; javam:addAction ( ?ResultEditorN3Action ) ; javam:addAction ( ?ResultGraphvizAction ) ; javam:addAction ( ?ResultTableAction ) }. This rule says : "for each main window ProjectGUI, with a field resultManagement ?R, create the 4 objects ?ResultEditorAction , etc, and add them to ?R through method addAction". The method addAction on class ResultManagement is just one of 10 extension points that are planned : http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/architecture.html#L762 In the Roadmap for EulerGUI 2.0 : http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/documentation.html#L9989 this task is described this way : Features and code changes CommentsEstimate (skilled developper) Sub-feature *extension points* for adding features in N3 configuration filewill also enable many things: user defined extensions point à la eclipse; several user modes ; this will also be similar to Spring configuration, but with possibly platform and context -aware rules here; estimation just for creating interfaces and containers in Java2new N3 sources types: RDFa, ATTEMPTO sentences, ng4j / semweb client<http://www4.wiwiss.fu-berlin.de/bizer/ng4j/semwebclient/> Note that the main architectural advantage of extensions point à la eclipse<http://wiki.eclipse.org/FAQ_What_are_extensions_and_extension_points%3F>is to be able to add a feature without modifying a line in the Java code. But here, contrary to Spring or eclipse stuff, we have the whole power of rules here: it is possible to take in account machine and user context and history. This mechanism is usable also in applications built with the EulerGUI framework<http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/documentation.html#L7038> . CAVEAT: - no support for checking Java methods and classes is provided in EulerGUI editor, and error here raise Drools compliation errors that are not user-friendly - the above rule N3 file is accessible to EulerGUI through the classpath, so to modify the internal rules, one must rebuild EulerGUI (or work in eclipse). -- Jean-Marc Vanel Déductions SARL - Consulting, services, training, Rule-based programming, Semantic Web http://jmvanel.free.fr/ - EulerGUI, a turntable GUI for Semantic Web + rules, XML, UML, eCore, Java bytecode +33 (0)6 89 16 29 52 chat : irc://irc.freenode.net#eulergui |