Search in sources :

Example 1 with ContainerSettingComposite

use of com.microsoft.azuretools.container.ui.common.ContainerSettingComposite in project azure-tools-for-java by Microsoft.

the class PublishWebAppOnLinuxDialog method createDialogArea.

/**
 * Create contents of the dialog.
 */
@Override
protected Control createDialogArea(Composite parent) {
    setTitle("Run on Web App for Containers");
    setMessage("Run on web app for containers");
    Composite area = (Composite) super.createDialogArea(parent);
    expandBar = new ExpandBar(area, SWT.V_SCROLL);
    GridData gdExpandBar = new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1);
    gdExpandBar.minimumWidth = 550;
    expandBar.setLayoutData(gdExpandBar);
    expandBar.setBackground(area.getBackground());
    acrHolder = new ExpandItem(expandBar, SWT.NONE);
    acrHolder.setExpanded(true);
    acrHolder.setText("Azure Container Registry");
    cpAcr = new ContainerSettingComposite(expandBar, SWT.BORDER, basePath);
    acrHolder.setControl(cpAcr);
    acrHolder.setHeight(acrHolder.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    webappHolder = new ExpandItem(expandBar, SWT.NONE);
    webappHolder.setExpanded(true);
    webappHolder.setText("Web App for Container");
    cpWebApp = new Composite(expandBar, SWT.BORDER);
    webappHolder.setControl(cpWebApp);
    cpWebApp.setLayout(new GridLayout(1, false));
    Composite cpRadioGroup = new Composite(cpWebApp, SWT.NONE);
    cpRadioGroup.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
    cpRadioGroup.setLayout(new GridLayout(2, false));
    rdoExistingWebApp = new Button(cpRadioGroup, SWT.RADIO);
    rdoExistingWebApp.setSelection(true);
    rdoExistingWebApp.setText("Use Exisiting");
    rdoNewWebApp = new Button(cpRadioGroup, SWT.RADIO);
    rdoNewWebApp.setText("Create New");
    cpExisting = new WebAppTableComposite(cpWebApp, SWT.NONE);
    cpExisting.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1));
    cpNew = new NewWebAppComposite(cpWebApp, SWT.NONE);
    cpNew.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1));
    updateWebAppHolderWidget();
    resourceGroupRadioGroupLogic();
    aspRadioGroupLogic();
    // Listeners
    // webapp radio group
    rdoNewWebApp.addListener(SWT.Selection, event -> webAppRadioGroupLogic());
    rdoExistingWebApp.addListener(SWT.Selection, event -> webAppRadioGroupLogic());
    // resource group radio group
    cpNew.rdoNewResourceGroup.addListener(SWT.Selection, event -> resourceGroupRadioGroupLogic());
    cpNew.rdoExistingResourceGroup.addListener(SWT.Selection, event -> resourceGroupRadioGroupLogic());
    // app service plan radio group
    cpNew.rdoNewAppServicePlan.addListener(SWT.Selection, event -> aspRadioGroupLogic());
    cpNew.rdoExistingAppServicePlan.addListener(SWT.Selection, event -> aspRadioGroupLogic());
    // subscription selection
    cpNew.cbSubscription.addListener(SWT.Selection, event -> onSubscriptionSelection());
    // resource group selection
    cpNew.cbExistingResourceGroup.addListener(SWT.Selection, event -> onResourceGroupSelection());
    // app service plan selection
    cpNew.cbExistingAppServicePlan.addListener(SWT.Selection, event -> onAppServicePlanSelection());
    // refresh button
    cpExisting.btnRefresh.addListener(SWT.Selection, event -> onBtnRefreshSelection());
    // ACR composite serverUrl text change listener
    cpAcr.addTxtServerUrlModifyListener(event -> onTxtServerUrlModification());
    // adjust shell size when clicking expandBar
    expandBar.addListener(SWT.MouseUp, event -> adjustShellSize());
    cpNew.expandBar.addListener(SWT.MouseUp, event -> adjustShellSize());
    reset();
    return area;
}
Also used : ExpandBar(org.eclipse.swt.widgets.ExpandBar) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ContainerSettingComposite(com.microsoft.azuretools.container.ui.common.ContainerSettingComposite) ExpandItem(org.eclipse.swt.widgets.ExpandItem) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) ContainerSettingComposite(com.microsoft.azuretools.container.ui.common.ContainerSettingComposite)

Example 2 with ContainerSettingComposite

use of com.microsoft.azuretools.container.ui.common.ContainerSettingComposite in project azure-tools-for-java by Microsoft.

the class PushImageDialog method createDialogArea.

/**
 * Create contents of the dialog.
 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite area = (Composite) super.createDialogArea(parent);
    containerSettingComposite = new ContainerSettingComposite(area, SWT.NONE, basePath);
    containerSettingComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
    containerSettingComposite.setStartupFileVisible(false);
    containerSettingComposite.addTxtServerUrlModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent event) {
            parent.getShell().layout(true, true);
            parent.getShell().pack(true);
        }
    });
    setTitle("Push Image");
    setMessage("Configure the container registry you want to push to.");
    reset();
    return area;
}
Also used : ModifyEvent(org.eclipse.swt.events.ModifyEvent) ContainerSettingComposite(com.microsoft.azuretools.container.ui.common.ContainerSettingComposite) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) ContainerSettingComposite(com.microsoft.azuretools.container.ui.common.ContainerSettingComposite)

Aggregations

ContainerSettingComposite (com.microsoft.azuretools.container.ui.common.ContainerSettingComposite)2 GridData (org.eclipse.swt.layout.GridData)2 Composite (org.eclipse.swt.widgets.Composite)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 ExpandBar (org.eclipse.swt.widgets.ExpandBar)1 ExpandItem (org.eclipse.swt.widgets.ExpandItem)1