]> SALOME platform Git repositories - tools/siman.git/blob
Salome HOME
bceee0ad5f9b9b5358844726619f855a17153dc7
[tools/siman.git] /
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2     pageEncoding="ISO-8859-1"
3 %>
4 <%@ taglib prefix="s" uri="/struts-tags"
5 %>
6 <%@ page import="java.util.List"%>
7 <%@ page import="java.util.Iterator"%>
8 <%@ page import="java.util.ResourceBundle"%>
9 <%@ page import="org.splat.simer.OpenObject"%>
10 <%@ page import="org.splat.simer.OpenStudy"%>
11 <%@ page import="org.splat.simer.KnowledgeElementFacade"%>
12 <%!
13     private enum Action { addKnowledge, renameKnowledge, editKnowledge };
14 %><%
15 //  Scriptlet implementation is required for displaying HTML contents of knowledge values which does not work with Struts tags
16           Action                             todo       = Action.valueOf(request.getParameter("action"));
17     String                             typenumber = request.getParameter("index");
18     OpenStudy                          study      = (OpenStudy)session.getAttribute("study.open");
19     List<OpenObject.KnowledgeIterator> knowlist   = study.getDisplayedKnowledges();
20     ResourceBundle                     locale     = ResourceBundle.getBundle("som");
21 %>
22 <s:url id="undo" namespace="/study" action="step-study"></s:url>
23
24 <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
25   <input type=hidden name=knowledgeType value="<%=typenumber%>">
26 <%
27     for (Iterator<OpenObject.KnowledgeIterator> knowtypes = knowlist.iterator(); knowtypes.hasNext(); ) {
28       OpenObject.KnowledgeIterator type = knowtypes.next();
29 %>
30   <tr height=20>
31     <td width=38%><%=locale.getString("type.knowledge." + type.getType())%></td>
32     <td width=62%><s:text name="label.description"/></td>
33   </tr>
34   <tr height=1 bgcolor=#AAAAAA><td colspan=7></td></tr>
35 <%
36       List<KnowledgeElementFacade> knowelms = type.getKnowledgeElements();
37       for (Iterator<KnowledgeElementFacade> iterator = knowelms.iterator(); iterator.hasNext(); ) {
38         KnowledgeElementFacade kelm = iterator.next();
39 %>
40   <tr height=20 valign=top>
41
42 <!--    Title
43   -->
44     <td>
45 <%      if (kelm.getPresentationState().equals("open")) {
46 %>          <img src="<s:url value="/skin/image.hold.gif"/>" border="none" width=18 height=12/>
47 <%      }%> <table cellpadding=0 cellspacing=0 border=0>
48               <tr>
49 <%
50         if (todo == Action.renameKnowledge && kelm.getIndex().equals(typenumber)) {
51 %>              <td width=18>
52                   <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
53                 </td>
54                 <td><input type=text size="35" name=knowledgeTitle value="<%=kelm.getTitle()%>"></td>
55 <%      } else
56               if (todo == Action.editKnowledge && kelm.getIndex().equals(typenumber)) {
57 %>              <td width=18>
58                   <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
59                 </td>
60                 <td><%=kelm.getTitle()%></td>
61 <%      } else {
62 %>              <td width=18>
63                   <s:set var="path">/skin/icon.<%=kelm.getProgressState()%>.png</s:set>
64                   <img src="<s:url value="%{#path}"/>" width=14 height=14 border="none" title=""/>
65                 </td>
66                 <td><%=kelm.getTitle()%></td>
67 <%      }
68 %>            </tr>
69             </table>
70     </td>
71
72 <!--    Value
73   -->
74         <td>
75           <table cellpadding=0 cellspacing=0 border=0>
76             <tr valign=top>
77 <%
78         if (todo == Action.editKnowledge && kelm.getIndex().equals(typenumber)) {
79 %>            <td>
80                 <input type=hidden name=text>
81                 <script language='JavaScript' type='text/javascript'>
82 <%        out.print("displayTextEditor('knowledgeValue', '" + kelm.getFullValue() + "', 450, 150);");
83 %>              </script>
84               </td>
85 <%      } else {
86 %>            <td background="<s:url value="/skin/image.vline.png"/>" width=20>
87 <%        if (kelm.getPresentationState().equals("open")) {
88 %>              <img src="<s:url value="/skin/image.hide.png"/>" border="none" width=20 height=12/>                
89 <%        }   %>  <img src="<s:url value="/skin/image.box.png"/>"  border="none" title=""/>
90               </td>
91               <td><%=kelm.getValue()%></td>
92 <%      }
93 %>          </tr>
94 <%      if (kelm.getPresentationState().equals("open")) {
95 %>          <tr height=8>
96               <td><img src="<s:url value="/skin/image.hline.png"/>" border="none" width=20 height=8 title=""/></td>
97             </tr>
98 <%      }
99 %>        </table>
100         </td>
101       </tr>
102 <%
103       }
104       if (todo == Action.addKnowledge && type.getIndex().equals(typenumber)) {
105 %>  <tr height=5><td></td></tr>
106     <tr valign=top>
107       <td>
108         <table cellpadding=0 cellspacing=0 border=0>
109           <tr>
110             <td width=18>
111               <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
112             </td>
113             <td><input type=text size="35" name=knowledgeTitle></td>
114           </tr>
115         </table>
116       </td>
117       <td>
118         <input type=hidden name=text>
119         <script language='JavaScript' type='text/javascript'>
120 <%        out.print("displayTextEditor('knowledgeValue', '<p>&nbsp;</p>', 450, 150);");
121 %>      </script>
122       </td>
123     </tr>
124     <tr height=4><td></td></tr>
125 <%    }
126       else {
127 %>  <tr height=30><td></td></tr>
128 <%    }
129     }
130 %>  <tr height=30 valign=middle><td></td></tr>
131
132 </table>