]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
- Back-arrow is added when the user selects the new product on the new study screen
authormka <mka@opencascade.com>
Mon, 6 May 2013 12:50:00 +0000 (12:50 +0000)
committermka <mka@opencascade.com>
Mon, 6 May 2013 12:50:00 +0000 (12:50 +0000)
- Left menu is updated when the last knowledge element is deleted
- Screen is updated after performing the "attach another format" operation

Workspace/Siman/WebContent/study/newStudy.jsp
Workspace/Siman/src/org/splat/simer/DocumentFacade.java
Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java

index 1d0148a26352825ef6794790bc4369ba63a9b699..bf04ebdaa6b3e3270751164828a669e0bef8e7d9 100644 (file)
                }
                create.projectContext.focus();
        }
+       
+    function setDefaultSelection() {
+        tds = document.getElementById("select");
+        tde = document.getElementById("enter");
+        tds.style.display = "block"; // Hides the select input
+        tde.style.display = "none"; // Displays the text input
+        
+        create.projectContextId.value = -1;
+        create.projectContextId.focus();
+    }
 
        $(document).ready(function() {
         <s:if test="projectContextValues.size > 0">
                    event.preventDefault();    //cross-browser solution
                }
            });
-           
-           function setDefaultSelection()(event) {
-            tds = document.getElementById("select");
-            tde = document.getElementById("enter");
-            tds.style.display = "block"; // Hides the select input
-            tde.style.display = "none"; // Displays the text input
-            
-               create.projectContextId.value = -1;
-               create.projectContextId.focus();
-               
-               //hide back button
-           }
        });
-    
-    
 </script>
 
 <!-- New study dialog
                                                                </s:iterator>
                                                        </optgroup>
                                        </select></td>
-                                       <td id="enter" style="display: none"><s:textfield
-                                                       theme="simple" size="30" name="projectContext" /></td>
+                                       <td id="enter" style="display: none">
+                                          <s:textfield theme="simple" size="30" name="projectContext" />
+                              <img src="<s:url value="/skin/icon.undo.png"/>" border="none" 
+                                      title="<s:text name="tooltip.cancel"/>"
+                                      onclick="setDefaultSelection()"/>
+                           </td>
                                </s:if>
                                <s:else>
                                        <td><s:hidden name="projectContextId" value="0" /> <s:textfield
index 260b2a32e85fef47ec62ffd09abe8b9e25d84876..8f9e1c6f123592d0dbcf5c869ab73540ab09e15e 100644 (file)
@@ -243,15 +243,7 @@ public class DocumentFacade implements HistoryFacade {
                                }
                        }
                        if (_exports == null) {
-                               List<Relation> relation = _mydoc
-                                               .getRelations(ConvertsRelation.class);
-
-                               _exports = new ArrayList<FileFacade>(relation.size());
-                               for (Iterator<Relation> i = relation.iterator(); i.hasNext();) {
-                                       ConvertsRelation export = (ConvertsRelation) i.next();
-                                       _exports.add(new FileFacade(export,
-                                                       getApplicationSettings()));
-                               }
+                               updateExports();
                        }
                        if (_history == null) {
                                if (_mydoc.getPreviousVersion() != null
@@ -263,6 +255,20 @@ public class DocumentFacade implements HistoryFacade {
                        _display = State.open;
                }
        }
+       
+       /**
+        * Update the list of export files.
+        */
+       private void updateExports() {
+               List<Relation> relations = _mydoc
+                               .getRelations(ConvertsRelation.class);
+
+               _exports = new ArrayList<FileFacade>(relations.size());
+               for (Relation rel : relations) {
+                       _exports.add(new FileFacade((ConvertsRelation)rel,
+                                       getApplicationSettings()));
+               }
+       }
 
        /**
         * Close the presentation tree partially.
@@ -509,7 +515,7 @@ public class DocumentFacade implements HistoryFacade {
                        _version = verstring.format(_version);
                _size = sizstring.format(_mydoc.getSourceFile().asFile().length() / 1000);
                _date = datstring.format(_mydoc.getLastModificationDate());
-
+               updateExports();
                // Refresh of the history in case of promotion
                if (_display == State.deepopen) {
                        _history.clear();
index 6d488e7a9f6db45d1ebeaa1aa6e6695af325688c..bfdb2d4384c74e347454f810d9801b2cf1cd3c9d 100644 (file)
@@ -118,10 +118,14 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
                KnowledgeElement kelm = scene.getKnowledgeElement(Integer
                                .valueOf(_myindex));
                getScenarioService().removeKnowledgeElement(scene, kelm); // The knowledge element necessarily exists
-
-               _openStudy.remove(kelm);
-               updateMenu();
-
+               
+               if (_selection == null) { // Opening a study just newed
+                       _selection = _openStudy.getSelection(); // Default selection
+               }
+               _openStudy = open(getStudyService().selectStudy(
+                               _openStudy.getIndex())); // Closes the previously open study
+               _openStudy.setSelection(_selection);
+               
                return SUCCESS;
        }