<%--
$Id$
CDDL HEADER START
The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.
See LICENSE.txt included in this distribution for the specific
language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at LICENSE.txt.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]
CDDL HEADER END
Copyright 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Portions Copyright 2011 Jens Elkner.
--%><%
/* ---------------------- menu.jspf start --------------------- */
{
// PageConfig cfg = PageConfig.get(request);
List<Project> projects = cfg.getConfig().getProjects();
if (projects == null) {
projects = new ArrayList<Project>(0);
}
TreeMap<String, String> pMap = new TreeMap<String, String>();
QueryBuilder queryParams = cfg.getQueryBuilder();
if (projects.size() != 0) {
for (Project p : projects) {
String name = p.getDescription();
String esc = Util.formQuoteEscape(p.getDescription());
pMap.put(name, esc);
}
%>
<script type="text/javascript">/* <![CDATA[ */
O.projects = <%
Util.writeJsonArray(out, null, cfg.getRequestedProjects());
%>;O.xrefPath = '<%= request.getContextPath() + Prefix.XREF_P
%>';O.domReady.push(O.domReadyMenu);
/* ]]> */
</script><%
}
%>
<form action="<%= request.getContextPath() + Prefix.SEARCH_P %>" id="sbox">
<div id="qtbl">
<table>
<tr>
<td><label for="q">Full&nbsp;Search</label></td>
<td><input tabindex="1" class="q" name="q" id="q" value="<%=
Util.formQuoteEscape(queryParams.getFreetext()) %>"/></td>
</tr>
<tr>
<td><label for="defs">Definition</label></td>
<td><input tabindex="2" class="q" name="defs" id="defs" value="<%=
Util.formQuoteEscape(queryParams.getDefs()) %>"/></td>
</tr>
<tr>
<td><label for="refs">Symbol</label></td>
<td><input tabindex="3" class="q" name="refs" id="refs" value="<%=
Util.formQuoteEscape(queryParams.getRefs()) %>"/></td>
</tr>
<tr>
<td><label for="path">File&nbsp;Path</label></td>
<td><input tabindex="4" class="q" name="path" id="path" value="<%=
Util.formQuoteEscape(queryParams.getPath()) %>"/></td>
</tr>
<tr>
<td><label for="hist">History</label></td>
<td><input tabindex="5" class="q" name="hist" id="hist" value="<%=
Util.formQuoteEscape(queryParams.getHist()) %>"/></td>
</tr>
<%-- TODO Bug 11749 --%>
</table>
</div><%
if (projects.size() != 0) {
%>
<div id="ptbl">
<p><label for="project">In Project(s)</label> <button
tabindex="6" id="selectAllProjects" type="button">select all</button>&nbsp;<button
tabindex="7" id="invertAllProjects" type="button">invert selection</button> </p>
<select tabindex="8" class="q" id="project"
name="project" multiple="multiple" size="<%=
Math.min(6, projects.size()) %>"><%
SortedSet<String> pRequested = cfg.getRequestedProjects();
for (Entry<String,String> e : pMap.entrySet()) {
// TODO below "selected" has no effect if one refreshes the page
// with F5 also below ondblclick doesn't work in IE ...
// ondblclick="javascript:goFirstProject();"
%>
<option value="<%= Util.formQuoteEscape(e.getValue()) %>"<%
if (pRequested.contains(e.getKey())) {
%> selected="selected"<%
}
%>><%= Util.htmlize(e.getValue()) %></option><%
}
%>
</select>
</div><%
}
%>
<p><button
tabindex="9" class="submit" type="submit">Search</button><button
tabindex="10" id="clearSearchBox" class="submit" type="button">Clear</button><button
tabindex="11" id="helpButton" class="help">Help</button>
</p>
</form>
<%
}
/* ---------------------- menu.jspf end --------------------- */
%>