Search in sources :

Example 1 with JListFixture

use of org.fest.swing.fixture.JListFixture in project ats-framework by Axway.

the class SwingMultiSelectList method verifyNotValue.

/**
     * Verify the specified value is NOT selected
     *
     * @param notExpectedValue
     * @throws VerificationException if the element doesn't exist
     * @throws VerifyNotEqualityException if the verification fails
     */
@Override
@PublicAtsApi
public void verifyNotValue(String notExpectedValue) {
    new SwingElementState(this).waitToBecomeExisting();
    JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
    String selectedValue = (String) listFixture.component().getSelectedValue();
    if ((notExpectedValue == null && selectedValue == null) || (StringUtils.isNotNullAndEquals(selectedValue, notExpectedValue))) {
        throw new VerifyNotEqualityException(notExpectedValue, this);
    }
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 2 with JListFixture

use of org.fest.swing.fixture.JListFixture 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 3 with JListFixture

use of org.fest.swing.fixture.JListFixture in project ats-framework by Axway.

the class SwingMultiSelectList method unsetValue.

/**
     * Unset MultiSelectList value
     * @throws VerificationException if the element doesn't exist
     */
@Override
@PublicAtsApi
public void unsetValue(String value) {
    if (Arrays.asList(getValues()).contains(value)) {
        JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
        listFixture.pressKey(KeyEvent.VK_CONTROL);
        try {
            listFixture.clickItem(value);
        } finally {
            listFixture.releaseKey(KeyEvent.VK_CONTROL);
        }
    }
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 4 with JListFixture

use of org.fest.swing.fixture.JListFixture 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 5 with JListFixture

use of org.fest.swing.fixture.JListFixture in project ats-framework by Axway.

the class SwingSingleSelectList method getValue.

/**
     * Get SingleSelectList value
     *
     * @throws VerificationException if the element doesn't exist
     */
@Override
@PublicAtsApi
public String getValue() {
    new SwingElementState(this).waitToBecomeExisting();
    String[] selections = ((JListFixture) SwingElementLocator.findFixture(this)).selection();
    if (selections.length > 0) {
        return selections[0];
    }
    return "";
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

JListFixture (org.fest.swing.fixture.JListFixture)21 PublicAtsApi (com.axway.ats.common.PublicAtsApi)8 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)7 NotNull (org.jetbrains.annotations.NotNull)6 JBList (com.intellij.ui.components.JBList)4 ASGallery (com.android.tools.idea.ui.ASGallery)2 NlPaletteTreeGrid (com.android.tools.idea.uibuilder.palette.NlPaletteTreeGrid)2 JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)2 JPopupMenuFixture (org.fest.swing.fixture.JPopupMenuFixture)2 TemplateEntry (com.android.tools.idea.npw.TemplateEntry)1 ThemeSelectionDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.ThemeSelectionDialogFixture)1 AndroidThemePreviewPanelFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.AndroidThemePreviewPanelFixture)1 NewStyleDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.NewStyleDialogFixture)1 ThemeEditorFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture)1 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)1 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)1 SwingDriverInternal (com.axway.ats.uiengine.internal.driver.SwingDriverInternal)1 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1 PopupFactoryImpl (com.intellij.ui.popup.PopupFactoryImpl)1 ListPopupModel (com.intellij.ui.popup.list.ListPopupModel)1