use of com.microsoft.azure.toolkit.intellij.webapp.docker.ContainerSettingPanel in project azure-tools-for-java by Microsoft.
the class SettingPanel method createUIComponents.
private void createUIComponents() {
containerSettingPanel = new ContainerSettingPanel(project);
// create table of Web App on Linux
final DefaultTableModel tableModel = new DefaultTableModel() {
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
};
tableModel.addColumn(TABLE_HEAD_WEB_APP_NAME);
tableModel.addColumn(TABLE_HEAD_RESOURCE_GROUP);
webAppTable = new JBTable(tableModel);
webAppTable.getEmptyText().setText(TABLE_LOADING_MESSAGE);
webAppTable.setRowSelectionAllowed(true);
webAppTable.setDragEnabled(false);
webAppTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
webAppTable.getSelectionModel().addListSelectionListener(event -> {
final int index = webAppTable.getSelectedRow();
if (cachedWebAppList != null && index >= 0 && index < cachedWebAppList.size()) {
textSelectedAppName.setText(cachedWebAppList.get(webAppTable.getSelectedRow()).name());
}
});
btnRefresh = new AnActionButton("Refresh", AllIcons.Actions.Refresh) {
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
btnRefresh.setEnabled(false);
webAppTable.getEmptyText().setText(TABLE_LOADING_MESSAGE);
final DefaultTableModel model = (DefaultTableModel) webAppTable.getModel();
model.getDataVector().clear();
model.fireTableDataChanged();
textSelectedAppName.setText("");
webAppOnLinuxDeployPresenter.onRefreshList();
}
};
final ToolbarDecorator tableToolbarDecorator = ToolbarDecorator.createDecorator(webAppTable).addExtraActions(btnRefresh).setToolbarPosition(ActionToolbarPosition.TOP);
pnlWebAppOnLinuxTable = tableToolbarDecorator.createPanel();
}
Aggregations