All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.extjs.gxt.ui.client.widget.form.TimeField Maven / Gradle / Ivy

The newest version!
/*
 * Sencha GXT 2.3.1 - Sencha for GWT
 * Copyright(c) 2007-2013, Sencha, Inc.
 * [email protected]
 * 
 * http://www.sencha.com/products/gxt/license/
 */
 package com.extjs.gxt.ui.client.widget.form;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.util.DateWrapper;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.Element;

/**
 * Provides a time input field with a time dropdown and automatic time
 * validation.
 * 
 * 

* The model used by TimeField is @link {@link Time}. An instance of Time is * used with {@link #setValue} and {@link #getValue}. Use * {@link #setDateValue(Date)} and {@link #getDateValue()} to work with Dates. * When using dates, the Time instance will match exact matches of hours and * Minutes and will match times between to entries. * * Code Snippet. * *

 * TimeField field = new TimeField();
 * 
 * DateWrapper wrap = new DateWrapper(1970, 1, 1);
 * wrap = wrap.clearTime();
 * wrap = wrap.addHours(4);
 * 
 * field.setMinValue(wrap.asDate());
 * field.setDateValue(new Date());
 * 
 * Time time = field.getValue();
 * Date d = time.getDate();
 * 
 * Time match = field.findModel(new Date());
 * field.setValue(match);
 * 
* *
*
Events:
* *
Expand : FieldEvent(field)
*
Fires when the dropdown list is expanded.
*
    *
  • field : this
  • *
*
* *
Collapse : FieldEvent(field)
*
Fires when the dropdown list is collapsed.
*
    *
  • field : this
  • *
*
* *
BeforeSelect : FieldEvent(field)
*
Fires before a list item is selected.
*
    *
  • component : this
  • *
*
* *
Select : FieldEvent(field)
*
Fires when a list item is selected.
*
    *
  • field : this
  • *
*
*
* *
*
Inherited Events:
*
Field Focus
*
Field Blur
*
Field Change
*
Field Invalid
*
Field Valid
*
Field KeyPress
*
Field SpecialKey
*
TriggerField TriggerClick
*
* * @see Time */ @SuppressWarnings("deprecation") public class TimeField extends ComboBox




© 2015 - 2025 Weber Informatics LLC | Privacy Policy