use of org.eclipse.swtbot.swt.finder.SWTBot in project xtext-xtend by eclipse.
the class AbstractRefactoringSwtBotTest method renameInXtendEditor.
public void renameInXtendEditor(final SWTBotEclipseEditor xtendEditor, final String newName, final String dialogName) {
final SWTBotMenu renameMenuItem = SwtBotProjectHelper.clickableContextMenu(xtendEditor, "Refactor", "Rename Element");
renameMenuItem.click();
boolean _isUseInlineRefactoring = this.testParams.isUseInlineRefactoring();
if (_isUseInlineRefactoring) {
this.waitForLinkedMode();
xtendEditor.typeText(newName);
boolean _isUsePreview = this.testParams.isUsePreview();
if (_isUsePreview) {
xtendEditor.pressShortcut(SWT.CTRL, SWT.CR);
AbstractRefactoringSwtBotTest.bot.shell(dialogName).activate();
AbstractRefactoringSwtBotTest.bot.button("OK").click();
} else {
xtendEditor.pressShortcut(KeyStroke.getInstance(SWT.LF));
}
} else {
SWTBot _bot = AbstractRefactoringSwtBotTest.bot.shell(dialogName).activate().bot();
final Procedure1<SWTBot> _function = (SWTBot it) -> {
SWTBotText _textWithLabel = it.textWithLabel("New name:");
_textWithLabel.setText(newName);
boolean _isUsePreview_1 = this.testParams.isUsePreview();
if (_isUsePreview_1) {
it.button("Preview >").click();
}
it.button("OK").click();
};
ObjectExtensions.<SWTBot>operator_doubleArrow(_bot, _function);
}
this.waitForRefactoring(xtendEditor);
}
use of org.eclipse.swtbot.swt.finder.SWTBot in project xtext-xtend by eclipse.
the class AbstractRefactoringSwtBotTest method undo.
public void undo(final SWTBotEclipseEditor editor) {
editor.setFocus();
editor.pressShortcut(SWT.MOD1, 'Z');
AbstractRefactoringSwtBotTest.bot.shell("Undo").activate();
AbstractRefactoringSwtBotTest.bot.button("OK").click();
SWTBot _sWTBot = new SWTBot();
WaitForRefactoringCondition _waitForRefactoringCondition = new WaitForRefactoringCondition(editor, true);
_sWTBot.waitUntil(_waitForRefactoringCondition, 15000);
}
use of org.eclipse.swtbot.swt.finder.SWTBot in project xtext-xtend by eclipse.
the class AbstractRefactoringSwtBotTest method waitForRefactoring.
protected void waitForRefactoring(final SWTBotEclipseEditor editor) {
SWTBot _sWTBot = new SWTBot();
WaitForRefactoringCondition _waitForRefactoringCondition = new WaitForRefactoringCondition(editor, false);
_sWTBot.waitUntil(_waitForRefactoringCondition, 15000);
}
use of org.eclipse.swtbot.swt.finder.SWTBot in project xtext-xtend by eclipse.
the class AbstractRefactoringSwtBotTest method renameInJavaEditor.
public void renameInJavaEditor(final SWTBotEclipseEditor javaEditor, final String newName, final String dialogName) {
final SWTBotMenu renameMenuItem = SwtBotProjectHelper.clickableContextMenu(javaEditor, "Refactor", "Rename...");
renameMenuItem.click();
boolean _isUseInlineRefactoring = this.testParams.isUseInlineRefactoring();
if (_isUseInlineRefactoring) {
javaEditor.typeText(newName);
boolean _isUsePreview = this.testParams.isUsePreview();
if (_isUsePreview) {
javaEditor.pressShortcut(SWT.CTRL, SWT.CR);
AbstractRefactoringSwtBotTest.bot.shell(dialogName).activate();
AbstractRefactoringSwtBotTest.bot.button("OK").click();
} else {
javaEditor.pressShortcut(KeyStroke.getInstance(SWT.LF));
}
} else {
SWTBot _bot = AbstractRefactoringSwtBotTest.bot.shell(dialogName).activate().bot();
final Procedure1<SWTBot> _function = (SWTBot it) -> {
SWTBotText _textWithLabel = it.textWithLabel("New name:");
_textWithLabel.setText(newName);
boolean _isUsePreview_1 = this.testParams.isUsePreview();
if (_isUsePreview_1) {
it.button("Next").click();
}
it.button("Finish").click();
};
ObjectExtensions.<SWTBot>operator_doubleArrow(_bot, _function);
}
this.waitForRefactoring(javaEditor);
}
use of org.eclipse.swtbot.swt.finder.SWTBot in project xtext-xtend by eclipse.
the class AbstractRefactoringSwtBotTest method waitForLinkedMode.
protected void waitForLinkedMode() {
SWTBot _sWTBot = new SWTBot();
WaitForLinkedModeCondition _waitForLinkedModeCondition = new WaitForLinkedModeCondition(this.controller);
_sWTBot.waitUntil(_waitForLinkedModeCondition);
}
Aggregations