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

org.webswing.toolkit.FocusEventCause Maven / Gradle / Ivy

There is a newer version: 20.2.4
Show newest version
package org.webswing.toolkit;

public enum FocusEventCause {

	UNKNOWN,
	MOUSE_EVENT,
	TRAVERSAL,
	TRAVERSAL_UP,
	TRAVERSAL_DOWN,
	TRAVERSAL_FORWARD,
	TRAVERSAL_BACKWARD,
	MANUAL_REQUEST,
	AUTOMATIC_TRAVERSE,
	ROLLBACK,
	NATIVE_SYSTEM,
	ACTIVATION,
	CLEAR_GLOBAL_FOCUS_OWNER,
	RETARGETED;

	public static FocusEventCause getValue(Enum enumvalue) {
		if (enumvalue == null) {
			return null;
		} else {
			try {
				return valueOf(enumvalue.name());
			} catch (IllegalArgumentException e) {
				return null;
			}
		}
	}

	public static > Enum convert(FocusEventCause value, Class> enumtype) {
		if (enumtype == null || value == null) {
			return null;
		} else {
			for (Enum e : enumtype.getEnumConstants()) {
				if (e.name().equals(value.name())) {
					return e;
				}
			}
			return null;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy