1 /**
2 * Copyright 2014 Juan Heyns. All rights reserved.
3 * <p/>
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 * <p/>
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 * <p/>
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * <p/>
14 * THIS SOFTWARE IS PROVIDED BY JUAN HEYNS ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JUAN HEYNS OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 * <p/>
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of Juan Heyns.
27 */
28 package fr.ifremer.quadrige3.ui.swing.component.date.constraints;
29
30 /*
31 * #%L
32 * Reef DB :: UI
33 * $Id:$
34 * $HeadURL:$
35 * %%
36 * Copyright (C) 2014 - 2015 Ifremer
37 * %%
38 * This program is free software: you can redistribute it and/or modify
39 * it under the terms of the GNU Affero General Public License as published by
40 * the Free Software Foundation, either version 3 of the License, or
41 * (at your option) any later version.
42 *
43 * This program is distributed in the hope that it will be useful,
44 * but WITHOUT ANY WARRANTY; without even the implied warranty of
45 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 * GNU General Public License for more details.
47 *
48 * You should have received a copy of the GNU Affero General Public License
49 * along with this program. If not, see <http://www.gnu.org/licenses/>.
50 * #L%
51 */
52
53 import fr.ifremer.quadrige3.ui.swing.component.date.DateModel;
54
55 /**
56 * This interface provides a callback function to limit the selection of a date from the picker and panel.
57 *
58 * @author Frankenberger Simon
59 */
60 public interface DateSelectionConstraint {
61
62 /**
63 * Check the models value to be a valid, selectable date.
64 *
65 * @param model The model to check
66 * @return <code>true</code> if the models value is valid, else returns
67 * <code>false</code>
68 */
69 boolean isValidSelection(DateModel model);
70
71 }