new ClassMatcher(JList.class, true));
textureCount = availableTexturesList.getModel().getSize();
// Select modified texture
availableTexturesList.setSelectedValue(modifiedTexture, true);
final JButton deleteButton = (JButton)new BasicFinder().find(textureDialog,
new Matcher() {
public boolean matches(Component c) {
return c instanceof JButton && ((JButton)c).getText().equals(preferences.getLocalizedString(
TextureChoiceComponent.class, "deleteTextureButton.text"));
}
});
tester.invokeAndWait(new Runnable() {
public void run() {
// Display confirm dialog box later in Event Dispatch Thread to avoid blocking test thread
deleteButton.doClick();
}
});
tester.waitForIdle();
// Wait for confirm dialog to be shown
final String confirmDeleteSelectedCatalogTextureDialogTitle = preferences.getLocalizedString(
TextureChoiceComponent.class, "confirmDeleteSelectedCatalogTexture.title");
tester.waitForFrameShowing(new AWTHierarchy(), confirmDeleteSelectedCatalogTextureDialogTitle);
// Check dialog box is displayed
JDialog confirmDialog = (JDialog)new BasicFinder().find(textureDialog,
new Matcher() {
public boolean matches(Component c) {
return c instanceof JDialog && ((JDialog)c).getTitle().equals(
confirmDeleteSelectedCatalogTextureDialogTitle);
}
});