|
11 | 11 | import javax.swing.border.EmptyBorder;
|
12 | 12 | import java.awt.event.*;
|
13 | 13 | import java.util.HashMap;
|
| 14 | +import java.util.Iterator; |
14 | 15 | import java.util.List;
|
15 | 16 |
|
16 | 17 | public class ModelTableDialog extends JDialog implements ClassesListDelegate.OnClassSelectedListener {
|
@@ -60,7 +61,7 @@ public ModelTableDialog(List<ClassModel> data, LanguageResolver resolver, ModelT
|
60 | 61 | classesListDelegate = new ClassesListDelegate(table1, data, classNames, this);
|
61 | 62 | fieldsTableDelegate = new FieldsTableDelegate(fieldsTable, classNames, resolver);
|
62 | 63 | fieldsTableDelegate.setClass(data.get(0));
|
63 |
| - claasesListLabel.setBorder(new EmptyBorder(0,0,10,0)); |
| 64 | + claasesListLabel.setBorder(new EmptyBorder(0, 0, 10, 0)); |
64 | 65 | }
|
65 | 66 |
|
66 | 67 | private void init() {
|
@@ -132,10 +133,16 @@ private void onOK() {
|
132 | 133 | if (className != null) {
|
133 | 134 | classModel.name = className;
|
134 | 135 | }
|
135 |
| - for (FieldModel field : classModel.fields) { |
136 |
| - String fieldClassName = classNames.get(field.type); |
137 |
| - if (fieldClassName != null) { |
138 |
| - field.type = fieldClassName; |
| 136 | + Iterator<FieldModel> iterator = classModel.fields.iterator(); |
| 137 | + while (iterator.hasNext()) { |
| 138 | + FieldModel field = iterator.next(); |
| 139 | + if (!field.enabled) { |
| 140 | + iterator.remove(); |
| 141 | + } else { |
| 142 | + String fieldClassName = classNames.get(field.type); |
| 143 | + if (fieldClassName != null) { |
| 144 | + field.type = fieldClassName; |
| 145 | + } |
139 | 146 | }
|
140 | 147 | }
|
141 | 148 | }
|
|
0 commit comments