diff --git a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java b/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java index 127a58a1391e..9cc4db498c5c 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import com.intellij.ide.highlighter.JavaFileType; import com.intellij.openapi.editor.event.DocumentAdapter; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.project.Project; +import com.intellij.openapi.ui.Splitter; import com.intellij.openapi.ui.VerticalFlowLayout; import com.intellij.psi.*; import com.intellij.psi.util.PsiFormatUtil; @@ -338,8 +339,12 @@ public class ExtractMethodDialog extends AbstractExtractDialog { protected JComponent createCenterPanel() { myCenterPanel = new JPanel(new BorderLayout()); createParametersPanel(); - myCenterPanel.add(createSignaturePanel(), BorderLayout.SOUTH); - return myCenterPanel; + + final Splitter splitter = new Splitter(true); + splitter.setShowDividerIcon(false); + splitter.setFirstComponent(myCenterPanel); + splitter.setSecondComponent(createSignaturePanel()); + return splitter; } protected boolean isOutputVariable(PsiVariable var) { @@ -352,6 +357,7 @@ public class ExtractMethodDialog extends AbstractExtractDialog { } myParamTable = createParameterTableComponent(); + myParamTable.setMinimumSize(new Dimension(500, 100)); myCenterPanel.add(myParamTable, BorderLayout.CENTER); final JTable table = UIUtil.findComponentOfType(myParamTable, JTable.class); myCenterPanel.add(SeparatorFactory.createSeparator("&Parameters", table), BorderLayout.NORTH); diff --git a/platform/lang-impl/src/com/intellij/refactoring/ui/MethodSignatureComponent.java b/platform/lang-impl/src/com/intellij/refactoring/ui/MethodSignatureComponent.java index 83755a0b2f8f..5f2cd6cdd595 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/ui/MethodSignatureComponent.java +++ b/platform/lang-impl/src/com/intellij/refactoring/ui/MethodSignatureComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,8 +45,6 @@ public class MethodSignatureComponent extends EditorTextField { setText(signature); final EditorEx editor = (EditorEx)getEditor(); if (editor != null) { - editor.setHorizontalScrollbarVisible(true); - editor.setVerticalScrollbarVisible(true); editor.getScrollingModel().scrollVertically(0); editor.getScrollingModel().scrollHorizontally(0); } @@ -60,6 +58,8 @@ public class MethodSignatureComponent extends EditorTextField { editor.setHighlighter(EditorHighlighterFactory.getInstance().createEditorHighlighter(getProject(), fileName)); } editor.getSettings().setWhitespacesShown(false); + editor.setHorizontalScrollbarVisible(true); + editor.setVerticalScrollbarVisible(true); return editor; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.form b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.form index dd89443258c5..357658cf222c 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.form +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/method/GroovyExtractMethodDialog.form @@ -1,6 +1,6 @@
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 60343f373f22..d6f2b0425d9c 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 @@ -21,17 +21,20 @@ import com.intellij.openapi.editor.event.DocumentListener; import com.intellij.openapi.help.HelpManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.ui.Splitter; import com.intellij.psi.PsiModifier; import com.intellij.refactoring.HelpID; import com.intellij.refactoring.ui.ComboBoxVisibilityPanel; import com.intellij.refactoring.ui.MethodSignatureComponent; import com.intellij.ui.EditorTextField; +import com.intellij.ui.IdeBorderFactory; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.GroovyFileType; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod; import org.jetbrains.plugins.groovy.refactoring.GroovyNamesUtil; +import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle; import org.jetbrains.plugins.groovy.refactoring.extract.ExtractUtil; import org.jetbrains.plugins.groovy.refactoring.extract.InitialInfo; import org.jetbrains.plugins.groovy.refactoring.extract.ParameterTablePanel; @@ -64,6 +67,7 @@ public class GroovyExtractMethodDialog extends DialogWrapper { private JLabel myNameLabel; private MethodSignatureComponent mySignature; private ComboBoxVisibilityPanel myVisibilityPanel; + private Splitter mySplitter; private ParameterTablePanel myParameterTablePanel; private final Project myProject; @@ -82,6 +86,15 @@ public class GroovyExtractMethodDialog extends DialogWrapper { update(); } + @Override + protected void init() { + super.init(); + mySplitter.setOrientation(true); + mySplitter.setShowDividerIcon(false); + mySplitter.setFirstComponent(myParameterTablePanel); + mySplitter.setSecondComponent(mySignature); + } + protected void doOKAction() { String name = getEnteredName(); if (name == null) return; @@ -184,6 +197,9 @@ public class GroovyExtractMethodDialog extends DialogWrapper { mySignature = new GrMethodSignatureComponent("", myProject); mySignature.setPreferredSize(new Dimension(500, 100)); mySignature.setMinimumSize(new Dimension(500, 100)); + mySignature.setBorder( + IdeBorderFactory.createTitledBorder(GroovyRefactoringBundle.message("signature.preview.border.title"), false, false, true)); + mySignature.setFocusable(false); myNameField = new EditorTextField("", myProject, GroovyFileType.GROOVY_FILE_TYPE); myVisibilityPanel = new GroovyComboboxVisibilityPanel();