Commits

Todor Todorov committed 08db6a7

implemented keyboardefault options

  • Participants
  • Parent commits f9cdb09

Comments (0)

Files changed (3)

gwt-openlayers-client/src/main/java/org/gwtopenmaps/openlayers/client/control/KeyboardDefaultOptions.java

+/**
+ *
+ */
+package org.gwtopenmaps.openlayers.client.control;
+
+import com.google.gwt.user.client.Element;
+
+/**
+ * @author Todor Todorov
+ *
+ */
+public class KeyboardDefaultOptions extends ControlOptions
+{
+
+
+    /**
+     *  Activate the control when it is added to a map.  Default is true.
+     */
+    public void setAutoActivate(boolean activate)
+    {
+        getJSObject().setProperty("autoActivate", activate);
+    }
+
+    /**
+     * Pixels to slide by.
+     */
+    public void setSlideFactor(int pixels) {
+        getJSObject().setProperty("slideFactor", pixels);
+    }
+
+    /**
+     * The DOM element to handle keys for.
+     */
+    public void setObserveElement(Element element) {
+        getJSObject().setProperty("observeElement", element);
+    }
+
+    /**
+     * The element Id to handle keys for.
+     */
+	public void setObserveElement(String id) {
+        getJSObject().setProperty("observeElement", id);
+	}
+
+}

gwt-openlayers-client/src/main/java/org/gwtopenmaps/openlayers/client/control/KeyboardDefaults.java

 		this(KeyboardDefaultsImpl.create());
 	}
 
+	public KeyboardDefaults(KeyboardDefaultOptions keyboardDefaultOptions) {
+		this(KeyboardDefaultsImpl.create(keyboardDefaultOptions.getJSObject()));
+	}
+
 }

gwt-openlayers-client/src/main/java/org/gwtopenmaps/openlayers/client/control/KeyboardDefaultsImpl.java

 import org.gwtopenmaps.openlayers.client.util.JSObject;
 
 /**
- * 
+ *
  *
  * @author Martin Hultman - Swedish Meteorological and Hydrological Institute
  *
 		return new $wnd.OpenLayers.Control.KeyboardDefaults();
 	}-*/;
 
+	public static native JSObject create(JSObject options)/*-{
+		return new $wnd.OpenLayers.Control.KeyboardDefaults(options);
+	}-*/;
+
 }