form.addSpace(5);
Interface[] ifaces = getInterfaces(project);
DefaultComboBoxModel serviceComboModel = new DefaultComboBoxModel();
serviceCombo = form.appendComboBox("REST Services", serviceComboModel, "Target Service");
serviceCombo.setRenderer(new ModelItemListCellRenderer());
for (Interface element : ifaces) {
if (element instanceof RestService) {
serviceComboModel.addElement(element);
}
}
resourceCombo = form.appendComboBox("REST Resources", ((RestService) serviceCombo.getSelectedItem())
.getOperationList().toArray(), "Target Resource");
resourceCombo.setRenderer(new ModelItemListCellRenderer());
methodCombo = form.appendComboBox("REST Methods", ((RestResource) resourceCombo.getSelectedItem())
.getRestMethodList().toArray(), "Target Method");
methodCombo.setRenderer(new ModelItemListCellRenderer());
serviceCombo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Interface iface = project.getInterfaceByName(((Interface) serviceCombo.getSelectedItem()).getName());
resourceCombo.removeAllItems();