/*
 * Copyright 2016 iserge.
 *
 * 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 org.cesiumjs.cs.datasources.properties;

import jsinterop.annotations.*;
import org.cesiumjs.cs.core.Color;
import org.cesiumjs.cs.core.JulianDate;

/**
 * @author Serge Silaev aka iSergio <s.serge.b@gmail.com>
 */
@JsType(isNative = true, namespace = "Cesium", name = "CallbackProperty")
public class CallbackProperty extends Property<Color> {
    @JsConstructor
    public CallbackProperty(Callback callback, boolean isConstant) {}

    /**
     * Sets the callback to be used.
     * @param callback The function to be called when the property is evaluated.
     * @param isConstant true when the callback function returns the same value every time, false if the value will change.
     */
    @JsMethod
    public native void setCallback(Callback callback, boolean isConstant);

    @JsFunction
    public interface Callback {
        /**
         * A function that returns the value of the property.
         * @param time The time for which to retrieve the value.
         * @param result The object to store the value into, if omitted, a new instance is created and returned.
         * @return The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.
         */
        Color function(@JsOptional JulianDate time, @JsOptional Color result);
    }
}

@@ -911,16 +911,19 @@
 Property
+%3CT%3E
  extends
@@ -932,21 +932,17 @@
 roperty%3C
-Color
+T
 %3E %7B%0A    
@@ -1334,32 +1334,35 @@
 allback(Callback
+%3CT%3E
  callback, boole
@@ -1423,16 +1423,19 @@
 Callback
+%3CT%3E
  %7B%0A     
@@ -1828,21 +1828,17 @@
         
-Color
+T
  functio
@@ -1839,28 +1839,16 @@
 unction(
-@JsOptional 
 JulianDa
@@ -1860,25 +1860,9 @@
 me, 
-@JsOptional Color
+T
  res

Move CallbackProperty from Color to T(template)