]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/jsp/menuitem.jsp
Salome HOME
5d01a89502acf01d0efb389438d444031671f5eb
[tools/siman.git] / Workspace / Siman / WebContent / jsp / menuitem.jsp
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2     pageEncoding="ISO-8859-1"
3 %>
4 <%@ page import="java.util.Iterator"%>
5 <%@ page import="org.splat.wapp.Menu"%>
6 <%@ page import="org.splat.wapp.MenuItem"%>
7 <%@ page import="org.splat.simer.Action"%>
8 <%@page import="com.opensymphony.xwork2.ActionContext"%>
9 <%@ taglib prefix="s" uri="/struts-tags"%>
10
11 <s:set var="menuname" value="leftMenuSettings.menuName" />
12   <s:set var="namespace" value="leftMenuSettings.menuNamespace" />
13
14 <!-- Display of the menu tab
15   -->
16   <div id="tab-bar">
17     <span id="tab-front">&nbsp;&nbsp;<s:text name="title.%{#menuname}"/>&nbsp;&nbsp;</span>
18   </div>
19   
20
21 <!-- Display of menu items
22   -->
23   <div id=menuitem-box>
24 <%
25     Action anAction = (Action)ActionContext.getContext().getActionInvocation().getAction();
26         Menu menu = anAction.getLeftMenuSettings().getMenu();
27     boolean submenu = false;
28     for (Iterator<MenuItem> listem = menu.asList().iterator(); listem.hasNext(); ) {
29         MenuItem item  = listem.next();
30         String   arrow = "image.hold.gif";
31
32         if (item.isSubItem()) {
33         if (!submenu) {
34           submenu = true;
35 %>        <div id="article-separator"></div>
36 <%      }
37         } else {                
38         if (submenu) {
39           submenu = false;
40 %>        <div id="article-separator"></div>
41 <%      }
42         if (item.isGroup()) {
43           if (item.isOpen()) arrow = "image.downarrow.png";
44           else               arrow = "image.rightarrow.png";
45         }
46       }
47       String name = item.getLabel();
48       String icon = item.getIcon();
49 %>        <div id="article-item" onMouseOver="this.style.backgroundImage='url(<s:url value="/skin/image.highlighted.png"/>)'" onMouseOut="this.style.backgroundImage='url(<s:url value="/skin/image.white.png"/>)'">
50           <table width=100% border=0 cellspacing=0 cellpadding=0 class=menu>
51             <tr height=22 valign=middle>
52               <s:set var="menulabel"><%=name%></s:set>
53               <s:set var="menuicon">/skin/<%=icon%></s:set>
54               <s:set var="menuarrow">/skin/<%=arrow%></s:set>
55 <%    if (item.isSelected()) {
56           if (icon != null) {
57 %>          <td background="<s:url value="/skin/image.highlighted.png"/>" width=20 align=center><img src="<s:url value="%{#menuicon}"/>" border="none" /></td>
58 <%        }
59 %>          <td background="<s:url value="/skin/image.highlighted.png"/>">&nbsp;<s:text name="%{#menulabel}"/></td>
60             <td background="<s:url value="/skin/image.highlighted.png"/>" width=20 align=right><img src="<s:url value="%{#menuarrow}"/>" border="none" /></td>
61 <%    } else {
62         if (icon != null) {
63 %>          <td width=20 align=center><img src="<s:url value="%{#menuicon}"/>" border="none" /></td>
64 <%      }
65         String href = item.getAction();
66         if (href != null) {
67                 String[] link = href.split("\\x3F");   // '?' character
68 %>          <s:set var="menulink"><%=link[0]%></s:set>
69             <s:url id="item" namespace="%{#namespace}" action="%{#menulink}">
70 <%        if (link.length > 1) {
71                   link = link[1].split("\\x26");       // '&' character
72                   for (int i=0; i<link.length; i++) {
73                           String[] param = link[i].split("=");
74 %>            <s:set var="menuitemparameter"><%=param[0]%></s:set>
75               <s:set var="menuitemvalue"><%=param[1]%></s:set>
76               <s:param name="%{#menuitemparameter}" value="%{#menuitemvalue}"/>
77 <%          }
78           }
79 %>          </s:url>
80             <td>&nbsp;<s:a href="%{#item}" cssClass="item"><s:text name="%{#menulabel}"/></s:a></td>
81 <%      } else {
82 %>          <td>&nbsp;<font color=#A1A192><s:text name="%{#menulabel}"/></font></td>
83 <%      }
84 %>          <td width=20 align=right><img src="<s:url value="%{#menuarrow}"/>" border="none" /></td>
85 <%    }
86 %>
87             </tr>
88           </table>
89           </div>
90 <%  }
91 %>  
92   </div>