package jetbrains.mps.ide.java.platform.refactorings; /*Generated by MPS */ import jetbrains.mps.baseLanguage.util.plugin.refactorings.IntroduceConstantRefactoring; import com.intellij.openapi.project.Project; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.baseLanguage.util.plugin.refactorings.IntroduceVariableRefactoring; import org.jetbrains.annotations.Nullable; import javax.swing.JComponent; import java.awt.GridBagConstraints; import javax.swing.JPanel; public class IntroduceConstantDialog extends IntroduceVariableDialog { private IntroduceConstantRefactoring myRefactoring; public IntroduceConstantDialog(Project project, IntroduceConstantRefactoring refactoring, EditorContext editorContext) { super(project, "Introduce Constant", editorContext); myRefactoring = refactoring; init(); } @Override public IntroduceVariableRefactoring getRefactoring() { return this.myRefactoring; } @Nullable @Override protected JComponent createCenterPanel() { initPanel(); int gridy = 1; GridBagConstraints c; c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = gridy++; addVisibilityPanel(c); if (getRefactoring().hasDuplicates()) { addReplacingAll(gridy++); } c = new GridBagConstraints(); c.gridy = gridy; c.weighty = 1; myPanel.add(new JPanel(), c); return myPanel; } @Nullable @Override protected String getHelpId() { return "refactoring.introduceConstant"; } }