use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.
the class SwingComponent method drag.
/**
* Simulates a user dragging of this component
*/
@PublicAtsApi
public void drag() {
new SwingElementState(this).waitToBecomeExisting();
ComponentFixture<? extends Component> componentFixture = SwingElementLocator.findFixture(this);
ComponentDragAndDrop componentDragAndDrop = new ComponentDragAndDrop(componentFixture.robot);
componentDragAndDrop.drag(componentFixture.target, getComponentCenterLocation(componentFixture.target));
}
use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.
the class SwingComponent method drop.
/**
* Simulates a user dropping to this component
*/
@PublicAtsApi
public void drop() {
new SwingElementState(this).waitToBecomeExisting();
ComponentFixture<? extends Component> componentFixture = SwingElementLocator.findFixture(this);
ComponentDragAndDrop componentDragAndDrop = new ComponentDragAndDrop(componentFixture.robot);
componentDragAndDrop.drop(componentFixture.target, getComponentCenterLocation(componentFixture.target));
}
use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.
the class SwingComponent method click.
/**
* Simulates a user click over the GUI component.
*/
@PublicAtsApi
public void click() {
new SwingElementState(this).waitToBecomeExisting();
click(MouseClickInfo.leftButton());
}
use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.
the class SwingPopupMenu method getVisibleMenuLabels.
/**
* Getting only visible menu labels/texts
*
* @return an array with the visible menu labels/texts only
*/
@PublicAtsApi
public String[] getVisibleMenuLabels() {
new SwingElementState(this).waitToBecomeExisting();
JPopupMenuFixture popupMenuFixture = (JPopupMenuFixture) SwingElementLocator.findFixture(this);
String[] labels = popupMenuFixture.menuLabels();
List<String> visibleLabels = new ArrayList<String>(labels.length);
for (final String label : labels) {
JMenuItemFixture menuItemFixture = popupMenuFixture.menuItem(new GenericTypeMatcher<JMenuItem>(JMenuItem.class, false) {
@Override
protected boolean isMatching(JMenuItem menuItem) {
String text = menuItem.getText();
if (text != null && text.equals(label)) {
return true;
}
return false;
}
});
if (menuItemFixture != null && menuItemFixture.component().isVisible()) {
visibleLabels.add(label);
}
}
return visibleLabels.toArray(new String[0]);
}
use of com.axway.ats.uiengine.utilities.swing.SwingElementState in project ats-framework by Axway.
the class SwingComponent method middleClick.
/**
* Simulates a user middle click over the GUI component.
*/
@PublicAtsApi
public void middleClick() {
new SwingElementState(this).waitToBecomeExisting();
click(MouseClickInfo.middleButton());
}
Aggregations