public enum Orientation extends Enum<Orientation>
An enumeration class that defines allowed values for the orientation of components.
A couple of components can have either horizontal or vertical orientation,
for instance sliders or splitters. This enumeration class defines the allowed
values for orientation attributes and provides methods for checking them or
converting them to Orientation
instances.
Enum Constant and Description |
---|
HORIZONTAL
Horizontal orientation.
|
VERTICAL
Vertical orientation.
|
Modifier and Type | Method and Description |
---|---|
static Orientation |
findOrientation(String value)
Tries to match the given string value with an
Orientation
instance. |
static Orientation |
getOrientation(String value)
Transforms the given string value into an instance of this enumeration
class.
|
static Orientation |
getOrientation(String value,
Orientation defaultOrientation)
Transforms the given string value into an instance of this enumeration
class, using the default
Orientation if the string value is
null. |
static Orientation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Orientation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Orientation HORIZONTAL
public static final Orientation VERTICAL
public static Orientation[] values()
for (Orientation c : Orientation.values()) System.out.println(c);
public static Orientation valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Orientation findOrientation(String value)
Orientation
instance. This method checks whether the passed in string corresponds to
the name of an enumeration literal (case does not matter when doing the
comparison). If a match is found, the corresponding Orientation
instance is returned. Otherwise, the result of this method is
null.value
- the value to be searched (case does not matter)Orientation
instance or nullpublic static Orientation getOrientation(String value, Orientation defaultOrientation) throws FormBuilderException
Orientation
if the string value is
null. This method tries to find a match for the given string. If
this is successful, the matching Orientation
instance is
returned. Otherwise, an exception is thrown. If the passed in string is
null and a default Orientation
is provided, then this
default value is returned. If the default Orientation
is
null, null input also leads to an exception.value
- the value to be searched (case does not matter)defaultOrientation
- the default Orientation
to be returned
for null stringsOrientation
FormBuilderException
- if no match is foundpublic static Orientation getOrientation(String value) throws FormBuilderException
getOrientation(String, Orientation)
method with a default
Orientation
of null; i.e. null input also causes an
exception.value
- the value to be searched (case does not matter)Orientation
FormBuilderException
- if no match is foundCopyright © 2016 The JGUIraffe Team. All rights reserved.