use of com.microsoft.azuretools.telemetry.TelemetryConstants.WEBAPP in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method createButton.
private void createButton(Composite container) {
Composite composite = new Composite(container, SWT.NONE);
composite.setLayout(new RowLayout(SWT.VERTICAL));
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
Button btnCreate = new Button(composite, SWT.NONE);
btnCreate.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
sendTelemetry("CREATE");
EventUtil.logEvent(EventType.info, WEBAPP, OPEN_CREATEWEBAPP_DIALOG, buildProperties());
createAppService(project);
}
});
btnCreate.setText("Create...");
btnDelete = new Button(composite, SWT.NONE);
btnDelete.setEnabled(false);
btnDelete.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
sendTelemetry("DELETE");
deleteAppService();
}
});
btnDelete.setText("Delete...");
Button btnRefresh = new Button(composite, SWT.NONE);
btnRefresh.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
sendTelemetry("REFRESH");
EventUtil.executeWithLog(WEBAPP, REFRESH_METADATA, (operation) -> {
table.removeAll();
fillAppServiceDetails();
doFillTable(true);
});
}
});
btnRefresh.setText("Refresh");
btnDeployToRoot = new Button(composite, SWT.CHECK);
btnDeployToRoot.setSelection(true);
btnDeployToRoot.setText("Deploy to root");
int size = btnDeployToRoot.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
btnCreate.setLayoutData(new RowData(size, SWT.DEFAULT));
btnDelete.setLayoutData(new RowData(size, SWT.DEFAULT));
btnRefresh.setLayoutData(new RowData(size, SWT.DEFAULT));
btnDeployToRoot.setLayoutData(new RowData(size, SWT.DEFAULT));
}
use of com.microsoft.azuretools.telemetry.TelemetryConstants.WEBAPP in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method doFillTable.
private void doFillTable(boolean forceRefresh) {
try {
webAppDetailsMap.clear();
table.removeAll();
TableItem refreshingItem = new TableItem(table, SWT.NULL);
refreshingItem.setText(REFRESHING);
Mono.fromCallable(() -> {
return Azure.az(AzureAppService.class).webapps(forceRefresh).stream().filter(webApp -> !webApp.getRuntime().isDocker() && !Objects.equals(webApp.getRuntime().getJavaVersion(), JavaVersion.OFF)).sorted((o1, o2) -> o1.name().compareTo(o2.name())).collect(Collectors.toList());
}).subscribeOn(Schedulers.boundedElastic()).subscribe(webAppDetailsList -> {
DefaultLoader.getIdeHelper().invokeLater(() -> {
table.removeAll();
for (IWebApp webApp : webAppDetailsList) {
TableItem item = new TableItem(table, SWT.NULL);
item.setText(new String[] { webApp.name(), webApp.getRuntime().getWebContainer().getValue(), webApp.getRuntime().getJavaVersion().getValue(), webApp.resourceGroup() });
webAppDetailsMap.put(webApp.name(), webApp);
}
fillUserSettings();
});
});
} catch (Exception e) {
LOG.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "updateAndFillTable@AppServiceCreateDialog", e));
}
}
Aggregations