Skip to content

Commit 90cc3fd

Browse files
committed
Added restriction to always select a value from the dropdown
1 parent 2a9c504 commit 90cc3fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewWebApiDeclarationDialog.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.magento.idea.magento2plugin.actions.generation.generator.xml.WebApiDeclarationGenerator;
1919
import com.magento.idea.magento2plugin.magento.packages.HttpMethod;
2020
import com.magento.idea.magento2plugin.magento.packages.WebApiResource;
21-
import com.magento.idea.magento2plugin.ui.FilteredComboBox;
2221
import com.magento.idea.magento2plugin.util.magento.GetAclResourcesListUtil;
2322
import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil;
2423
import java.awt.event.KeyEvent;
@@ -56,7 +55,7 @@ public class NewWebApiDeclarationDialog extends AbstractDialog {
5655
private JComboBox<ComboBoxItemData> httpMethod;
5756
private JTextField serviceClass;
5857
private JTextField serviceMethod;
59-
private JComboBox aclResource;
58+
private JComboBox<ComboBoxItemData> aclResource;
6059

6160
// labels
6261
private JLabel routeUrlLabel;//NOPMD
@@ -170,6 +169,7 @@ private void fillPredefinedValuesAndDisableInputs() {
170169
@SuppressWarnings({"PMD.UnusedPrivateMethod", "PMD.AvoidInstantiatingObjectsInLoops"})
171170
private void createUIComponents() {
172171
httpMethod = new ComboBox<>();
172+
aclResource = new ComboBox<>();
173173

174174
for (final String method : HttpMethod.getHttpMethodList()) {
175175
httpMethod.addItem(new ComboBoxItemData(method, method));
@@ -179,7 +179,9 @@ private void createUIComponents() {
179179
final List<String> defaultResources = WebApiResource.getDefaultResourcesList();
180180
defaultResources.addAll(aclResources);
181181

182-
aclResource = new FilteredComboBox(defaultResources);
182+
for (final String acl : defaultResources) {
183+
aclResource.addItem(new ComboBoxItemData(acl, acl));
184+
}
183185
}
184186

185187
/**

0 commit comments

Comments
 (0)