2 /*******************************************************************************
3 * Copyright (c) 2012-2014 University of Stuttgart.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * and the Apache License 2.0 which both accompany this distribution,
7 * and are available at http://www.eclipse.org/legal/epl-v10.html
8 * and http://www.apache.org/licenses/LICENSE-2.0
11 * Oliver Kopp - initial API and implementation and/or initial documentation
12 *******************************************************************************/
14 <%@tag description="Dialog parts for choosing a QName" pageEncoding="UTF-8"%>
16 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
17 <%@taglib prefix="wc" uri="http://www.eclipse.org/winery/functions"%>
19 <%@attribute name="allQNames" required="true" type="java.util.Collection" description="Collection<QName> of all available QNames" %>
20 <%@attribute name="includeNONE" required="false" type="java.lang.Boolean" description="Should (none) be included as option?"%>
21 <%@attribute name="selected" required="false" description="The initial value to select"%>
22 <%@attribute name="labelOfSelectField" required="true"%>
23 <%@attribute name="idOfSelectField" required="true"%>
25 <div class="form-group">
26 <c:if test="${not empty labelOfSelectField}"><label for="${idOfSelectField}" class="control-label">${labelOfSelectField}:</label></c:if>
27 <select id="${idOfSelectField}" name="${idOfSelectField}" class="form-control">
28 <c:if test="${includeNONE}"><option value="(none)">(none)</option></c:if>
29 <c:forEach var="namespaceEntry" items="${wc:convertQNameListToNamespaceToLocalNameList(allQNames)}">
30 <optgroup label="${namespaceEntry.key}">
31 <c:forEach var="localName" items="${namespaceEntry.value}">
32 <option value="{${namespaceEntry.key}}${localName}">${localName}</option>
41 $("#${idOfSelectField}").select2();
42 <c:if test="${not empty selected}">
43 $("#${idOfSelectField}").select2("val", "${selected}");