use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method createUIComponents.
private void createUIComponents() {
DefaultTableModel tableModel = new DefaultTableModel() {
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
};
tableModel.addColumn("Name");
tableModel.addColumn("JDK");
tableModel.addColumn("Web container");
tableModel.addColumn("Resource group");
table = new JBTable(tableModel);
table.setRowSelectionAllowed(true);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent event) {
if (event.getValueIsAdjusting())
return;
//System.out.println("row : " + table.getValueAt(table.getSelectedRow(), 0).toString());
fillAppServiceDetails();
}
});
AnActionButton refreshAction = new AnActionButton("Refresh", AllIcons.Actions.Refresh) {
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
refreshAppServices();
}
};
ToolbarDecorator tableToolbarDecorator = ToolbarDecorator.createDecorator(table).setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
createAppService();
}
}).setRemoveAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
deleteAppService();
}
}).setRemoveActionUpdater(new AnActionButtonUpdater() {
@Override
public boolean isEnabled(AnActionEvent e) {
return table.getSelectedRow() != -1;
}
}).disableUpDownActions().addExtraActions(refreshAction);
panelTable = tableToolbarDecorator.createPanel();
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method editAppService.
private void editAppService() {
int selectedRow = table.getSelectedRow();
if (selectedRow >= 0) {
DefaultTableModel tableModel = (DefaultTableModel) table.getModel();
String appServiceName = (String) tableModel.getValueAt(selectedRow, 0);
WebAppDetails wad = webAppWebAppDetailsMap.get(appServiceName);
AppServiceChangeSettingsDialog d = AppServiceChangeSettingsDialog.go(wad, project);
if (d == null) {
// something went wrong - report an error!
return;
}
WebApp wa = d.getWebApp();
doFillTable();
selectTableRowWithWebAppName(wa.name());
}
//fillAppServiceDetails();
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method fillAppServiceDetails.
private void fillAppServiceDetails() {
DefaultTableModel tableModel = (DefaultTableModel) table.getModel();
int selectedRow = table.getSelectedRow();
if (selectedRow >= 0) {
String appServiceName = (String) tableModel.getValueAt(selectedRow, 0);
WebAppDetails wad = webAppWebAppDetailsMap.get(appServiceName);
SubscriptionDetail sd = wad.subscriptionDetail;
AppServicePlan asp = wad.appServicePlan;
StringBuilder sb = new StringBuilder();
sb.append("<div style=\"margin: 7px 7px 7px 7px;\">");
sb.append(String.format("App Service Name: <b>%s</b><br/>", appServiceName));
sb.append(String.format("Subscription Name: <b>%s</b>; ID: <b>%s</b><br/>", sd.getSubscriptionName(), sd.getSubscriptionId()));
String aspName = asp == null ? "N/A" : asp.name();
String aspPricingTier = asp == null ? "N/A" : asp.pricingTier().toString();
sb.append(String.format("App Service Plan Name: <b>%s</b>; Pricing Tier: <b>%s</b><br/>", aspName, aspPricingTier));
String link = buildSiteLink(wad.webApp, null);
sb.append(String.format("Link: <a href=\"%s\">%s</a>", link, link));
sb.append("</div>");
editorPaneAppServiceDetails.setText(sb.toString());
}
// listWebAppDetails.setModel(listModel);
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method doValidate.
@Nullable
@Override
protected ValidationInfo doValidate() {
int selectedRow = table.getSelectedRow();
if (selectedRow < 0) {
return new ValidationInfo("Please select an App Service to deploy to", table);
}
DefaultTableModel tableModel = (DefaultTableModel) table.getModel();
WebAppDetails wad = webAppWebAppDetailsMap.get(tableModel.getValueAt(selectedRow, 0));
if (wad.webApp.javaVersion() == JavaVersion.OFF) {
return new ValidationInfo("Please select java based App Service", table);
}
return super.doValidate();
}
use of javax.swing.table.DefaultTableModel in project MassBank-web by MassBank.
the class SearchPage method getSpectrumForQuery.
/**
* �X�y�N�g���擾
* DB����X�y�N�g�����擾����
* @param searchName
*/
private void getSpectrumForQuery(String searchName) {
String param = "";
if (!searchName.equals("")) {
String wc = "&wc=";
boolean wcStart = false;
boolean wcEnd = false;
if (searchName.substring(0, 1).equals("*")) {
wcStart = true;
}
if (searchName.substring(searchName.length() - 1).equals("*")) {
wcEnd = true;
}
if (wcStart) {
if (wcEnd) {
wc += "both";
} else {
wc += "start";
}
} else {
if (wcEnd) {
wc += "end";
} else {
wc = "";
}
}
searchName = searchName.replace("*", "");
param = "name=" + searchName + wc;
}
// �T�[�u���b�g�Ăяo��-�}���`�X���b�h��CGI���N��
String cgiType = MassBankCommon.CGI_TBL[MassBankCommon.CGI_TBL_NUM_TYPE][MassBankCommon.CGI_TBL_TYPE_GNAME];
ArrayList<String> result = mbcommon.execMultiDispatcher(baseUrl, cgiType, param);
DefaultTableModel dataModel = (DefaultTableModel) querySorter.getTableModel();
dataModel.setRowCount(0);
if (result == null || result.size() == 0) {
return;
}
// �\�[�g
Collections.sort(result);
nameList.clear();
for (int i = 0; i < result.size(); i++) {
String nameId = (String) result.get(i);
String[] cutNameId = nameId.split("\t");
String name = cutNameId[0];
String id = cutNameId[1];
String site = cutNameId[2];
String[] cutIdNameSite = new String[] { id, name, site };
nameList.add(cutIdNameSite);
site = siteNameList[Integer.parseInt(site)];
String[] idNameSite2 = new String[] { id, name, site, String.valueOf(i + 1) };
// �擾�l���e�[�u���ɃZ�b�g
dataModel.addRow(idNameSite2);
}
}
Aggregations