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);
}
}
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();
}
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);
}
}
}
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);
}
}
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 "";
}
Aggregations