use of org.jetbrains.plugins.javaFX.refactoring.JavaFxPropertyRenameHandler in project intellij-community by JetBrains.
the class JavaFXRenameTest method doTestPropertyRenameHandler.
public void doTestPropertyRenameHandler(String... files) throws Exception {
myFixture.configureByFiles(files);
final MapDataContext dataContext = new MapDataContext();
dataContext.put(CommonDataKeys.EDITOR, getEditor());
final RenameHandler renameHandler = RenameHandlerRegistry.getInstance().getRenameHandler(dataContext);
assertTrue(renameHandler instanceof JavaFxPropertyRenameHandler);
}
use of org.jetbrains.plugins.javaFX.refactoring.JavaFxPropertyRenameHandler in project intellij-community by JetBrains.
the class JavaFXRenameTest method doTestStaticProperty.
public void doTestStaticProperty(@NonNls String newName, String className) throws Exception {
myFixture.configureByFiles(getTestName(true) + ".fxml", className.replace('.', '/') + ".java");
final MapDataContext dataContext = new MapDataContext();
dataContext.put(CommonDataKeys.EDITOR, getEditor());
dataContext.put(PsiElementRenameHandler.DEFAULT_NAME, newName);
final JavaFxPropertyRenameHandler renameHandler = new JavaFxPropertyRenameHandler();
assertTrue(renameHandler.isAvailableOnDataContext(dataContext));
renameHandler.invoke(getProject(), getEditor(), null, dataContext);
myFixture.checkResultByFile(getTestName(true) + "_after.fxml");
final PsiClass psiClass = myFixture.findClass(className);
assertNotNull(psiClass);
final String propName = newName.substring(0, 1).toUpperCase() + newName.substring(1);
assertMethodExists(psiClass, "set" + propName);
}
use of org.jetbrains.plugins.javaFX.refactoring.JavaFxPropertyRenameHandler in project intellij-community by JetBrains.
the class JavaFXRenameTest method doTestHandler.
@NotNull
public PsiClass doTestHandler(String newName, String className) throws Exception {
if (className == null) {
className = getTestName(false);
myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java");
} else {
myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java", className.replace('.', '/') + ".java");
}
final MapDataContext dataContext = new MapDataContext();
dataContext.put(CommonDataKeys.EDITOR, getEditor());
dataContext.put(PsiElementRenameHandler.DEFAULT_NAME, newName);
final JavaFxPropertyRenameHandler renameHandler = new JavaFxPropertyRenameHandler();
assertTrue(renameHandler.isAvailableOnDataContext(dataContext));
renameHandler.invoke(getProject(), getEditor(), null, dataContext);
myFixture.checkResultByFile(getTestName(true) + "_after.fxml");
final PsiClass psiClass = myFixture.findClass(className);
assertNotNull(psiClass);
return psiClass;
}
Aggregations