use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTable method clickCell.
/**
* Click table cell
*
* @param row the row number
* @param column the column number
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void clickCell(int row, int column) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
tableFixture.cell(new TableCell(row, column) {
}).click();
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTable method drag.
/**
* Simulates a user dragging a cell from this table
*
* @param row the row number
* @param column the column number
*/
@PublicAtsApi
public void drag(int row, int column) {
new SwingElementState(this).waitToBecomeExisting();
((JTableFixture) SwingElementLocator.findFixture(this)).drag(new TableCell(row, column) {
});
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTable method getCellBackgroundColors.
/**
* Gets table cell backgrounds (as {@link Color}) of all table cells.
*
* @return array of java.awt.Color objects one for each cell. First index is
* table row and second is the column in this row.
*/
@PublicAtsApi
public Color[][] getCellBackgroundColors() {
new SwingElementState(this).waitToBecomeExisting();
final JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
int rowCount = tableFixture.rowCount();
// SwingUtilities.
int columnCount = GuiActionRunner.execute(new GuiQuery<Integer>() {
@Override
protected Integer executeInEDT() throws Throwable {
return tableFixture.component().getColumnCount();
}
});
Color[][] resultArr = new Color[rowCount][columnCount];
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j < columnCount; j++) {
resultArr[i][j] = tableFixture.backgroundAt(new TableCell(i, j) {
}).target();
}
}
return resultArr;
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTextArea method appendValue.
/**
* Works in same way as the 'set text' method
*
* @param value
*/
@Override
@PublicAtsApi
public void appendValue(String value) {
new SwingElementState(this).waitToBecomeExisting();
((JTextComponentFixture) SwingElementLocator.findFixture(this)).setText(value);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTextArea method setValue.
/**
* Set text area 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();
((JTextComponentFixture) SwingElementLocator.findFixture(this)).setText(value);
}
Aggregations