/*
 * Copyright (c) 2008-2016 Haulmont.
 *
 * 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 com.haulmont.cuba.gui.components;

import com.google.common.reflect.TypeToken;

import java.sql.Date;
import java.time.LocalTime;
import java.time.OffsetTime;

/**
 * todo
 *
 * @param <V>
 */
public interface TimeField<V> extends Field<V>, HasDatatype<V>, Buffered, Component.Focusable {
    String NAME = "timeField";

    TypeToken<TimeField<Date>> TYPE_DEFAULT = new TypeToken<TimeField<Date>>(){};

    TypeToken<TimeField<java.sql.Time>> TYPE_TIME = new TypeToken<TimeField<java.sql.Time>>(){};
    TypeToken<TimeField<LocalTime>> TYPE_LOCALTIME = new TypeToken<TimeField<LocalTime>>(){};
    TypeToken<TimeField<OffsetTime>> TYPE_OFFSETTIME = new TypeToken<TimeField<OffsetTime>>(){};

    enum Resolution {
        SEC,
        MIN,
        HOUR
    }

    /**
     * Return resolution of the TimeField.
     *
     * @return Resolution
     */
    Resolution getResolution();

    /**
     * Set resolution of the TimeField.
     *
     * @param resolution resolution
     */
    void setResolution(Resolution resolution);

    @Deprecated
    boolean getShowSeconds();

    /**
     * @deprecated Use either {@link #setResolution(Resolution)} or {@link #setFormat(String)}
     */
    @Deprecated
    void setShowSeconds(boolean showSeconds);

    String getFormat();

    void setFormat(String timeFormat);
}
@@ -777,12 +777,63 @@
 %0A * 
-todo
+A time entry component, which displays the actual time.
 %0A *%0A
@@ -845,16 +845,30 @@
 aram %3CV%3E
+ type of value
 %0A */%0Apub
@@ -1453,16 +1453,21 @@
 * Return
+s the
  resolut
@@ -1580,16 +1580,21 @@
    * Set
+s the
  resolut
@@ -1722,249 +1722,741 @@
     
-@Deprecated%0A    boolean getShowSeconds();%0A%0A    /**%0A     * @deprecated Use either %7B@link #setResolution(Resolution)%7D or %7B@link #setFormat(String)%7D%0A     */%0A    @Deprecated%0A    void setShowSeconds(boolean showSeconds);%0A%0A    String getFormat();%0A
+/**%0A     * @return whether the TimeField should display seconds%0A     *%0A     * @deprecated Use either %7B@link #getResolution()%7D or %7B@link #getFormat()%7D%0A     */%0A    @Deprecated%0A    boolean getShowSeconds();%0A%0A    /**%0A     * Sets whether the TimeField should display seconds.%0A     *%0A     * @deprecated Use either %7B@link #setResolution(Resolution)%7D or %7B@link #setFormat(String)%7D%0A     */%0A    @Deprecated%0A    void setShowSeconds(boolean showSeconds);%0A%0A    /**%0A     * Returns the time format of the TimeField.%0A     *%0A     * @return time format%0A     */%0A    String getFormat();%0A%0A    /**%0A     * Sets the time format of the TimeField. It can be either a format string, or a key in message pack.%0A     *%0A     * @param timeFormat time format%0A     */
 %0A   

Add JavaDoc for TimeField #2463