OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 74 | Rev 139 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 74 Rev 86
Line 108... Line 108...
108
                public void actionPerformed(ActionEvent e) {
108
                public void actionPerformed(ActionEvent e) {
109
                    JComboBox cb = (JComboBox) e.getSource();
109
                    JComboBox cb = (JComboBox) e.getSource();
110
                    int type = cb.getSelectedIndex();
110
                    int type = cb.getSelectedIndex();
111
                    if (type == 0) {
111
                    if (type == 0) {
112
                        comboActionChoice.setModel(new DefaultComboBoxModel(componentIds));
112
                        comboActionChoice.setModel(new DefaultComboBoxModel(componentIds));
-
 
113
 
-
 
114
                        MenuDescriptor desc = extension.getCreateMenuItemFromId(item.getId());
-
 
115
                        desc.setType(MenuDescriptor.CREATE);
-
 
116
                        desc.setListId(null);
-
 
117
                        if (componentIds.size() > 0) {
-
 
118
                            comboActionChoice.setSelectedIndex(0);
-
 
119
                            desc.setComponentId(comboActionChoice.getSelectedItem().toString());
-
 
120
                        } else {
-
 
121
                            desc.setComponentId(null);
-
 
122
                        }
-
 
123
                        extension.setChanged();
113
                    } else {
124
                    } else {
114
                        comboActionChoice.setModel(new DefaultComboBoxModel(listIds));
125
                        comboActionChoice.setModel(new DefaultComboBoxModel(listIds));
-
 
126
                        MenuDescriptor desc = extension.getCreateMenuItemFromId(item.getId());
-
 
127
                        desc.setType(MenuDescriptor.LIST);
-
 
128
                        if (listIds.size() > 0) {
-
 
129
                            comboActionChoice.setSelectedIndex(0);
-
 
130
                            desc.setListId(comboActionChoice.getSelectedItem().toString());
-
 
131
                        } else {
-
 
132
                            desc.setListId(null);
-
 
133
                        }
-
 
134
                        desc.setComponentId(null);
-
 
135
                        extension.setChanged();
115
                    }
136
                    }
116
 
137
 
117
                }
138
                }
118
            });
139
            });
-
 
140
            comboActionChoice.addActionListener(new ActionListener() {
-
 
141
 
-
 
142
                @Override
-
 
143
                public void actionPerformed(ActionEvent e) {
-
 
144
                    MenuDescriptor desc = extension.getCreateMenuItemFromId(item.getId());
-
 
145
                    if (desc.getType() == MenuDescriptor.CREATE) {
-
 
146
                        desc.setComponentId(comboActionChoice.getSelectedItem().toString());
-
 
147
                    } else if (desc.getType() == MenuDescriptor.LIST) {
-
 
148
                        desc.setListId(comboActionChoice.getSelectedItem().toString());
-
 
149
                    } else {
-
 
150
                        desc.setComponentId(null);
-
 
151
                        desc.setListId(null);
-
 
152
                    }
-
 
153
                }
-
 
154
            });
119
 
155
 
120
        }
156
        }
121
        shownInMenu.addActionListener(new ActionListener() {
157
        shownInMenu.addActionListener(new ActionListener() {
122
 
158
 
123
            @Override
159
            @Override