|
10 | 10 | import com.intellij.openapi.ui.ComboBoxTableRenderer; |
11 | 11 | import com.intellij.psi.PsiDirectory; |
12 | 12 | import com.magento.idea.magento2plugin.actions.generation.NewDataModelAction; |
| 13 | +import com.magento.idea.magento2plugin.actions.generation.OverrideClassByAPreferenceAction; |
13 | 14 | import com.magento.idea.magento2plugin.actions.generation.data.DataModelData; |
14 | 15 | import com.magento.idea.magento2plugin.actions.generation.data.DataModelInterfaceData; |
| 16 | +import com.magento.idea.magento2plugin.actions.generation.data.PreferenceDiXmFileData; |
15 | 17 | import com.magento.idea.magento2plugin.actions.generation.dialog.validator.annotation.FieldValidation; |
16 | 18 | import com.magento.idea.magento2plugin.actions.generation.dialog.validator.annotation.RuleRegistry; |
17 | 19 | import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.NotEmptyRule; |
18 | 20 | import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.PhpClassRule; |
19 | 21 | import com.magento.idea.magento2plugin.actions.generation.generator.DataModelGenerator; |
20 | 22 | import com.magento.idea.magento2plugin.actions.generation.generator.DataModelInterfaceGenerator; |
| 23 | +import com.magento.idea.magento2plugin.actions.generation.generator.PreferenceDiXmlGenerator; |
21 | 24 | import com.magento.idea.magento2plugin.actions.generation.generator.util.NamespaceBuilder; |
22 | 25 | import com.magento.idea.magento2plugin.magento.files.DataModel; |
23 | 26 | import com.magento.idea.magento2plugin.magento.files.DataModelInterface; |
24 | 27 | import com.magento.idea.magento2plugin.ui.table.ComboBoxEditor; |
25 | 28 | import com.magento.idea.magento2plugin.ui.table.DeleteRowButton; |
26 | 29 | import com.magento.idea.magento2plugin.ui.table.TableButton; |
| 30 | +import com.magento.idea.magento2plugin.util.GetPhpClassByFQN; |
27 | 31 | import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil; |
28 | 32 | import java.awt.event.ActionEvent; |
29 | 33 | import java.awt.event.KeyEvent; |
@@ -123,6 +127,7 @@ private void onOK() { |
123 | 127 | formatProperties(); |
124 | 128 | generateModelInterfaceFile(); |
125 | 129 | generateModelFile(); |
| 130 | + generatePreference(); |
126 | 131 | this.setVisible(false); |
127 | 132 | } |
128 | 133 | } |
@@ -153,6 +158,16 @@ private void generateModelFile() { |
153 | 158 | )).generate(NewDataModelAction.ACTION_NAME, true); |
154 | 159 | } |
155 | 160 |
|
| 161 | + private void generatePreference() { |
| 162 | + new PreferenceDiXmlGenerator(new PreferenceDiXmFileData( |
| 163 | + getModuleName(), |
| 164 | + GetPhpClassByFQN.getInstance(project).execute(getInterfaceFQN()), |
| 165 | + getModelFQN(), |
| 166 | + getModelNamespace(), |
| 167 | + "base" |
| 168 | + ), project).generate(OverrideClassByAPreferenceAction.ACTION_NAME); |
| 169 | + } |
| 170 | + |
156 | 171 | private void buildNamespaces() { |
157 | 172 | interfaceNamespace = new NamespaceBuilder( |
158 | 173 | getModuleName(), getInterfaceName(), DataModelInterface.DIRECTORY |
|
0 commit comments