Extract Function: Improve "Extract Function" dialog
This commit is contained in:
+26
-13
@@ -3,7 +3,7 @@
|
|||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="522" height="278"/>
|
<xy x="20" y="20" width="522" height="318"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
@@ -11,25 +11,34 @@
|
|||||||
<grid id="34b30" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="34b30" 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"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<children>
|
||||||
<grid id="fa2d1" binding="inputParametersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
<grid id="fa2d1" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none" title="Parameters"/>
|
<border type="none"/>
|
||||||
<children/>
|
<children>
|
||||||
|
<grid id="2aa47" class="com.intellij.ui.TitledSeparator" binding="inputParametersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||||
|
<constraints border-constraint="Center"/>
|
||||||
|
<properties>
|
||||||
|
<text value=""/>
|
||||||
|
</properties>
|
||||||
|
<border type="none" title="Parameters"/>
|
||||||
|
<children/>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
<grid id="b45d1" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="b45d1" 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"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="-1" height="200"/>
|
<preferred-size width="-1" height="200"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -62,7 +71,7 @@
|
|||||||
<grid id="5fe96" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="5fe96" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<enabled value="true"/>
|
<enabled value="true"/>
|
||||||
@@ -72,7 +81,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<component id="d1d09" class="javax.swing.JLabel" binding="functionNameLabel">
|
<component id="d1d09" class="javax.swing.JLabel" binding="functionNameLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="&Name:"/>
|
<text value="&Name:"/>
|
||||||
@@ -80,7 +89,9 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="52aa7" class="javax.swing.JLabel">
|
<component id="52aa7" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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"/>
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="114" height="16"/>
|
||||||
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<labelFor value="71ee7"/>
|
<labelFor value="71ee7"/>
|
||||||
@@ -90,7 +101,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="bee3c" class="com.intellij.ui.EditorTextField" binding="functionNameField">
|
<component id="bee3c" class="com.intellij.ui.EditorTextField" binding="functionNameField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="150" height="-1"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -98,7 +109,9 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="71ee7" class="javax.swing.JComboBox" binding="visibilityBox">
|
<component id="71ee7" class="javax.swing.JComboBox" binding="visibilityBox">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="114" height="26"/>
|
||||||
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<model>
|
<model>
|
||||||
@@ -114,7 +127,7 @@
|
|||||||
</grid>
|
</grid>
|
||||||
<vspacer id="cd10f">
|
<vspacer id="cd10f">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
+5
-1
@@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project;
|
|||||||
import com.intellij.openapi.ui.DialogWrapper;
|
import com.intellij.openapi.ui.DialogWrapper;
|
||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement;
|
||||||
import com.intellij.ui.EditorTextField;
|
import com.intellij.ui.EditorTextField;
|
||||||
|
import com.intellij.ui.TitledSeparator;
|
||||||
import com.intellij.util.containers.ContainerUtil;
|
import com.intellij.util.containers.ContainerUtil;
|
||||||
import com.intellij.util.containers.MultiMap;
|
import com.intellij.util.containers.MultiMap;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -41,7 +42,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class KotlinExtractFunctionDialog extends DialogWrapper {
|
public class KotlinExtractFunctionDialog extends DialogWrapper {
|
||||||
private JPanel contentPane;
|
private JPanel contentPane;
|
||||||
private JPanel inputParametersPanel;
|
private TitledSeparator inputParametersPanel;
|
||||||
private JComboBox visibilityBox;
|
private JComboBox visibilityBox;
|
||||||
private KotlinFunctionSignatureComponent signaturePreviewField;
|
private KotlinFunctionSignatureComponent signaturePreviewField;
|
||||||
private EditorTextField functionNameField;
|
private EditorTextField functionNameField;
|
||||||
@@ -150,6 +151,9 @@ public class KotlinExtractFunctionDialog extends DialogWrapper {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
parameterTablePanel.init(originalDescriptor.getDescriptor().getParameters());
|
parameterTablePanel.init(originalDescriptor.getDescriptor().getParameters());
|
||||||
|
|
||||||
|
inputParametersPanel.setText("&Parameters");
|
||||||
|
inputParametersPanel.setLabelFor(parameterTablePanel.getTable());
|
||||||
inputParametersPanel.add(parameterTablePanel);
|
inputParametersPanel.add(parameterTablePanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -387,4 +387,9 @@ public class KotlinParameterTablePanel extends JPanel {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public JBTable getTable() {
|
||||||
|
return myTable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user