|
36 | 36 | import com.microsoft.azuretools.authmanage.SubscriptionManager; |
37 | 37 | import com.microsoft.azuretools.authmanage.models.SubscriptionDetail; |
38 | 38 | import com.microsoft.azuretools.ijidea.actions.SelectSubscriptionsAction; |
| 39 | +import com.microsoft.azuretools.ijidea.utility.JTableUtils; |
39 | 40 | import com.microsoft.azuretools.sdkmanage.AzureManager; |
40 | 41 | import com.microsoft.azuretools.telemetry.AppInsightsClient; |
41 | 42 | import com.microsoft.azuretools.telemetrywrapper.EventType; |
|
50 | 51 | import javax.swing.*; |
51 | 52 | import javax.swing.table.DefaultTableModel; |
52 | 53 | import javax.swing.table.TableColumn; |
53 | | -import java.awt.event.MouseAdapter; |
54 | | -import java.awt.event.MouseEvent; |
55 | 54 | import java.util.List; |
56 | 55 |
|
57 | 56 | import static com.microsoft.azuretools.telemetry.TelemetryConstants.ACCOUNT; |
@@ -156,30 +155,10 @@ private void createUIComponents() { |
156 | 155 | column.setHeaderValue(""); // Don't show title text |
157 | 156 | column.setMinWidth(23); |
158 | 157 | column.setMaxWidth(23); |
| 158 | + JTableUtils.enableBatchSelection(table, CHECKBOX_COLUMN); |
159 | 159 | table.getTableHeader().setReorderingAllowed(false); |
160 | 160 | new TableSpeedSearch(table); |
161 | 161 |
|
162 | | - // secret functionality: select all subs |
163 | | - table.getTableHeader().addMouseListener(new MouseAdapter() { |
164 | | - @Override |
165 | | - public void mouseClicked(MouseEvent e) { |
166 | | - int col = table.columnAtPoint(e.getPoint()); |
167 | | - if (col == CHECKBOX_COLUMN) { |
168 | | - boolean anySelected = false; |
169 | | - for (int row = 0; row < table.getRowCount(); row++) { |
170 | | - Boolean b = (Boolean) table.getValueAt(row, CHECKBOX_COLUMN); |
171 | | - if (b) { |
172 | | - anySelected = true; |
173 | | - break; |
174 | | - } |
175 | | - } |
176 | | - for (int row = 0; row < table.getRowCount(); row++) { |
177 | | - table.getModel().setValueAt(!anySelected, row, CHECKBOX_COLUMN); |
178 | | - } |
179 | | - } |
180 | | - } |
181 | | - }); |
182 | | - |
183 | 162 | AnActionButton refreshAction = new AnActionButton("Refresh", AllIcons.Actions.Refresh) { |
184 | 163 | @Override |
185 | 164 | public void actionPerformed(AnActionEvent anActionEvent) { |
|
0 commit comments