1 /*
   2  * Copyright (c) 2007, 2017 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package org.jemmy.interfaces;
  25 
  26 import java.util.List;
  27 import org.jemmy.control.Property;
  28 import org.jemmy.dock.Shortcut;
  29 
  30 /**
  31  * Interface for a control with one selected state among the number of them.
  32  * @param <STATE>
  33  * @author shura, KAM
  34  */
  35 public interface Selectable<STATE> extends TypeControlInterface<STATE> {
  36 
  37     /**
  38      *
  39      */
  40     public static final String STATES_PROP_NAME = "states";
  41     public static final String STATE_PROP_NAME = "state";
  42     
  43     /**
  44      * Returns all available states.
  45      * @return List of all states.
  46      */
  47     @Property(STATES_PROP_NAME)
  48     public List<STATE> getStates();
  49 
  50     /**
  51      * Returns currently selected state.
  52      * @return Selected state.
  53      */
  54     @Property(STATE_PROP_NAME)
  55     public STATE getState();
  56 
  57     /**
  58      * Returns Selector class instance that has methods to select state.
  59      * @return Selector class instance for the control.
  60      */
  61     @Shortcut
  62     public Selector<STATE> selector();
  63 
  64 }