diff --git a/java/java-impl-refactorings/src/com/intellij/refactoring/introduceField/IntroduceConstantDialog.java b/java/java-impl-refactorings/src/com/intellij/refactoring/introduceField/IntroduceConstantDialog.java index 594f584eeb1b..6df1c2737672 100644 --- a/java/java-impl-refactorings/src/com/intellij/refactoring/introduceField/IntroduceConstantDialog.java +++ b/java/java-impl-refactorings/src/com/intellij/refactoring/introduceField/IntroduceConstantDialog.java @@ -419,7 +419,7 @@ class IntroduceConstantDialog extends DialogWrapper { myCbDeleteVariable.setEnabled(false); myCbDeleteVariable.setSelected(true); } - else if (myCbReplaceAll != null) { + else { updateCbDeleteVariable(); myCbReplaceAll.addItemListener( new ItemListener() { diff --git a/platform/platform-api/src/com/intellij/openapi/ui/NamedConfigurable.form b/platform/platform-api/src/com/intellij/openapi/ui/NamedConfigurable.form deleted file mode 100644 index 85b5ba60fb58..000000000000 --- a/platform/platform-api/src/com/intellij/openapi/ui/NamedConfigurable.form +++ /dev/null @@ -1,56 +0,0 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/NamedConfigurable.java b/platform/platform-api/src/com/intellij/openapi/ui/NamedConfigurable.java index de36ceba7b7c..ffa4844210bb 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/NamedConfigurable.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/NamedConfigurable.java @@ -30,12 +30,12 @@ import java.lang.reflect.Method; import java.util.ResourceBundle; public abstract class NamedConfigurable implements Configurable { - private final JTextField myNameField; - private final JPanel myNamePanel; - private final JPanel myWholePanel; - private final JPanel myOptionsPanel; - private final JPanel myTopRightPanel; - private final ErrorLabel myErrorLabel; + private JTextField myNameField; + private JPanel myNamePanel; + private JPanel myWholePanel; + private JPanel myOptionsPanel; + private JPanel myTopRightPanel; + private ErrorLabel myErrorLabel; private JComponent myOptionsComponent; private final boolean myNameEditable; private final @Nullable Runnable myUpdateTree; @@ -57,46 +57,12 @@ public abstract class NamedConfigurable implements Configurable { @SuppressWarnings("unused") private NamedConfigurable(boolean fake) { this(); - { - // GUI initializer generated by IntelliJ IDEA GUI Designer - // >>> IMPORTANT!! <<< - // DO NOT EDIT OR ADD ANY CODE HERE! - myWholePanel = new JPanel(); - myWholePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); - myOptionsPanel = new JPanel(); - myOptionsPanel.setLayout(new BorderLayout(0, 0)); - myWholePanel.add(myOptionsPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, - GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, - GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, - null, null, null, 0, false)); - myNamePanel = new JPanel(); - myNamePanel.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); - myWholePanel.add(myNamePanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, - GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, - GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); - myErrorLabel = new ErrorLabel(); - this.$$$loadLabelText$$$(myErrorLabel, this.$$$getMessageFromBundle$$$("messages/CommonBundle", "name.label.text")); - myNamePanel.add(myErrorLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, - GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, - null, 0, false)); - myNameField = new JTextField(); - myNamePanel.add(myNameField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, - GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, - new Dimension(150, -1), null, 0, false)); - myTopRightPanel = new JPanel(); - myTopRightPanel.setLayout(new BorderLayout(0, 0)); - myNamePanel.add(myTopRightPanel, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, - GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, - GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, - null, null, null, 0, false)); - myErrorLabel.setLabelFor(myNameField); - } } private static Method $$$cachedGetBundleMethod$$$ = null; /** @noinspection ALL */ - private String $$$getMessageFromBundle$$$(String path, String key) { + private String $$$getMessageFromBundle$$$(@NonNls String path, String key) { ResourceBundle bundle; try { Class thisClass = this.getClass(); @@ -182,6 +148,38 @@ public abstract class NamedConfigurable implements Configurable { return myWholePanel; } + private void $$$setupUI$$$() { + myWholePanel = new JPanel(); + myWholePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); + myOptionsPanel = new JPanel(); + myOptionsPanel.setLayout(new BorderLayout(0, 0)); + myWholePanel.add(myOptionsPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, + GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, + GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, + null, null, null, 0, false)); + myNamePanel = new JPanel(); + myNamePanel.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); + myWholePanel.add(myNamePanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, + GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, + GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + myErrorLabel = new ErrorLabel(); + this.$$$loadLabelText$$$(myErrorLabel, this.$$$getMessageFromBundle$$$("messages/CommonBundle", "name.label.text")); + myNamePanel.add(myErrorLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, + GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, + null, 0, false)); + myNameField = new JTextField(); + myNamePanel.add(myNameField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, + GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, + new Dimension(150, -1), null, 0, false)); + myTopRightPanel = new JPanel(); + myTopRightPanel.setLayout(new BorderLayout(0, 0)); + myNamePanel.add(myTopRightPanel, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, + GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, + GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, + null, null, null, 0, false)); + myErrorLabel.setLabelFor(myNameField); + } + private void ensureUiInitialized() { if (myWholePanel == null) { $$$setupUI$$$(); diff --git a/platform/platform-impl/src/com/intellij/application/options/colors/RainbowDescriptionPanel.java b/platform/platform-impl/src/com/intellij/application/options/colors/RainbowDescriptionPanel.java index fa810e689ce8..32ac3cd2e462 100644 --- a/platform/platform-impl/src/com/intellij/application/options/colors/RainbowDescriptionPanel.java +++ b/platform/platform-impl/src/com/intellij/application/options/colors/RainbowDescriptionPanel.java @@ -54,14 +54,14 @@ public final class RainbowDescriptionPanel extends JPanel implements OptionsPane private final JBLabel myLStop3; private final JBLabel myLStop4; private final JBLabel myLStop5; - private final JBLabel[] myLStops = new JBLabel[]{myLStop1, myLStop2, myLStop3, myLStop4, myLStop5}; + private final JBLabel[] myLStops; final ColorPanel myStop1; final ColorPanel myStop2; final ColorPanel myStop3; final ColorPanel myStop4; final ColorPanel myStop5; - private final ColorPanel[] myStops = new ColorPanel[]{myStop1, myStop2, myStop3, myStop4, myStop5}; + private final ColorPanel[] myStops; private final JBCheckBox myRainbow; private final JTextPane myInheritanceLabel; @@ -71,7 +71,14 @@ public final class RainbowDescriptionPanel extends JPanel implements OptionsPane public RainbowDescriptionPanel() { super(new BorderLayout()); { - createOverwritePanel(); + myOverwrittenPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); + JLabel iconLabel = new JLabel(); + iconLabel.setIcon(AllIcons.General.Warning); + myOverwrittenPanel.add(iconLabel); + myOverwrittenPanel.add(Box.createRigidArea(new JBDimension(5, 0))); + JLabel overwrittenLabel = new JLabel(ApplicationBundle.message("rainbow.option.panel.overwritten.by.host")); + myOverwrittenPanel.add(overwrittenLabel); + myOverwrittenPanel.setVisible(false); } { // GUI initializer generated by IntelliJ IDEA GUI Designer @@ -166,6 +173,10 @@ public final class RainbowDescriptionPanel extends JPanel implements OptionsPane GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); } + + myLStops = new JBLabel[]{myLStop1, myLStop2, myLStop3, myLStop4, myLStop5}; + myStops = new ColorPanel[]{myStop1, myStop2, myStop3, myStop4, myStop5}; + add(myPanel, BorderLayout.CENTER); setBorder(JBUI.Borders.empty(4, 0, 4, 4)); @@ -268,17 +279,6 @@ public final class RainbowDescriptionPanel extends JPanel implements OptionsPane /** @noinspection ALL */ public JComponent $$$getRootComponent$$$() { return myPanel; } - private void createOverwritePanel() { - myOverwrittenPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); - JLabel iconLabel = new JLabel(); - iconLabel.setIcon(AllIcons.General.Warning); - myOverwrittenPanel.add(iconLabel); - myOverwrittenPanel.add(Box.createRigidArea(new JBDimension(5, 0))); - JLabel overwrittenLabel = new JLabel(ApplicationBundle.message("rainbow.option.panel.overwritten.by.host")); - myOverwrittenPanel.add(overwrittenLabel); - myOverwrittenPanel.setVisible(false); - } - @Contract(pure = true) private static @NotNull String checkRightArrow(@NotNull String str) { return str.replaceAll("->", FontUtil.rightArrow(StartupUiUtil.getLabelFont())); diff --git a/platform/platform-impl/src/com/intellij/ide/browsers/StartBrowserPanel.java b/platform/platform-impl/src/com/intellij/ide/browsers/StartBrowserPanel.java index c1fd2ec310d0..c57465fea61b 100644 --- a/platform/platform-impl/src/com/intellij/ide/browsers/StartBrowserPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/browsers/StartBrowserPanel.java @@ -50,7 +50,7 @@ public final class StartBrowserPanel { private final JCheckBox myStartJavaScriptDebuggerCheckBox; private final TextFieldWithBrowseButton myUrlField; - private BrowserSelector myBrowserSelector; + private final BrowserSelector myBrowserSelector; private final JPanel myRoot; @@ -58,9 +58,6 @@ public final class StartBrowserPanel { { myBrowserSelector = new BrowserSelector(); myBrowserComboBox = (ComboboxWithBrowseButton)myBrowserSelector.getMainComponent(); - myBrowserComboBox.getComboBox().addActionListener(e -> { - myStartJavaScriptDebuggerCheckBox.setEnabled(isDebugAllowed(myBrowserSelector.getSelected())); - }); } { // GUI initializer generated by IntelliJ IDEA GUI Designer @@ -114,6 +111,11 @@ public final class StartBrowserPanel { GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); jBLabel1.setLabelFor(myUrlField); } + + myBrowserComboBox.getComboBox().addActionListener(e -> { + myStartJavaScriptDebuggerCheckBox.setEnabled(isDebugAllowed(myBrowserSelector.getSelected())); + }); + myStartJavaScriptDebuggerCheckBox.setVisible(JavaScriptDebuggerStarter.Util.hasStarters()); myRoot.addAncestorListener(new AncestorListenerAdapter() { @Override diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/versionBrowser/StandardVersionFilterComponent.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/versionBrowser/StandardVersionFilterComponent.java index 393fd6678222..11b60f4c8097 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/versionBrowser/StandardVersionFilterComponent.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/versionBrowser/StandardVersionFilterComponent.java @@ -26,10 +26,6 @@ import java.util.ResourceBundle; public abstract class StandardVersionFilterComponent implements ChangesBrowserSettingsEditor { private final JPanel myPanel; - protected JPanel getDatePanel() { - return myDateFilterComponent.getPanel(); - } - protected Component getStandardPanel() { return myPanel; } @@ -43,7 +39,7 @@ public abstract class StandardVersionFilterComponent>> IMPORTANT!! <<< @@ -85,9 +81,7 @@ public abstract class StandardVersionFilterComponent(true) { @Override - protected String getItemText(final @NotNull java.lang.Module module) { + protected String getItemText(final @NotNull Module module) { return module.getName(); } }; diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.java index 133a93274faa..ed42b0b402c8 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.java @@ -71,24 +71,26 @@ public class GroovyExtractMethodDialog extends DialogWrapper { private final EditorTextField myNameField; private final JCheckBox myCbSpecifyType; private final JLabel myNameLabel; - private MethodSignatureComponent mySignature; + private final MethodSignatureComponent mySignature; private final ComboBoxVisibilityPanel myVisibilityPanel; private final Splitter mySplitter; private final JCheckBox myForceReturnCheckBox; - private GrParameterTablePanel myParameterTablePanel; - private final Project myProject; + private final GrParameterTablePanel myParameterTablePanel; public GroovyExtractMethodDialog(InitialInfo info, PsiClass owner) { super(info.getProject(), true); + + Project project = info.getProject(); + { - mySignature = new GrMethodSignatureComponent("", myProject); + mySignature = new GrMethodSignatureComponent("", project); mySignature.setPreferredSize(JBUI.size(500, 100)); mySignature.setMinimumSize(JBUI.size(500, 100)); mySignature.setBorder( IdeBorderFactory.createTitledBorder(GroovyRefactoringBundle.message("signature.preview.border.title"), false)); mySignature.setFocusable(false); - myNameField = new EditorTextField("", myProject, GroovyFileType.GROOVY_FILE_TYPE); + myNameField = new EditorTextField("", project, GroovyFileType.GROOVY_FILE_TYPE); myVisibilityPanel = new GroovyComboboxVisibilityPanel(); String visibility = GroovyApplicationSettings.getInstance().EXTRACT_METHOD_VISIBILITY; @@ -172,7 +174,6 @@ public class GroovyExtractMethodDialog extends DialogWrapper { GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); } - myProject = info.getProject(); myHelper = new ExtractMethodInfoHelper(info, "", owner, false); myParameterTablePanel.init(myHelper); diff --git a/plugins/kotlin/run-configurations/jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationEditor.java b/plugins/kotlin/run-configurations/jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationEditor.java index 50b0999cfac0..729b3689fdcc 100644 --- a/plugins/kotlin/run-configurations/jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationEditor.java +++ b/plugins/kotlin/run-configurations/jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationEditor.java @@ -56,7 +56,6 @@ public final class KotlinRunConfigurationEditor extends SettingsEditor(); - mainClassEditorField.setComponent(ClassEditorField.createClassField(project, () -> moduleSelector.getModule(), VISIBILITY_CHECKER, - createApplicationClassBrowser(project, - () -> moduleSelector.getModule()))); + mainClassEditorField.setComponent(ClassEditorField.createClassField(project, () -> getModule(), VISIBILITY_CHECKER, + createApplicationClassBrowser(project, () -> getModule()))); } { // GUI initializer generated by IntelliJ IDEA GUI Designer @@ -180,6 +177,10 @@ public final class KotlinRunConfigurationEditor extends SettingsEditor { - ShShellcheckUtil.download(myProject, - () -> myShellcheckSelector.setText(ShSettings.getShellcheckPath(myProject)), - () -> myErrorLabel.setVisible(true)); - EditorNotifications.getInstance(myProject).updateAllNotifications(); - }); + myShellcheckDownloadLink = new ActionLink(ShBundle.message("sh.shellcheck.download.label.text")); myInspectionsCheckboxPanel = new MultipleCheckboxOptionsPanel(new OptionAccessor() { @Override @@ -133,6 +128,13 @@ public class ShellcheckOptionsPanel { } myProject = ProjectUtil.getProject(getPanel()); + myShellcheckDownloadLink.addActionListener(e -> { + ShShellcheckUtil.download(myProject, + () -> myShellcheckSelector.setText(ShSettings.getShellcheckPath(myProject)), + () -> myErrorLabel.setVisible(true)); + EditorNotifications.getInstance(myProject).updateAllNotifications(); + }); + myShellcheckSelector.addBrowseFolderListener(myProject, FileChooserDescriptorFactory.createSingleFileDescriptor() .withTitle(ShBundle.message("sh.shellcheck.path.label"))); myShellcheckSelector.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { diff --git a/plugins/sh/core/src/com/intellij/sh/codeStyle/ShCodeStylePanel.java b/plugins/sh/core/src/com/intellij/sh/codeStyle/ShCodeStylePanel.java index 48cee830fd3a..b234aa2630e8 100644 --- a/plugins/sh/core/src/com/intellij/sh/codeStyle/ShCodeStylePanel.java +++ b/plugins/sh/core/src/com/intellij/sh/codeStyle/ShCodeStylePanel.java @@ -79,11 +79,7 @@ public class ShCodeStylePanel extends CodeStyleAbstractPanel { { myIndentField = new IntegerField(null, CodeStyleConstraints.MIN_INDENT_SIZE, CodeStyleConstraints.MAX_INDENT_SIZE); myTabField = new IntegerField(null, CodeStyleConstraints.MIN_TAB_SIZE, CodeStyleConstraints.MAX_TAB_SIZE); - myShfmtDownloadLink = new ActionLink(ShBundle.message("sh.code.style.download.link"), e -> { - ShFormatterDownloader.getInstance().download(myProject, - () -> myShfmtPathSelector.setText(ShSettings.getShfmtPath(myProject)), - () -> myErrorLabel.setVisible(true)); - }); + myShfmtDownloadLink = new ActionLink(ShBundle.message("sh.code.style.download.link")); } { // GUI initializer generated by IntelliJ IDEA GUI Designer @@ -239,9 +235,17 @@ public class ShCodeStylePanel extends CodeStyleAbstractPanel { panel5.add(spacer3, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); } - installPreviewPanel(myRightPanel); myProject = ProjectUtil.getProject(getPanel()); + + myShfmtDownloadLink.addActionListener(e -> { + ShFormatterDownloader.getInstance().download(myProject, + () -> myShfmtPathSelector.setText(ShSettings.getShfmtPath(myProject)), + () -> myErrorLabel.setVisible(true)); + }); + + installPreviewPanel(myRightPanel); + myShfmtPathSelector.addBrowseFolderListener(myProject, FileChooserDescriptorFactory.createSingleFileDescriptor() .withTitle(ShBundle.message("sh.code.style.choose.path"))); myShfmtPathSelector.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {