Package com.oorian.html.js.permissions
Class PermissionStatusEvent
java.lang.Object
com.oorian.messaging.events.Event<PermissionsListener>
com.oorian.messaging.events.client.ClientEvent<PermissionsListener>
com.oorian.html.js.permissions.PermissionStatusEvent
Event fired when a permission status is retrieved or changes.
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionStatusEvent(String permissionName, String state) Constructs a PermissionStatusEvent. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchTo(PermissionsListener listener) Dispatches this event to the specified listener.Returns the name of the permission.getState()Returns the permission state.booleanisDenied()Returns whether the permission is denied.booleanReturns whether the permission is granted.booleanisPrompt()Returns whether the user will be prompted.toString()Methods inherited from class com.oorian.messaging.events.client.ClientEvent
getSource, getTarget, setSource, setTarget
-
Constructor Details
-
PermissionStatusEvent
Constructs a PermissionStatusEvent.- Parameters:
permissionName- The name of the permission.state- The permission state: "granted", "denied", or "prompt".
-
-
Method Details
-
getPermissionName
Returns the name of the permission.- Returns:
- The permission name.
-
getState
Returns the permission state.- Returns:
- "granted", "denied", or "prompt".
-
isGranted
public boolean isGranted()Returns whether the permission is granted.- Returns:
- True if granted.
-
isDenied
public boolean isDenied()Returns whether the permission is denied.- Returns:
- True if denied.
-
isPrompt
public boolean isPrompt()Returns whether the user will be prompted.This state indicates the permission hasn't been granted or denied yet, and the user will be prompted when the feature is used.
- Returns:
- True if the user will be prompted.
-
dispatchTo
Description copied from class:EventDispatches this event to the specified listener.Subclasses implement this method to call the appropriate handler method on the listener interface.
- Specified by:
dispatchToin classEvent<PermissionsListener>- Parameters:
listener- the listener to dispatch this event to
-
toString
-