Skip to content

Commit b6b22ff

Browse files
committed
Configuration dialog ui
1 parent 93917f3 commit b6b22ff

3 files changed

Lines changed: 108 additions & 53 deletions

File tree

src/com/dengzii/plugin/template/ui/ConfigDialog.form

Lines changed: 65 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,62 +7,22 @@
77
<properties/>
88
<border type="none"/>
99
<children>
10-
<grid id="3ee62" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="0">
10+
<grid id="3ee62" binding="toolbarPanel" layout-manager="FlowLayout" hgap="12" vgap="5" flow-align="0">
1111
<constraints border-constraint="North"/>
1212
<properties/>
1313
<border type="none"/>
1414
<children>
15-
<component id="a8d0" class="javax.swing.JButton" binding="button1" default-binding="true">
15+
<component id="a4081" class="javax.swing.JLabel" binding="labelAdd">
1616
<constraints/>
1717
<properties>
18-
<text value="Button"/>
18+
<background color="-12514048"/>
19+
<text value="+"/>
1920
</properties>
2021
</component>
2122
</children>
2223
</grid>
23-
<grid id="e3588" layout-manager="BorderLayout" hgap="0" vgap="0">
24-
<constraints border-constraint="Center"/>
25-
<properties/>
26-
<border type="none"/>
27-
<children>
28-
<grid id="6e9e7" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
29-
<margin top="6" left="6" bottom="6" right="6"/>
30-
<constraints border-constraint="West"/>
31-
<properties/>
32-
<border type="empty"/>
33-
<children>
34-
<scrollpane id="51ec5">
35-
<constraints>
36-
<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"/>
37-
</constraints>
38-
<properties/>
39-
<border type="empty"/>
40-
<children>
41-
<component id="1e704" class="javax.swing.JList" binding="list1" default-binding="true">
42-
<constraints/>
43-
<properties>
44-
<model>
45-
<item value="Auc Frame Feature"/>
46-
<item value="Auc Frame App"/>
47-
<item value="Auc Frame Export"/>
48-
<item value="Auc Frame Pkg"/>
49-
</model>
50-
</properties>
51-
</component>
52-
</children>
53-
</scrollpane>
54-
</children>
55-
</grid>
56-
<grid id="6f1c1" layout-manager="BorderLayout" hgap="0" vgap="0">
57-
<constraints border-constraint="Center"/>
58-
<properties/>
59-
<border type="none"/>
60-
<children/>
61-
</grid>
62-
</children>
63-
</grid>
6424
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
65-
<margin top="0" left="0" bottom="0" right="0"/>
25+
<margin top="5" left="15" bottom="15" right="15"/>
6626
<constraints border-constraint="South"/>
6727
<properties/>
6828
<border type="none"/>
@@ -72,34 +32,89 @@
7232
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
7333
</constraints>
7434
</hspacer>
75-
<grid id="9538f" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="true" same-size-vertically="false" hgap="-1" vgap="-1">
35+
<grid id="9538f" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
7636
<margin top="0" left="0" bottom="0" right="0"/>
7737
<constraints>
7838
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
7939
</constraints>
8040
<properties/>
8141
<border type="none"/>
8242
<children>
83-
<component id="e7465" class="javax.swing.JButton" binding="buttonOK">
43+
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
8444
<constraints>
8545
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
8646
</constraints>
8747
<properties>
88-
<text value="OK"/>
48+
<text value="Cancel"/>
8949
</properties>
9050
</component>
91-
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
51+
<component id="e7465" class="javax.swing.JButton" binding="btApply">
9252
<constraints>
9353
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
9454
</constraints>
9555
<properties>
96-
<text value="Cancel"/>
56+
<text value="Apply"/>
9757
</properties>
9858
</component>
9959
</children>
10060
</grid>
10161
</children>
10262
</grid>
63+
<grid id="83eca" layout-manager="BorderLayout" hgap="0" vgap="0">
64+
<constraints border-constraint="Center"/>
65+
<properties/>
66+
<border type="none"/>
67+
<children>
68+
<grid id="e3588" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
69+
<margin top="0" left="0" bottom="0" right="0"/>
70+
<constraints border-constraint="Center"/>
71+
<properties/>
72+
<border type="empty">
73+
<size top="5" left="12" bottom="5" right="12"/>
74+
</border>
75+
<children>
76+
<grid id="6e9e7" layout-manager="BorderLayout" hgap="5" vgap="5">
77+
<constraints>
78+
<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"/>
79+
</constraints>
80+
<properties/>
81+
<border type="etched"/>
82+
<children>
83+
<scrollpane id="51ec5">
84+
<constraints border-constraint="Center"/>
85+
<properties/>
86+
<border type="empty">
87+
<size top="10" left="8" bottom="5" right="8"/>
88+
</border>
89+
<children>
90+
<component id="1e704" class="javax.swing.JList" binding="list1" default-binding="true">
91+
<constraints/>
92+
<properties>
93+
<model>
94+
<item value="Auc Frame Feature ----------------------------------- "/>
95+
<item value="Auc Frame App"/>
96+
<item value="Auc Frame Export"/>
97+
<item value="Auc Frame Pkg"/>
98+
</model>
99+
</properties>
100+
</component>
101+
</children>
102+
</scrollpane>
103+
</children>
104+
</grid>
105+
<grid id="14954" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
106+
<margin top="0" left="0" bottom="0" right="0"/>
107+
<constraints>
108+
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
109+
</constraints>
110+
<properties/>
111+
<border type="none"/>
112+
<children/>
113+
</grid>
114+
</children>
115+
</grid>
116+
</children>
117+
</grid>
103118
</children>
104119
</grid>
105120
</form>
Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,56 @@
11
package com.dengzii.plugin.template.ui;
22

3+
import com.intellij.icons.AllIcons;
4+
35
import javax.swing.*;
6+
import java.awt.*;
7+
import java.awt.event.KeyEvent;
48

59
public class ConfigDialog extends JDialog {
610
private JPanel contentPane;
7-
private JButton buttonOK;
11+
private JButton btApply;
812
private JButton buttonCancel;
913
private JList list1;
10-
private JButton button1;
14+
private JPanel toolbarPanel;
15+
private JButton btAdd;
16+
private JLabel labelAdd;
1117

1218
public ConfigDialog() {
1319
setContentPane(contentPane);
1420
setModal(true);
15-
getRootPane().setDefaultButton(buttonOK);
21+
getRootPane().setDefaultButton(btApply);
22+
}
23+
24+
public static void createAndShow(){
25+
ConfigDialog configDialog = new ConfigDialog();
26+
configDialog.initDialog();
27+
configDialog.pack();
28+
configDialog.setVisible(true);
29+
}
30+
31+
private void initDialog() {
32+
33+
Dimension screen = getToolkit().getScreenSize();
34+
int w = screen.width / 3 + 160;
35+
int h = 600;
36+
int x = screen.width / 2 - w / 2;
37+
int y = screen.height / 2 - h / 2;
38+
setLocation(x, y);
39+
setPreferredSize(new Dimension(w, h));
40+
41+
setTitle("Configure Template");
42+
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
43+
contentPane.registerKeyboardAction(e -> dispose(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
44+
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
45+
46+
btAdd.setBorder(null);
47+
48+
btAdd.setIcon(AllIcons.General.GearPlain);
49+
labelAdd.setIcon(AllIcons.General.GearPlain);
50+
51+
}
52+
53+
public static void main(String[] args) {
54+
createAndShow();
1655
}
1756
}

src/com/dengzii/plugin/template/ui/CreateModuleDialog.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ private void onPreviousClick(ActionEvent e) {
8585
}
8686

8787
private void onConfClick(ActionEvent e) {
88+
ConfigDialog.createAndShow();
8889
setPanel();
8990
setButton();
9091
}

0 commit comments

Comments
 (0)