if (readOnly)
{
throw new IllegalStateException("Can't edit file in readonly mode");
}
ideBrowser.findElement(By.id(fileName)).click();
driver.waitUntil(new Function()
{
public Object apply(Object from)
{
String editorText = getEditorContents();
return editorText != null && editorText.length() > 0;
}
});
driver.executeScript("speakeasyRequire.run('speakeasy/user/ide/ide').text(arguments[0])", contents);
dialogElement.findElement(By.className("ide-save")).click();
driver.waitUntil(new Function()
{
public Object apply(Object from)
{
return ideStatus.getText().contains(statusExpected);
}