hide initialization in current method when multiple occurrences found

This commit is contained in:
anna
2012-03-12 18:31:26 +01:00
parent e88f6c172c
commit 4ec24656cd
@@ -233,6 +233,17 @@ public class IntroduceFieldPopupPanel extends IntroduceFieldCentralPanel {
return super.allowFinal() && allowFinal;
}
@Override
protected void updateInitializerSelection() {
if (myAllowInitInMethodIfAll || !isReplaceAllOccurrences()) {
if (myInitialisersPlaceModel.getIndexOf(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD) == -1) {
myInitialisersPlaceModel.insertElementAt(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD, 0);
}
} else {
myInitialisersPlaceModel.removeElement(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD);
}
}
@Override
protected boolean shouldUpdateTypeSelector() {
return false;