Class LockButton

All Implemented Interfaces:
Accessible, Actionable, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") @Deprecated public class LockButton extends Button implements Accessible, Actionable, Buildable, ConstraintTarget
Deprecated.
This widget will be removed in GTK 5

GtkLockButton is a widget to obtain and revoke authorizations needed to operate the controls.

An example GtkLockButton

It is typically used in preference dialogs or control panels.

The required authorization is represented by a GPermission object. Concrete implementations of GPermission may use PolicyKit or some other authorization framework. To obtain a PolicyKit-based GPermission, use polkit_permission_new().

If the user is not currently allowed to perform the action, but can obtain the permission, the widget looks like this:

An locked GtkLockButton

and the user can click the button to request the permission. Depending on the platform, this may pop up an authentication dialog or ask the user to authenticate in some other way. Once the user has obtained the permission, the widget changes to this:

An unlocked GtkLockButton

and the permission can be dropped again by clicking the button. If the user is not able to obtain the permission at all, the widget looks like this:

An unobtainable GtkLockButton

If the user has the permission and cannot drop it, the button is hidden.

The text (and tooltips) that are shown in the various cases can be adjusted with the Gtk.LockButton:text-lock, Gtk.LockButton:text-unlock, Gtk.LockButton:tooltip-lock, Gtk.LockButton:tooltip-unlock and Gtk.LockButton:tooltip-not-authorized properties.

  • Constructor Details

    • LockButton

      public LockButton(MemorySegment address)
      Deprecated.
      Create a LockButton instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • LockButton

      @Deprecated public LockButton(@Nullable Permission permission)
      Deprecated.
      This widget will be removed in GTK 5
      Creates a new lock button which reflects the permission.
      Parameters:
      permission - a GPermission
    • LockButton

      public LockButton()
      Deprecated.
      Create a new LockButton.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Deprecated.
      Get the GType of the LockButton class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      Deprecated.
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected LockButton asParent()
      Deprecated.
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Button
      Returns:
      the instance as if it were its parent type
    • getPermission

      @Deprecated public @Nullable Permission getPermission()
      Deprecated.
      This widget will be removed in GTK 5
      Obtains the GPermission object that controls button.
      Returns:
      the GPermission of this LockButton
    • setPermission

      @Deprecated public void setPermission(@Nullable Permission permission)
      Deprecated.
      This widget will be removed in GTK 5
      Sets the GPermission object that controls button.
      Parameters:
      permission - a GPermission object
    • builder

      public static LockButton.Builder<? extends LockButton.Builder> builder()
      Deprecated.
      A LockButton.Builder object constructs a LockButton with the specified properties. Use the various set...() methods to set properties, and finish construction with LockButton.Builder.build().
      Returns:
      the builder object