use of com.intellij.refactoring.introduce.inplace.AbstractInplaceIntroducer in project intellij-community by JetBrains.
the class InplaceIntroduceVariableTest method testConflictingInnerClassName.
public void testConflictingInnerClassName() throws Exception {
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
final boolean oldOption = settings.INSERT_INNER_CLASS_IMPORTS;
try {
settings.INSERT_INNER_CLASS_IMPORTS = true;
doTest(new Pass<AbstractInplaceIntroducer>() {
@Override
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
type("constants");
}
});
} finally {
settings.INSERT_INNER_CLASS_IMPORTS = oldOption;
}
}
use of com.intellij.refactoring.introduce.inplace.AbstractInplaceIntroducer in project intellij-community by JetBrains.
the class InplaceIntroduceVariableTest method doTestStopEditing.
private void doTestStopEditing(Pass<AbstractInplaceIntroducer> pass) {
String name = getTestName(true);
configureByFile(getBasePath() + name + getExtension());
final boolean enabled = getEditor().getSettings().isVariableInplaceRenameEnabled();
try {
TemplateManagerImpl.setTemplateTesting(getProject(), getTestRootDisposable());
getEditor().getSettings().setVariableInplaceRenameEnabled(true);
final AbstractInplaceIntroducer introducer = invokeRefactoring();
pass.pass(introducer);
checkResultByFile(getBasePath() + name + "_after" + getExtension());
} finally {
TemplateState state = TemplateManagerImpl.getTemplateState(getEditor());
if (state != null) {
state.gotoEnd(true);
}
getEditor().getSettings().setVariableInplaceRenameEnabled(enabled);
}
}
use of com.intellij.refactoring.introduce.inplace.AbstractInplaceIntroducer in project intellij-community by JetBrains.
the class AbstractInplaceIntroduceTest method doTestEscape.
protected void doTestEscape(Pass<AbstractInplaceIntroducer> pass) {
String name = getTestName(true);
configureByFile(getBasePath() + name + getExtension());
final boolean enabled = getEditor().getSettings().isVariableInplaceRenameEnabled();
try {
TemplateManagerImpl.setTemplateTesting(getProject(), getTestRootDisposable());
getEditor().getSettings().setVariableInplaceRenameEnabled(true);
final AbstractInplaceIntroducer introducer = invokeRefactoring();
if (pass != null) {
pass.pass(introducer);
}
TemplateState state = TemplateManagerImpl.getTemplateState(getEditor());
assert state != null;
state.gotoEnd(true);
checkResultByFile(getBasePath() + name + "_after" + getExtension());
} finally {
getEditor().getSettings().setVariableInplaceRenameEnabled(enabled);
}
}
Aggregations