use of com.intellij.ui.TableSpeedSearch in project azure-tools-for-java by Microsoft.
the class SubscriptionsDialog method createUIComponents.
private void createUIComponents() {
contentPane = new JPanel();
contentPane.setPreferredSize(new Dimension(350, 200));
DefaultTableModel model = new SubscriptionTableModel();
// Set the text read by JAWS
model.addColumn("Selected");
model.addColumn("Subscription name");
model.addColumn("Subscription ID");
table = new JBTable();
table.setModel(model);
TableColumn column = table.getColumnModel().getColumn(CHECKBOX_COLUMN);
// Don't show title text
column.setHeaderValue("");
column.setMinWidth(23);
column.setMaxWidth(23);
JTableUtils.enableBatchSelection(table, CHECKBOX_COLUMN);
table.getTableHeader().setReorderingAllowed(false);
new TableSpeedSearch(table);
AnActionButton refreshAction = new AnActionButton("Refresh", AllIcons.Actions.Refresh) {
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
this.setEnabled(false);
model.setRowCount(0);
model.fireTableDataChanged();
table.getEmptyText().setText("Refreshing");
AppInsightsClient.createByType(AppInsightsClient.EventType.Subscription, "", "Refresh", null);
final AzureString title = AzureOperationBundle.title("account|subscription.refresh");
final AzureTask task = new AzureTask(project, title, true, () -> {
try {
SubscriptionsDialog.this.refreshSubscriptions();
} finally {
this.setEnabled(true);
}
}, AzureTask.Modality.ANY);
AzureTaskManager.getInstance().runInBackground(task);
}
};
refreshAction.registerCustomShortcutSet(KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK, contentPane);
ToolbarDecorator tableToolbarDecorator = ToolbarDecorator.createDecorator(table).disableUpDownActions().addExtraActions(refreshAction);
panelTable = tableToolbarDecorator.createPanel();
}
Aggregations