use of org.fest.swing.fixture.JTabbedPaneFixture in project ats-framework by Axway.
the class SwingTabbedPane method selectTabUsingSubElement.
/**
* Select tab by title using SubElement described in the map file. The required property is 'title'
*
* @param mapId the sub-element mapID. This element must have property 'title'
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void selectTabUsingSubElement(String mapId) {
new SwingElementState(this).waitToBecomeExisting();
try {
String elementMapId = properties.getInternalProperty(UiElementProperties.MAP_ID_INTERNAL_PARAM);
if (elementMapId == null) {
throw new UiElementException("The element must be in the MAP file", this);
}
UiElementProperties elProperties = ElementsMap.getInstance().getSubElementProperties(elementMapId, mapId);
String tabTitle = elProperties.getProperty("title");
if (tabTitle == null) {
throw new UiElementException("The Sub-Element doesn't have 'title' attribute, " + "which is required for tab selection.", this);
}
((JTabbedPaneFixture) SwingElementLocator.findFixture(this)).selectTab(tabTitle);
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
use of org.fest.swing.fixture.JTabbedPaneFixture in project ats-framework by Axway.
the class SwingTabbedPane method selectTabUsingSubElement.
/**
* Select tab by title using sub-element properties. The required property is 'title'
*
* @param elementProperties the sub-element {@link UiElementProperties} which contains property 'title'
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void selectTabUsingSubElement(UiElementProperties elementProperties) {
new SwingElementState(this).waitToBecomeExisting();
try {
String tabTitle = elementProperties.getProperty("title");
if (tabTitle == null) {
throw new UiElementException("The Sub-Element doesn't have 'title' attribute, " + "which is required for tab selection.", this);
}
((JTabbedPaneFixture) SwingElementLocator.findFixture(this)).selectTab(tabTitle);
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
Aggregations