/*
 * Copyright 2014 Corpuslinguistic working group Humboldt University Berlin.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package annis.gui.components.codemirror;

import annis.model.AqlParseError;
import com.vaadin.shared.ui.JavaScriptComponentState;
import java.util.LinkedList;
import java.util.List;
import java.util.TreeMap;

/**
 *
 * @author Thomas Krause <krauseto@hu-berlin.de>
 */
public class AqlCodeEditorState extends JavaScriptComponentState
{
  /** The current text of the editor **/
  public String text = "";
  /** The last string as sent by the client **/
  public String clientText = "";
  public String inputPrompt = "";
  public List<AqlParseError> errors = new LinkedList<>();
  public TreeMap<String, Integer> nodeMappings = new TreeMap<>();

}

@@ -767,16 +767,74 @@
 tState;%0A
+import java.io.Serializable;%0Aimport java.util.Comparator;%0A
 import j
@@ -1335,14 +1335,415 @@
 eeMap%3C%3E(
-);
+new StringComparator());%0A  %0A  /**%0A   * An explictly %7B@link Serializable%7D %7B@link Comparator%7D for strings.%0A   */%0A  private static class StringComparator implements Comparator%3CString%3E, Serializable%0A  %7B%0A%0A    @Override%0A    public int compare(String o1, String o2)%0A    %7B%0A      if(o1 == null %7C%7C o2 == null)%0A      %7B%0A        throw new NullPointerException();%0A      %7D%0A      return o1.compareTo(o2);%0A    %7D%0A    %0A  %7D
 %0A%0A%7D%0A

use an explicit serializable comparator for the map