Search in sources :

Example 1 with REFRESH_METADATA

use of com.microsoft.azuretools.telemetry.TelemetryConstants.REFRESH_METADATA 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));
}
Also used : HttpURLConnection(java.net.HttpURLConnection) Azure(com.microsoft.azure.toolkit.lib.Azure) DefaultToolTip(org.eclipse.jface.window.DefaultToolTip) IDialogConstants(org.eclipse.jface.dialogs.IDialogConstants) FocusEvent(org.eclipse.swt.events.FocusEvent) Point(org.eclipse.swt.graphics.Point) CommonUtils(com.microsoft.azuretools.webapp.util.CommonUtils) PluginUtil(com.microsoft.azuretools.core.utils.PluginUtil) Composite(org.eclipse.swt.widgets.Composite) Map(java.util.Map) REFRESH_METADATA(com.microsoft.azuretools.telemetry.TelemetryConstants.REFRESH_METADATA) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) IWebAppDeploymentSlot(com.microsoft.azure.toolkit.lib.appservice.service.IWebAppDeploymentSlot) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) ILog(org.eclipse.core.runtime.ILog) PlatformUI(org.eclipse.ui.PlatformUI) Runtime(com.microsoft.azure.toolkit.lib.appservice.model.Runtime) UpdateProgressIndicator(com.microsoft.azuretools.core.utils.UpdateProgressIndicator) ErrorType(com.microsoft.azuretools.telemetrywrapper.ErrorType) Status(org.eclipse.core.runtime.Status) JavaVersion(com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion) CountDownLatch(java.util.concurrent.CountDownLatch) Window(org.eclipse.jface.window.Window) AzureAccount(com.microsoft.azure.toolkit.lib.auth.AzureAccount) SWT(org.eclipse.swt.SWT) EventUtil(com.microsoft.azuretools.telemetrywrapper.EventUtil) SimpleDateFormat(java.text.SimpleDateFormat) CREATE_WEBAPP_SLOT(com.microsoft.azuretools.telemetry.TelemetryConstants.CREATE_WEBAPP_SLOT) IProject(org.eclipse.core.resources.IProject) IDataModel(org.eclipse.wst.common.frameworks.datamodel.IDataModel) ErrorWindow(com.microsoft.azuretools.core.ui.ErrorWindow) DefaultLoader(com.microsoft.tooling.msservices.components.DefaultLoader) WebComponentExportDataModelProvider(org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportDataModelProvider) GridData(org.eclipse.swt.layout.GridData) RowData(org.eclipse.swt.layout.RowData) Link(org.eclipse.swt.widgets.Link) IWebAppBase(com.microsoft.azure.toolkit.lib.appservice.service.IWebAppBase) Subscription(com.microsoft.azure.toolkit.lib.common.model.Subscription) TableItem(org.eclipse.swt.widgets.TableItem) Shell(org.eclipse.swt.widgets.Shell) DELETE_WEBAPP(com.microsoft.azuretools.telemetry.TelemetryConstants.DELETE_WEBAPP) IOException(java.io.IOException) Mono(reactor.core.publisher.Mono) DataModelFactory(org.eclipse.wst.common.frameworks.datamodel.DataModelFactory) File(java.io.File) ProgressDialog(com.microsoft.azuretools.core.utils.ProgressDialog) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridLayout(org.eclipse.swt.layout.GridLayout) Activator(com.microsoft.azuretools.webapp.Activator) URL(java.net.URL) Date(java.util.Date) DEPLOY_WEBAPP(com.microsoft.azuretools.telemetry.TelemetryConstants.DEPLOY_WEBAPP) TableColumn(org.eclipse.swt.widgets.TableColumn) MavenUtils(com.microsoft.azuretools.core.utils.MavenUtils) IncrementalProjectBuilder(org.eclipse.core.resources.IncrementalProjectBuilder) IStatus(org.eclipse.core.runtime.IStatus) WebContainer(com.microsoft.azure.toolkit.lib.appservice.model.WebContainer) AzureWebAppMvpModel(com.microsoft.azuretools.core.mvp.model.webapp.AzureWebAppMvpModel) Button(org.eclipse.swt.widgets.Button) Operation(com.microsoft.azuretools.telemetrywrapper.Operation) UUID(java.util.UUID) Display(org.eclipse.swt.widgets.Display) Collectors(java.util.stream.Collectors) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) Objects(java.util.Objects) List(java.util.List) AzureDeploymentProgressNotification(com.microsoft.azuretools.core.ui.views.AzureDeploymentProgressNotification) Optional(java.util.Optional) Label(org.eclipse.swt.widgets.Label) WEBAPP(com.microsoft.azuretools.telemetry.TelemetryConstants.WEBAPP) ControlDecoration(org.eclipse.jface.fieldassist.ControlDecoration) OPEN_CREATEWEBAPP_DIALOG(com.microsoft.azuretools.telemetry.TelemetryConstants.OPEN_CREATEWEBAPP_DIALOG) Image(org.eclipse.swt.graphics.Image) HashMap(java.util.HashMap) Table(org.eclipse.swt.widgets.Table) IWebApp(com.microsoft.azure.toolkit.lib.appservice.service.IWebApp) FocusListener(org.eclipse.swt.events.FocusListener) IAppServicePlan(com.microsoft.azure.toolkit.lib.appservice.service.IAppServicePlan) Schedulers(reactor.core.scheduler.Schedulers) FillLayout(org.eclipse.swt.layout.FillLayout) AzureAppService(com.microsoft.azure.toolkit.lib.appservice.AzureAppService) Combo(org.eclipse.swt.widgets.Combo) Job(org.eclipse.core.runtime.jobs.Job) IJ2EEComponentExportDataModelProperties(org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentExportDataModelProperties) Group(org.eclipse.swt.widgets.Group) StringUtils(com.microsoft.azuretools.adauth.StringUtils) RowLayout(org.eclipse.swt.layout.RowLayout) EventType(com.microsoft.azuretools.telemetrywrapper.EventType) AccessibilityUtils(com.microsoft.azuretools.core.utils.AccessibilityUtils) TelemetryConstants(com.microsoft.azuretools.telemetry.TelemetryConstants) AppServiceBaseEntity(com.microsoft.azure.toolkit.lib.appservice.entity.AppServiceBaseEntity) AppInsightsClient(com.microsoft.azuretools.telemetry.AppInsightsClient) TelemetryManager(com.microsoft.azuretools.telemetrywrapper.TelemetryManager) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FocusAdapter(org.eclipse.swt.events.FocusAdapter) WebAppSettingModel(com.microsoft.azuretools.core.mvp.model.webapp.WebAppSettingModel) Control(org.eclipse.swt.widgets.Control) RowData(org.eclipse.swt.layout.RowData) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Point(org.eclipse.swt.graphics.Point)

Aggregations

Azure (com.microsoft.azure.toolkit.lib.Azure)1 AzureAppService (com.microsoft.azure.toolkit.lib.appservice.AzureAppService)1 AppServiceBaseEntity (com.microsoft.azure.toolkit.lib.appservice.entity.AppServiceBaseEntity)1 JavaVersion (com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion)1 Runtime (com.microsoft.azure.toolkit.lib.appservice.model.Runtime)1 WebContainer (com.microsoft.azure.toolkit.lib.appservice.model.WebContainer)1 IAppServicePlan (com.microsoft.azure.toolkit.lib.appservice.service.IAppServicePlan)1 IWebApp (com.microsoft.azure.toolkit.lib.appservice.service.IWebApp)1 IWebAppBase (com.microsoft.azure.toolkit.lib.appservice.service.IWebAppBase)1 IWebAppDeploymentSlot (com.microsoft.azure.toolkit.lib.appservice.service.IWebAppDeploymentSlot)1 AzureAccount (com.microsoft.azure.toolkit.lib.auth.AzureAccount)1 Subscription (com.microsoft.azure.toolkit.lib.common.model.Subscription)1 StringUtils (com.microsoft.azuretools.adauth.StringUtils)1 AzureWebAppMvpModel (com.microsoft.azuretools.core.mvp.model.webapp.AzureWebAppMvpModel)1 WebAppSettingModel (com.microsoft.azuretools.core.mvp.model.webapp.WebAppSettingModel)1 ErrorWindow (com.microsoft.azuretools.core.ui.ErrorWindow)1 AzureDeploymentProgressNotification (com.microsoft.azuretools.core.ui.views.AzureDeploymentProgressNotification)1 AccessibilityUtils (com.microsoft.azuretools.core.utils.AccessibilityUtils)1 MavenUtils (com.microsoft.azuretools.core.utils.MavenUtils)1 PluginUtil (com.microsoft.azuretools.core.utils.PluginUtil)1