5
5
import com .intellij .openapi .ui .ComboBox ;
6
6
import com .intellij .ui .ToolbarDecorator ;
7
7
import com .intellij .ui .table .TableView ;
8
+ import com .intellij .uiDesigner .core .GridConstraints ;
9
+ import com .intellij .uiDesigner .core .GridLayoutManager ;
10
+ import com .intellij .uiDesigner .core .Spacer ;
8
11
import com .intellij .util .ui .ColumnInfo ;
9
12
import com .intellij .util .ui .ListTableModel ;
10
13
import com .jetbrains .php .lang .psi .elements .PhpClass ;
@@ -67,7 +70,7 @@ public void init() {
67
70
this .closeButton .addActionListener (e -> onCancel ());
68
71
69
72
this .getRootPane ().registerKeyboardAction (e ->
70
- onCancel (),
73
+ onCancel (),
71
74
KeyStroke .getKeyStroke (KeyEvent .VK_ESCAPE , 0 ),
72
75
JComponent .WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
73
76
);
@@ -97,15 +100,51 @@ private void createUIComponents() {
97
100
this .tableView .setModelAndUpdateColumns (this .modelList );
98
101
99
102
mainPanel .add (ToolbarDecorator .createDecorator (this .tableView )
100
- .disableAddAction ()
101
- .disableDownAction ()
102
- .disableRemoveAction ()
103
- .disableUpDownActions ()
104
- .createPanel ()
103
+ .disableAddAction ()
104
+ .disableDownAction ()
105
+ .disableRemoveAction ()
106
+ .disableUpDownActions ()
107
+ .createPanel ()
105
108
);
106
109
107
110
}
108
111
112
+ {
113
+ // GUI initializer generated by IntelliJ IDEA GUI Designer
114
+ // >>> IMPORTANT!! <<<
115
+ // DO NOT EDIT OR ADD ANY CODE HERE!
116
+ $$$setupUI$$$ ();
117
+ }
118
+
119
+ /**
120
+ * Method generated by IntelliJ IDEA GUI Designer
121
+ * >>> IMPORTANT!! <<<
122
+ * DO NOT edit this method OR call it in your code!
123
+ *
124
+ * @noinspection ALL
125
+ */
126
+ private void $$$setupUI$$$ () {
127
+ createUIComponents ();
128
+ panel1 = new JPanel ();
129
+ panel1 .setLayout (new GridLayoutManager (2 , 3 , new Insets (5 , 5 , 5 , 5 ), -1 , -1 ));
130
+ generateButton = new JButton ();
131
+ generateButton .setText ("Generate" );
132
+ panel1 .add (generateButton , new GridConstraints (1 , 2 , 1 , 1 , GridConstraints .ANCHOR_CENTER , GridConstraints .FILL_HORIZONTAL , GridConstraints .SIZEPOLICY_CAN_SHRINK | GridConstraints .SIZEPOLICY_CAN_GROW , GridConstraints .SIZEPOLICY_FIXED , null , null , null , 0 , false ));
133
+ closeButton = new JButton ();
134
+ closeButton .setText ("Close" );
135
+ panel1 .add (closeButton , new GridConstraints (1 , 1 , 1 , 1 , GridConstraints .ANCHOR_CENTER , GridConstraints .FILL_HORIZONTAL , GridConstraints .SIZEPOLICY_CAN_SHRINK | GridConstraints .SIZEPOLICY_CAN_GROW , GridConstraints .SIZEPOLICY_FIXED , null , null , null , 0 , false ));
136
+ final Spacer spacer1 = new Spacer ();
137
+ panel1 .add (spacer1 , new GridConstraints (1 , 0 , 1 , 1 , GridConstraints .ANCHOR_CENTER , GridConstraints .FILL_HORIZONTAL , GridConstraints .SIZEPOLICY_WANT_GROW , 1 , null , null , null , 0 , false ));
138
+ panel1 .add (mainPanel , new GridConstraints (0 , 0 , 1 , 3 , GridConstraints .ANCHOR_CENTER , GridConstraints .FILL_BOTH , GridConstraints .SIZEPOLICY_CAN_SHRINK | GridConstraints .SIZEPOLICY_WANT_GROW , GridConstraints .SIZEPOLICY_CAN_SHRINK | GridConstraints .SIZEPOLICY_WANT_GROW , null , null , null , 0 , false ));
139
+ }
140
+
141
+ /**
142
+ * @noinspection ALL
143
+ */
144
+ public JComponent $$$getRootComponent$$$ () {
145
+ return panel1 ;
146
+ }
147
+
109
148
private static class ServiceParameter {
110
149
111
150
private final String classFqn ;
@@ -117,7 +156,7 @@ public ServiceParameter(String classFqn, Set<String> possibleServices) {
117
156
this .classFqn = classFqn ;
118
157
this .possibleServices = possibleServices ;
119
158
120
- if (!possibleServices .isEmpty ()) {
159
+ if (!possibleServices .isEmpty ()) {
121
160
currentService = possibleServices .iterator ().next ();
122
161
}
123
162
@@ -159,16 +198,16 @@ public NamespaceColumn() {
159
198
public String valueOf (ServiceParameter modelParameter ) {
160
199
161
200
String classFqn = modelParameter .getClassFqn ();
162
- if (StringUtils .isBlank (classFqn )) {
201
+ if (StringUtils .isBlank (classFqn )) {
163
202
return "unknown" ;
164
203
}
165
204
166
- if (classFqn .startsWith ("\\ " )) {
205
+ if (classFqn .startsWith ("\\ " )) {
167
206
classFqn = classFqn .substring (1 );
168
207
}
169
208
170
209
int i = classFqn .lastIndexOf ("\\ " );
171
- if (i > 0 ) {
210
+ if (i > 0 ) {
172
211
String ns = classFqn .substring (0 , i );
173
212
String clazz = classFqn .substring (i + 1 );
174
213
classFqn = String .format ("%s [%s]" , clazz , ns );
@@ -191,7 +230,7 @@ public String valueOf(ServiceParameter modelParameter) {
191
230
return modelParameter .getCurrentService ();
192
231
}
193
232
194
- public void setValue (ServiceParameter modelParameter , String value ){
233
+ public void setValue (ServiceParameter modelParameter , String value ) {
195
234
modelParameter .setCurrentService (value );
196
235
tableView .getListTableModel ().fireTableDataChanged ();
197
236
}
@@ -225,7 +264,7 @@ public Icon valueOf(ServiceParameter modelParameter) {
225
264
return classInterface != null ? classInterface .getIcon () : null ;
226
265
}
227
266
228
- public java . lang . Class getColumnClass () {
267
+ public Class getColumnClass () {
229
268
return ImageIcon .class ;
230
269
}
231
270
0 commit comments