add splitter into GroovyExtractDialog

This commit is contained in:
Maxim.Medvedev
2012-01-20 11:24:17 +04:00
parent cb827265ac
commit 997432fab6
2 changed files with 23 additions and 38 deletions
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.plugins.groovy.refactoring.extract.method.GroovyExtractMethodDialog">
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="48" y="54" width="555" height="380"/>
@@ -8,43 +8,6 @@
<properties/>
<border type="none"/>
<children>
<grid id="181d3" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/>
</clientProperties>
<border type="etched" title-resource-bundle="org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringBundle" title-key="signature.preview.border.title"/>
<children>
<component id="703ba" class="com.intellij.refactoring.ui.MethodSignatureComponent" binding="mySignature" custom-create="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="150" height="50"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
<grid id="de338" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="17c7e" class="org.jetbrains.plugins.groovy.refactoring.extract.ParameterTablePanel" binding="myParameterTablePanel" custom-create="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
</children>
</grid>
<component id="26cfa" class="javax.swing.JCheckBox" binding="myCbSpecifyType">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
@@ -100,6 +63,12 @@
</grid>
</children>
</grid>
<component id="f6553" class="com.intellij.openapi.ui.Splitter" binding="mySplitter">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
</children>
</grid>
</form>
@@ -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();