void (JPanel optionsPanel, @Nls String passFieldsAsParamsLabel) { if (myStaticFlag || myCanBeStatic) { myMakeStatic.setEnabled(!myStaticFlag); myMakeStatic.setSelected(myStaticFlag); if (myVariableData.hasInstanceFields()) { myMakeStatic.setText(passFieldsAsParamsLabel); } myMakeStatic.addItemListener(e -> { if (myVariableData.hasInstanceFields()) { myVariableData.setPassFields(myMakeStatic.isSelected()); myInputVariables = myVariableData.getInputVariables().toArray(new VariableData[0]); updateVarargsEnabled(); createParametersPanel(); } else { JavaRefactoringSettings.getInstance().EXTRACT_STATIC_METHOD = myMakeStatic.isSelected(); } updateSignature(); }); optionsPanel.add(myMakeStatic); } else { myMakeStatic.setSelected(false); myMakeStatic.setEnabled(false); } myMakeStatic.setBorder(JBUI.Borders.empty(5, 0, 5, 4)); }