Skip to content

Commit 8d095a4

Browse files
committed
Restructure method dialog UI elements
1 parent 2ec4c4b commit 8d095a4

File tree

4 files changed

+370
-392
lines changed

4 files changed

+370
-392
lines changed

swan-assist/src/main/java/de/fraunhofer/iem/swan/assist/actions/method/UpdateMethodAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import com.intellij.openapi.project.Project;
1313
import de.fraunhofer.iem.swan.assist.data.JSONFileLoader;
1414
import de.fraunhofer.iem.swan.assist.data.MethodWrapper;
15-
import de.fraunhofer.iem.swan.assist.ui.dialog.MethodPropertiesDialog;
15+
import de.fraunhofer.iem.swan.assist.ui.dialog.MethodDialog;
1616
import org.jetbrains.annotations.NotNull;
1717

1818
import java.util.HashMap;
@@ -43,15 +43,15 @@ public void actionPerformed(@NotNull AnActionEvent anActionEvent) {
4343

4444
final Project project = anActionEvent.getProject();
4545

46-
MethodPropertiesDialog dialog = null;
46+
MethodDialog dialog = null;
4747

4848
if (method.getStatus() == MethodWrapper.MethodStatus.NEW) {
4949

5050
HashMap<String, MethodWrapper> methods = new HashMap<>();
5151
methods.put(method.getSignature(true), method);
52-
dialog = new MethodPropertiesDialog(methods, method.getSignature(true), project, JSONFileLoader.getAllCategories());
52+
dialog = new MethodDialog(methods, method.getSignature(true), project, JSONFileLoader.getAllCategories());
5353
} else
54-
dialog = new MethodPropertiesDialog(JSONFileLoader.getAllMethods(), method.getSignature(true), project, JSONFileLoader.getAllCategories());
54+
dialog = new MethodDialog(JSONFileLoader.getAllMethods(), method.getSignature(true), project, JSONFileLoader.getAllCategories());
5555

5656
dialog.show();
5757
}

swan-assist/src/main/java/de/fraunhofer/iem/swan/assist/ui/dialog/MethodDialog.form

Lines changed: 138 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +1,173 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="de.fraunhofer.iem.swan.assist.ui.dialog.MethodDialog">
3-
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
3+
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
44
<margin top="10" left="10" bottom="10" right="10"/>
55
<constraints>
6-
<xy x="8" y="54" width="570" height="404"/>
6+
<xy x="511" y="54" width="532" height="658"/>
77
</constraints>
88
<properties/>
99
<border type="none"/>
1010
<children>
11-
<grid id="e3588" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
12-
<margin top="0" left="0" bottom="0" right="0"/>
11+
<tabbedpane id="91f35" binding="tab">
1312
<constraints>
14-
<grid row="1" column="0" row-span="1" col-span="5" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
15-
<minimum-size width="300" height="-1"/>
13+
<grid row="1" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
14+
<preferred-size width="200" height="200"/>
1615
</grid>
1716
</constraints>
1817
<properties/>
1918
<border type="none"/>
2019
<children>
21-
<component id="89657" class="javax.swing.JLabel">
20+
<grid id="413f0" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
21+
<margin top="10" left="10" bottom="0" right="0"/>
2222
<constraints>
23-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
23+
<tabbedpane title="Category"/>
2424
</constraints>
25-
<properties>
26-
<text resource-bundle="dialog_messages" key="MethodDialog.Signature"/>
27-
</properties>
28-
</component>
29-
<component id="64564" class="javax.swing.JLabel">
30-
<constraints>
31-
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
32-
</constraints>
33-
<properties>
34-
<text resource-bundle="dialog_messages" key="MethodDialog.Types"/>
35-
</properties>
36-
</component>
37-
<component id="54eae" class="javax.swing.JTextField" binding="methodTypes">
38-
<constraints>
39-
<grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
40-
<preferred-size width="150" height="-1"/>
25+
<properties/>
26+
<border type="none"/>
27+
<children>
28+
<grid id="99050" binding="srmCheckBoxPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
29+
<margin top="0" left="0" bottom="0" right="0"/>
30+
<constraints>
31+
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="1" hsize-policy="1" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
32+
</constraints>
33+
<properties/>
34+
<border type="none" title-resource-bundle="dialog_messages" title-key="MethodDialog.Category.SRM">
35+
<title-color color="-4473925"/>
36+
</border>
37+
<children/>
4138
</grid>
42-
</constraints>
43-
<properties>
44-
<editable value="false"/>
45-
</properties>
46-
</component>
47-
<component id="95897" class="javax.swing.JLabel">
48-
<constraints>
49-
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
50-
</constraints>
51-
<properties>
52-
<text resource-bundle="dialog_messages" key="MethodDialog.CWE"/>
53-
</properties>
54-
</component>
55-
<component id="423a7" class="javax.swing.JTextField" binding="methodCwes">
56-
<constraints>
57-
<grid row="2" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
58-
<preferred-size width="150" height="-1"/>
39+
<grid id="1c966" binding="cweCheckBoxPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
40+
<margin top="0" left="0" bottom="0" right="0"/>
41+
<constraints>
42+
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="1" hsize-policy="1" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
43+
</constraints>
44+
<properties/>
45+
<border type="none" title-resource-bundle="dialog_messages" title-key="MethodDialog.Category.CWE">
46+
<title-color color="-4473925"/>
47+
</border>
48+
<children/>
5949
</grid>
60-
</constraints>
61-
<properties>
62-
<editable value="false"/>
63-
</properties>
64-
</component>
65-
<component id="a1d5a" class="javax.swing.JComboBox" binding="signatureCbx">
50+
</children>
51+
</grid>
52+
<grid id="57fa9" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
53+
<margin top="10" left="10" bottom="0" right="0"/>
6654
<constraints>
67-
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
55+
<tabbedpane title="Parameters"/>
6856
</constraints>
6957
<properties/>
70-
</component>
71-
</children>
72-
</grid>
73-
<component id="a8a24" class="javax.swing.JSeparator">
74-
<constraints>
75-
<grid row="2" column="0" row-span="1" col-span="5" vsize-policy="0" hsize-policy="0" anchor="0" fill="3" indent="0" use-parent-layout="false">
76-
<preferred-size width="0" height="10"/>
77-
</grid>
78-
</constraints>
79-
<properties/>
80-
</component>
81-
<component id="5e892" class="javax.swing.JList" binding="selectedList">
82-
<constraints>
83-
<grid row="5" column="3" row-span="1" col-span="2" vsize-policy="6" hsize-policy="0" anchor="0" fill="3" indent="0" use-parent-layout="false">
84-
<preferred-size width="150" height="100"/>
85-
</grid>
86-
</constraints>
87-
<properties/>
88-
</component>
89-
<component id="a3b83" class="javax.swing.JList" binding="availableList">
90-
<constraints>
91-
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="0" anchor="0" fill="3" indent="0" use-parent-layout="false">
92-
<preferred-size width="150" height="100"/>
58+
<border type="none"/>
59+
<children>
60+
<grid id="6782c" binding="parametersTabPanel" layout-manager="GridBagLayout">
61+
<constraints>
62+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
63+
</constraints>
64+
<properties/>
65+
<border type="none"/>
66+
<children>
67+
<grid id="97219" binding="dataInPanel" layout-manager="GridBagLayout">
68+
<constraints>
69+
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="1" anchor="1" fill="1" indent="1" use-parent-layout="false"/>
70+
<gridbag weightx="0.05" weighty="1.0"/>
71+
</constraints>
72+
<properties/>
73+
<border type="none" title="Data-In"/>
74+
<children/>
75+
</grid>
76+
<grid id="146a0" binding="dataOutPanel" layout-manager="GridBagLayout">
77+
<constraints>
78+
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="1" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
79+
<gridbag weightx="0.05" weighty="1.0"/>
80+
</constraints>
81+
<properties/>
82+
<border type="none" title="Data-Out"/>
83+
<children/>
84+
</grid>
85+
<grid id="a73fc" binding="parametersPanel" layout-manager="GridBagLayout">
86+
<constraints>
87+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
88+
<gridbag weightx="0.9" weighty="1.0"/>
89+
</constraints>
90+
<properties/>
91+
<border type="none" title="Parameters"/>
92+
<children/>
93+
</grid>
94+
<component id="93981" class="javax.swing.JCheckBox" binding="dataInReturnCheckBox">
95+
<constraints>
96+
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
97+
<gridbag weightx="0.1" weighty="0.0"/>
98+
</constraints>
99+
<properties>
100+
<text value="Return"/>
101+
</properties>
102+
</component>
103+
<component id="3740f" class="javax.swing.JCheckBox" binding="dataOutReturnCheckBox">
104+
<constraints>
105+
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
106+
<gridbag weightx="0.1" weighty="0.0"/>
107+
</constraints>
108+
<properties>
109+
<text value="Return"/>
110+
</properties>
111+
</component>
112+
</children>
113+
</grid>
114+
</children>
93115
</grid>
94-
</constraints>
95-
<properties/>
96-
</component>
97-
<component id="1d280" class="javax.swing.JLabel">
98-
<constraints>
99-
<grid row="4" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
100-
</constraints>
101-
<properties>
102-
<font style="1"/>
103-
<text resource-bundle="dialog_messages" key="MethodDialog.SelectedCategory"/>
104-
</properties>
105-
</component>
106-
<grid id="e2bff" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
107-
<margin top="0" left="0" bottom="0" right="0"/>
108-
<constraints>
109-
<grid row="3" column="0" row-span="1" col-span="5" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
110-
</constraints>
111-
<properties/>
112-
<border type="none"/>
113-
<children>
114-
<component id="46852" class="javax.swing.JLabel">
116+
<grid id="54f3e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
117+
<margin top="10" left="10" bottom="0" right="0"/>
115118
<constraints>
116-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="4" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
119+
<tabbedpane title="Properties"/>
117120
</constraints>
118-
<properties>
119-
<font style="1"/>
120-
<text resource-bundle="dialog_messages" key="MethodDialog.Category"/>
121-
</properties>
122-
</component>
123-
<component id="84375" class="javax.swing.JRadioButton" binding="cweRadioButton">
124-
<constraints>
125-
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
126-
<preferred-size width="156" height="26"/>
121+
<properties/>
122+
<border type="none"/>
123+
<children>
124+
<grid id="e3588" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
125+
<margin top="10" left="0" bottom="0" right="0"/>
126+
<constraints>
127+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
128+
</constraints>
129+
<properties/>
130+
<border type="none"/>
131+
<children>
132+
<scrollpane id="4d5e7">
133+
<constraints>
134+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="4" hsize-policy="5" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
135+
</constraints>
136+
<properties/>
137+
<border type="none"/>
138+
<children>
139+
<component id="e9d57" class="com.intellij.ui.table.JBTable" binding="propertiesTable">
140+
<constraints/>
141+
<properties>
142+
<fillsViewportHeight value="true"/>
143+
<preferredScrollableViewportSize width="500" height="42"/>
144+
<striped value="true"/>
145+
</properties>
146+
</component>
147+
</children>
148+
</scrollpane>
149+
</children>
127150
</grid>
128-
</constraints>
129-
<properties>
130-
<text resource-bundle="dialog_messages" key="MethodDialog.CWE"/>
131-
</properties>
132-
</component>
133-
<hspacer id="66ab">
134-
<constraints>
135-
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
136-
</constraints>
137-
</hspacer>
138-
<component id="f9050" class="javax.swing.JRadioButton" binding="typeRadioButton">
139-
<constraints>
140-
<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"/>
141-
</constraints>
142-
<properties>
143-
<text resource-bundle="dialog_messages" key="MethodDialog.Types"/>
144-
</properties>
145-
</component>
151+
</children>
152+
</grid>
146153
</children>
147-
</grid>
148-
<component id="7b574" class="javax.swing.JSeparator">
154+
</tabbedpane>
155+
<component id="9be31" class="javax.swing.JLabel">
149156
<constraints>
150-
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
157+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
151158
</constraints>
152-
<properties/>
153-
</component>
154-
<component id="ae89b" class="javax.swing.JSeparator">
155-
<constraints>
156-
<grid row="4" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
157-
</constraints>
158-
<properties/>
159+
<properties>
160+
<text resource-bundle="dialog_messages" key="MethodDialog.Signature"/>
161+
</properties>
159162
</component>
160-
<component id="501ed" class="javax.swing.JLabel">
163+
<component id="37a2d" class="javax.swing.JComboBox" binding="signatureCbx">
161164
<constraints>
162-
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
165+
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false">
166+
<preferred-size width="300" height="-1"/>
167+
</grid>
163168
</constraints>
164169
<properties>
165-
<font style="1"/>
166-
<text resource-bundle="dialog_messages" key="MethodDialog.AvailableCategory"/>
170+
<model/>
167171
</properties>
168172
</component>
169173
</children>

0 commit comments

Comments
 (0)