- java.lang.Object
-
- javax.accessibility.AccessibleStateSet
-
public class AccessibleStateSet extends Object
Class AccessibleStateSet determines a component's state set. The state set of a component is a set of AccessibleState objects and descriptions. E.G., The current overall state of the object, such as whether it is enabled, has focus, etc.- See Also:
AccessibleState
-
-
Field Summary
Fields Modifier and Type Field and Description protected Vector<AccessibleState>
states
Each entry in the Vector represents an AccessibleState.
-
Constructor Summary
Constructors Constructor and Description AccessibleStateSet()
Creates a new empty state set.AccessibleStateSet(AccessibleState[] states)
Creates a new state with the initial set of states contained in the array of states passed in.
-
Method Summary
Methods Modifier and Type Method and Description boolean
add(AccessibleState state)
Adds a new state to the current state set if it is not already present.void
addAll(AccessibleState[] states)
Adds all of the states to the existing state set.void
clear()
Removes all the states from the current state set.boolean
contains(AccessibleState state)
Checks if the current state is in the state set.boolean
remove(AccessibleState state)
Removes a state from the current state set.AccessibleState[]
toArray()
Returns the current state set as an array of AccessibleStateString
toString()
Creates a localized String representing all the states in the set using the default locale.
-
-
-
Field Detail
-
states
protected Vector<AccessibleState> states
Each entry in the Vector represents an AccessibleState.
-
-
Constructor Detail
-
AccessibleStateSet
public AccessibleStateSet()
Creates a new empty state set.
-
AccessibleStateSet
public AccessibleStateSet(AccessibleState[] states)
Creates a new state with the initial set of states contained in the array of states passed in. Duplicate entries are ignored.- Parameters:
states
- an array of AccessibleState describing the state set.
-
-
Method Detail
-
add
public boolean add(AccessibleState state)
Adds a new state to the current state set if it is not already present. If the state is already in the state set, the state set is unchanged and the return value is false. Otherwise, the state is added to the state set and the return value is true.- Parameters:
state
- the state to add to the state set- Returns:
- true if state is added to the state set; false if the state set is unchanged
-
addAll
public void addAll(AccessibleState[] states)
Adds all of the states to the existing state set. Duplicate entries are ignored.- Parameters:
states
- AccessibleState array describing the state set.
-
remove
public boolean remove(AccessibleState state)
Removes a state from the current state set. If the state is not in the set, the state set will be unchanged and the return value will be false. If the state is in the state set, it will be removed from the set and the return value will be true.- Parameters:
state
- the state to remove from the state set- Returns:
- true if the state is in the state set; false if the state set will be unchanged
-
clear
public void clear()
Removes all the states from the current state set.
-
contains
public boolean contains(AccessibleState state)
Checks if the current state is in the state set.- Parameters:
state
- the state- Returns:
- true if the state is in the state set; otherwise false
-
toArray
public AccessibleState[] toArray()
Returns the current state set as an array of AccessibleState- Returns:
- AccessibleState array containing the current state.
-
toString
public String toString()
Creates a localized String representing all the states in the set using the default locale.- Overrides:
toString
in classObject
- Returns:
- comma separated localized String
- See Also:
AccessibleBundle.toDisplayString(java.lang.String, java.util.Locale)
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
05/11/2024 15:51:21 Cette version de la page est en cache (à la date du 05/11/2024 15:51:21) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/accessibility/AccessibleStateSet.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.