Interface Clickable

  • All Implemented Interfaces:

    
    public interface Clickable<T extends Component>
    
                        

    Mixin interface for component testers that support click simulation. This interface provides default implementations for various click operations including left, middle, and right clicks with optional meta keys.

    Since:

    1.0

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract T getComponent() Gets the component being tested.
      abstract void ensureComponentIsUsable() Ensures the component is in a usable state before interaction.
      void click() If the component is usable send click to component as if it was from the client.
      void click(MetaKeys metaKeys) If the component is usable send click to component as if it was from the client with defined meta keys pressed.
      void middleClick() Click with middle button.
      void middleClick(MetaKeys metaKeys) Click with middle button and given meta keys.
      void rightClick() Click with right button.
      void rightClick(MetaKeys metaKeys) Click with right button and given meta keys.
      void click(int button, MetaKeys metaKeys) Performs a click with the specified button and meta keys.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getComponent

         abstract T getComponent()

        Gets the component being tested.

        Returns:

        the component under test

      • ensureComponentIsUsable

         abstract void ensureComponentIsUsable()

        Ensures the component is in a usable state before interaction.

      • click

         void click()

        If the component is usable send click to component as if it was from the client.

      • click

         void click(MetaKeys metaKeys)

        If the component is usable send click to component as if it was from the client with defined meta keys pressed.

        Parameters:
        metaKeys - the meta keys pressed during click
      • middleClick

         void middleClick()

        Click with middle button.

      • middleClick

         void middleClick(MetaKeys metaKeys)

        Click with middle button and given meta keys.

        Parameters:
        metaKeys - the meta keys pressed during click
      • rightClick

         void rightClick()

        Click with right button.

      • rightClick

         void rightClick(MetaKeys metaKeys)

        Click with right button and given meta keys.

        Parameters:
        metaKeys - the meta keys pressed during click
      • click

         void click(int button, MetaKeys metaKeys)

        Performs a click with the specified button and meta keys.

        Parameters:
        button - the mouse button (0=left, 1=middle, 2=right)
        metaKeys - the meta keys pressed during click