Salome HOME
Create new scenario from existing one is improved
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / KnowledgeElementFacade.java
index 2564f2975fef00a51b2736c8e5c5f9cefc98a2e7..9c1787c7c4f081d031023be70189659985814991 100644 (file)
@@ -9,6 +9,10 @@ public class KnowledgeElementFacade {
        private transient State _state;
        private transient String _value;
        private transient PopupMenu _popup;
+       /**
+        * Injected application settings service.
+        */
+       private ApplicationSettings _applicationSettings;
 
        private enum State {
                closed, open
@@ -18,9 +22,11 @@ public class KnowledgeElementFacade {
        // Constructor
        // ==============================================================================================================================
 
-       public KnowledgeElementFacade(final KnowledgeElementDTO represented) {
+       public KnowledgeElementFacade(final KnowledgeElementDTO represented,
+                       final ApplicationSettings app) {
                _my = represented;
                _state = State.closed;
+               setApplicationSettings(app);
 
                this.refresh(); // Initializes the presentation of my knowledge
        }
@@ -106,7 +112,7 @@ public class KnowledgeElementFacade {
        private void refresh() {
                String[] tags = { "<b>", "<i>", "<u>", "<sup>", "<sub>" };
 
-               _popup = ApplicationSettings.getPopupMenu("feedbex");
+               _popup = getApplicationSettings().getPopupMenu("feedbex");
                _value = _my.getValue();
 
                // One line extract of the knowledge value
@@ -211,4 +217,24 @@ public class KnowledgeElementFacade {
                }
                return res;
        }
+
+       /**
+        * Get the applicationSettings.
+        * 
+        * @return the applicationSettings
+        */
+       public ApplicationSettings getApplicationSettings() {
+               return _applicationSettings;
+       }
+
+       /**
+        * Set the applicationSettings.
+        * 
+        * @param applicationSettings
+        *            the applicationSettings to set
+        */
+       private void setApplicationSettings(
+                       final ApplicationSettings applicationSettings) {
+               _applicationSettings = applicationSettings;
+       }
 }
\ No newline at end of file