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

org.richfaces.fragment.hotkey.Hotkey Maven / Gradle / Ivy

There is a newer version: 5.0.0.Alpha3
Show newest version
/*
 * JBoss, Home of Professional Open Source
 * Copyright 2013, Red Hat, Inc. and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.richfaces.fragment.hotkey;

import org.openqa.selenium.WebElement;

/**
 * @author Jiri Stefek
 */
public interface Hotkey {

    /**
     * Invokes the hotkey on an element which is specified by selector attribute of hotkey, when the selector is empty, then the
     * hotkey will be invoked on html element.
     *
     * @see #setHotkey
     * @see #setSelector
     */
    void invoke();

    /**
     * Invokes the hotkey on a specified element.
     *
     * @param element element on which the hotkey will be invoked. Element cannot be null.
     * @throws IllegalArgumentException if you have not set hotkey correctly
     * @see #setHotkey
     */
    void invoke(WebElement element);

    /**
     * Sets the hotkey which will be invoked
     *
     * @param hotkey key sequence which will be invoked, keys are separated with '+' sign and are in lowercase. For example: 'alt+x'.
     * @throws IllegalArgumentException if the given hotkey is null, or empty
     */
    void setHotkey(String hotkey);

    /**
     * Sets the JQuery selector, by which the element on which the hotkey will be invoked, will be found.
     *
     * @param selector JQuery selector to locate element on which the hotkey will be applied
     * @throws IllegalArgumentException if the given selector is null, or empty
     */
    void setSelector(String selector);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy