< prev index next >

apps/samples/Ensemble8/src/app/java/ensemble/SearchPopover.java

Print this page
rev 9898 : 8178275: Ensemble: Upgrade version of Lucene to 7.1.0
Reviewed-by: aghaisas, prr
   1 /*
   2  * Copyright (c) 2008, 2014, Oracle and/or its affiliates.
   3  * All rights reserved. Use is subject to license terms.
   4  *
   5  * This file is available and licensed under the following license:
   6  *
   7  * Redistribution and use in source and binary forms, with or without
   8  * modification, are permitted provided that the following conditions
   9  * are met:
  10  *
  11  *  - Redistributions of source code must retain the above copyright
  12  *    notice, this list of conditions and the following disclaimer.
  13  *  - Redistributions in binary form must reproduce the above copyright
  14  *    notice, this list of conditions and the following disclaimer in
  15  *    the documentation and/or other materials provided with the distribution.
  16  *  - Neither the name of Oracle Corporation nor the names of its
  17  *    contributors may be used to endorse or promote products derived
  18  *    from this software without specific prior written permission.
  19  *
  20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR


  25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31  */
  32 package ensemble;
  33 
  34 
  35 import ensemble.control.Popover;
  36 import ensemble.control.SearchBox;
  37 import ensemble.search.DocumentType;
  38 import ensemble.search.IndexSearcher;
  39 import ensemble.search.SearchResult;
  40 import java.util.EnumMap;
  41 import java.util.List;
  42 import java.util.Map;
  43 import javafx.animation.KeyFrame;
  44 import javafx.animation.Timeline;
  45 import javafx.beans.value.ChangeListener;
  46 import javafx.beans.value.ObservableValue;
  47 import javafx.event.ActionEvent;
  48 import javafx.event.EventHandler;
  49 import javafx.geometry.Point2D;
  50 import javafx.scene.control.Tooltip;
  51 import javafx.scene.input.KeyCode;
  52 import javafx.scene.input.KeyEvent;
  53 import javafx.util.Duration;
  54 import org.apache.lucene.queryParser.ParseException;
  55 
  56 
  57 /**
  58  * Implementation of popover to show search results
  59  */
  60 public class SearchPopover extends Popover {
  61     private final SearchBox searchBox;
  62     private final PageBrowser pageBrowser;
  63     private IndexSearcher indexSearcher;
  64     private Tooltip searchErrorTooltip = null;
  65     private Timeline searchErrorTooltipHidder = null;
  66     private SearchResultPopoverList searchResultPopoverList;
  67 
  68     public SearchPopover(final SearchBox searchBox, PageBrowser pageBrowser) {
  69         super();
  70         this.searchBox = searchBox;
  71         this.pageBrowser = pageBrowser;
  72         getStyleClass().add("right-tooth");
  73         setPrefWidth(600);
  74 


   1 /*
   2  * Copyright (c) 2008, 2017, Oracle and/or its affiliates.
   3  * All rights reserved. Use is subject to license terms.
   4  *
   5  * This file is available and licensed under the following license:
   6  *
   7  * Redistribution and use in source and binary forms, with or without
   8  * modification, are permitted provided that the following conditions
   9  * are met:
  10  *
  11  *  - Redistributions of source code must retain the above copyright
  12  *    notice, this list of conditions and the following disclaimer.
  13  *  - Redistributions in binary form must reproduce the above copyright
  14  *    notice, this list of conditions and the following disclaimer in
  15  *    the documentation and/or other materials provided with the distribution.
  16  *  - Neither the name of Oracle Corporation nor the names of its
  17  *    contributors may be used to endorse or promote products derived
  18  *    from this software without specific prior written permission.
  19  *
  20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR


  25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31  */
  32 package ensemble;
  33 
  34 
  35 import ensemble.control.Popover;
  36 import ensemble.control.SearchBox;
  37 import ensemble.search.DocumentType;
  38 import ensemble.search.IndexSearcher;
  39 import ensemble.search.SearchResult;
  40 import java.util.EnumMap;
  41 import java.util.List;
  42 import java.util.Map;
  43 import javafx.animation.KeyFrame;
  44 import javafx.animation.Timeline;

  45 import javafx.beans.value.ObservableValue;
  46 import javafx.event.ActionEvent;

  47 import javafx.geometry.Point2D;
  48 import javafx.scene.control.Tooltip;
  49 import javafx.scene.input.KeyCode;
  50 import javafx.scene.input.KeyEvent;
  51 import javafx.util.Duration;
  52 import org.apache.lucene.queryparser.classic.ParseException;
  53 
  54 
  55 /**
  56  * Implementation of popover to show search results
  57  */
  58 public class SearchPopover extends Popover {
  59     private final SearchBox searchBox;
  60     private final PageBrowser pageBrowser;
  61     private IndexSearcher indexSearcher;
  62     private Tooltip searchErrorTooltip = null;
  63     private Timeline searchErrorTooltipHidder = null;
  64     private SearchResultPopoverList searchResultPopoverList;
  65 
  66     public SearchPopover(final SearchBox searchBox, PageBrowser pageBrowser) {
  67         super();
  68         this.searchBox = searchBox;
  69         this.pageBrowser = pageBrowser;
  70         getStyleClass().add("right-tooth");
  71         setPrefWidth(600);
  72 


< prev index next >