|
18 | 18 | import com.magento.idea.magento2plugin.actions.generation.generator.xml.WebApiDeclarationGenerator;
|
19 | 19 | import com.magento.idea.magento2plugin.magento.packages.HttpMethod;
|
20 | 20 | import com.magento.idea.magento2plugin.magento.packages.WebApiResource;
|
21 |
| -import com.magento.idea.magento2plugin.ui.FilteredComboBox; |
| 21 | +import com.magento.idea.magento2plugin.util.magento.GetAclResourcesListUtil; |
22 | 22 | import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil;
|
23 | 23 | import java.awt.event.KeyEvent;
|
24 | 24 | import java.awt.event.WindowAdapter;
|
25 | 25 | import java.awt.event.WindowEvent;
|
| 26 | +import java.util.List; |
26 | 27 | import javax.swing.JButton;
|
27 | 28 | import javax.swing.JComboBox;
|
28 | 29 | import javax.swing.JComponent;
|
@@ -54,7 +55,7 @@ public class NewWebApiDeclarationDialog extends AbstractDialog {
|
54 | 55 | private JComboBox<ComboBoxItemData> httpMethod;
|
55 | 56 | private JTextField serviceClass;
|
56 | 57 | private JTextField serviceMethod;
|
57 |
| - private JComboBox aclResource; |
| 58 | + private JComboBox<ComboBoxItemData> aclResource; |
58 | 59 |
|
59 | 60 | // labels
|
60 | 61 | private JLabel routeUrlLabel;//NOPMD
|
@@ -170,11 +171,19 @@ private void fillPredefinedValuesAndDisableInputs() {
|
170 | 171 | @SuppressWarnings({"PMD.UnusedPrivateMethod", "PMD.AvoidInstantiatingObjectsInLoops"})
|
171 | 172 | private void createUIComponents() {
|
172 | 173 | httpMethod = new ComboBox<>();
|
| 174 | + aclResource = new ComboBox<>(); |
173 | 175 |
|
174 | 176 | for (final String method : HttpMethod.getHttpMethodList()) {
|
175 | 177 | httpMethod.addItem(new ComboBoxItemData(method, method));
|
176 | 178 | }
|
177 |
| - aclResource = new FilteredComboBox(WebApiResource.getDefaultResourcesList()); |
| 179 | + |
| 180 | + final List<String> aclResources = GetAclResourcesListUtil.execute(project); |
| 181 | + final List<String> defaultResources = WebApiResource.getDefaultResourcesList(); |
| 182 | + defaultResources.addAll(aclResources); |
| 183 | + |
| 184 | + for (final String acl : defaultResources) { |
| 185 | + aclResource.addItem(new ComboBoxItemData(acl, acl)); |
| 186 | + } |
178 | 187 | }
|
179 | 188 |
|
180 | 189 | /**
|
|
0 commit comments