Search in sources :

Example 11 with SwingElementState

use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.

the class SwingMultiSelectList method setValue.

/**
 * Set MultiSelectList value
 *
 * @param value the value to set
 * @throws VerificationException if the element doesn't exist
 */
@Override
@PublicAtsApi
public void setValue(String value) {
    new SwingElementState(this).waitToBecomeExisting();
    JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
    listFixture.pressKey(KeyEvent.VK_CONTROL);
    try {
        listFixture.selectItem(value);
    } finally {
        listFixture.releaseKey(KeyEvent.VK_CONTROL);
    }
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 12 with SwingElementState

use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.

the class SwingMultiSelectList method rightClick.

/**
 * @param contextMenuItems context menu items to select
 */
@PublicAtsApi
public void rightClick(String... contextMenuItems) {
    new SwingElementState(this).waitToBecomeExisting();
    JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
    JPopupMenuFixture popUpMenu = listFixture.showPopupMenu();
    popUpMenu.menuItemWithPath(contextMenuItems).click();
}
Also used : JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 13 with SwingElementState

use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.

the class SwingMultiSelectList method clearSelections.

/**
 * Clears the selection
 *
 * @throws VerificationException if the element doesn't exist
 */
@PublicAtsApi
public void clearSelections() {
    new SwingElementState(this).waitToBecomeExisting();
    ((JListFixture) SwingElementLocator.findFixture(this)).clearSelection();
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 14 with SwingElementState

use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.

the class SwingPopupMenu method click.

/**
 * Click pop-up element
 * @throws VerificationException if the element doesn't exist
 */
@PublicAtsApi
public void click() {
    new SwingElementState(this).waitToBecomeExisting();
    ((JPopupMenuFixture) SwingElementLocator.findFixture(this)).click();
}
Also used : JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 15 with SwingElementState

use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.

the class SwingPopupMenu method clickMenuItemByName.

/**
 * Click {@link MenuItem} pop-up element by its 'name' attribute value
 *
 * @param menuItemName {@link MenuItem} name attribute value
 */
@PublicAtsApi
public void clickMenuItemByName(String menuItemName) {
    new SwingElementState(this).waitToBecomeExisting();
    ((JPopupMenuFixture) SwingElementLocator.findFixture(this)).menuItem(menuItemName).click();
}
Also used : SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

PublicAtsApi (com.axway.ats.common.PublicAtsApi)60 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)60 UiElementException (com.axway.ats.uiengine.exceptions.UiElementException)16 JTableFixture (org.fest.swing.fixture.JTableFixture)16 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)12 TableCell (org.fest.swing.data.TableCell)12 NotSupportedOperationException (com.axway.ats.uiengine.exceptions.NotSupportedOperationException)11 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)11 VerifyEqualityException (com.axway.ats.uiengine.exceptions.VerifyEqualityException)10 JTreeFixture (org.fest.swing.fixture.JTreeFixture)8 JListFixture (org.fest.swing.fixture.JListFixture)7 JPopupMenuFixture (org.fest.swing.fixture.JPopupMenuFixture)5 JSpinnerFixture (org.fest.swing.fixture.JSpinnerFixture)4 ArrayList (java.util.ArrayList)2 ComponentDragAndDrop (org.fest.swing.core.ComponentDragAndDrop)2 JCheckBoxFixture (org.fest.swing.fixture.JCheckBoxFixture)2 JFileChooserFixture (org.fest.swing.fixture.JFileChooserFixture)2 JMenuItemFixture (org.fest.swing.fixture.JMenuItemFixture)2 JTabbedPaneFixture (org.fest.swing.fixture.JTabbedPaneFixture)2 JTableHeaderFixture (org.fest.swing.fixture.JTableHeaderFixture)2