/*******************************************************************************
 * Copyright 2014, 2016 gwt-ol3
 *
 * 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 ol.interaction;

import javax.annotation.Nullable;

import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import ol.Collection;
import ol.Feature;
import ol.MapBrowserEvent;

/**
 * Interaction for selecting vector features. By default, selected features are
 * styled differently, so this interaction can be used for visual highlighting,
 * as well as selecting features for other actions, such as modification or output.
 * There are three ways of controlling which features are selected:
 * 	using the browser event as defined by the condition and optionally the toggle, add/remove, and multi options;
 * 	a layers filter;
 * 	and a further feature filter using the filter option.
 *
 * Selected features are added to an internal unmanaged layer.
 *
 * @author Tino Desjardins
 *          19-05-2016.
 */
@JsType(isNative = true)
public class Select extends Interaction {

    public Select() {}
    
    public Select(SelectOptions selectOptions) {}
    
    @JsProperty
    public native void setOptions(SelectOptions options);

	public native Collection<Feature> getFeatures();
	
	/**
	 * Events emitted by {@link Select} instances are instances of this type.
	 * 
	 * @author Tino Desjardins
	 *
	 */
	@JsType(isNative = true)
	public interface Event extends ol.events.Event {
	    
	    @Nullable
	    @JsProperty
	    public Feature[] getSelected();
	    
	    @Nullable
	    @JsProperty
	    public Feature[] getDeselected();
	    
	    @JsProperty	    
	    public MapBrowserEvent getMapBrowserEvent();
	}

}

@@ -96,17 +96,17 @@
 014, 201
-6
+8
  gwt-ol3
@@ -1672,29 +1672,25 @@
 Select() %7B%7D%0A
-    
 %0A
+
     public S
@@ -1727,21 +1727,17 @@
 ons) %7B%7D%0A
-    
 %0A
+
     @JsP
@@ -1803,17 +1803,20 @@
 ions);%0A%0A
-%09
+    
 public n
@@ -1860,16 +1860,21 @@
 ();%0A
-%09%0A%09/**%0A%09
+%0A    /**%0A    
  * E
@@ -1947,14 +1947,19 @@
 pe.%0A
-%09 * %0A%09
+     *%0A    
  * @
@@ -1985,18 +1985,27 @@
 ins%0A
-%09 *%0A%09 */%0A%09
+     *%0A     */%0A    
 @JsT
@@ -2025,17 +2025,20 @@
 = true)%0A
-%09
+    
 public i
@@ -2078,23 +2078,21 @@
 Event %7B%0A
-%09
+%0A
     
-%0A%09
     @Nul
@@ -2089,37 +2089,40 @@
       @Nullable%0A
-%09
+   
     
+ 
 @JsProperty%0A%09   
@@ -2109,33 +2109,36 @@
     @JsProperty%0A
-%09
+    
     public Featu
@@ -2153,31 +2153,29 @@
 Selected();%0A
-%09
+%0A
     
-%0A%09
     @Nullabl
@@ -2176,17 +2176,20 @@
 ullable%0A
-%09
+    
     @JsP
@@ -2196,17 +2196,20 @@
 roperty%0A
-%09
+    
     publ
@@ -2238,23 +2238,21 @@
 cted();%0A
-%09
+%0A
     
-%0A%09
     @JsP
@@ -2262,15 +2262,13 @@
 erty
-%09
+%0A
     
-%0A%09
     
@@ -2312,14 +2312,17 @@
 vent();%0A
-%09
+    
 %7D%0A%0A%7D%0A

Format code