Search in sources :

Example 1 with TabItem

use of org.eclipse.swt.widgets.TabItem in project GT by Tencent.

the class SettingView method createSettingTabItem.

private void createSettingTabItem(TabFolder parent) {
    // 创建CPU标签页
    TabItem settingTabItem = new TabItem(parent, SWT.NONE);
    settingTabItem.setText("首选项");
    //CPU标签根容器
    Composite settingTabRoot = new Composite(parent, SWT.NONE);
    settingTabRoot.setLayout(new FormLayout());
    FormData monitorItemGroupFormData = new FormData();
    monitorItemGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    monitorItemGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    monitorItemGroupFormData.top = new FormAttachment(settingTabRoot, Constant.MARGIN_WIDTH_NARROW);
    Group monitorGroup = new Group(settingTabRoot, SWT.NONE);
    monitorGroup.setText("监测项");
    monitorGroup.setLayoutData(monitorItemGroupFormData);
    monitorGroup.setLayout(new FormLayout());
    FormData cpuGroupFormData = new FormData();
    cpuGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    cpuGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    cpuGroupFormData.top = new FormAttachment(monitorGroup, Constant.MARGIN_WIDTH_NARROW);
    Group cpuGroup = new Group(monitorGroup, SWT.NONE);
    cpuGroup.setLayoutData(cpuGroupFormData);
    cpuGroup.setLayout(new GridLayout(3, true));
    Label cpuLabel = new Label(cpuGroup, SWT.NONE);
    cpuLabel.setText("CPU");
    itemTestSwitch[Constant.CPU_INDEX] = new Button(cpuGroup, SWT.RADIO);
    itemTestSwitch[Constant.CPU_INDEX].setText("开");
    itemTestSwitch[Constant.CPU_INDEX].setSelection(false);
    itemTestSwitch[Constant.CPU_INDEX].addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            APTState.getInstance().DealWithEventBefore(APTEventEnum.CONFIGRURE_OPER);
            APTState.getInstance().DealWithEventAfter(APTEventEnum.CONFIGRURE_OPER);
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
        // TODO Auto-generated method stub
        }
    });
    itemTestSwitchClose[Constant.CPU_INDEX] = new Button(cpuGroup, SWT.RADIO);
    itemTestSwitchClose[Constant.CPU_INDEX].setText("关");
    itemTestSwitchClose[Constant.CPU_INDEX].setSelection(true);
    FormData memGroupFormData = new FormData();
    memGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    memGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    memGroupFormData.top = new FormAttachment(cpuGroup, Constant.MARGIN_WIDTH_NARROW);
    memGroupFormData.bottom = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    Group memGroup = new Group(monitorGroup, SWT.NONE);
    memGroup.setLayoutData(memGroupFormData);
    memGroup.setLayout(new GridLayout(3, true));
    Label memLabel = new Label(memGroup, SWT.NONE);
    memLabel.setText("内存");
    itemTestSwitch[Constant.MEM_INDEX] = new Button(memGroup, SWT.RADIO);
    itemTestSwitch[Constant.MEM_INDEX].setText("开");
    itemTestSwitch[Constant.MEM_INDEX].setSelection(false);
    itemTestSwitch[Constant.MEM_INDEX].addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            APTState.getInstance().DealWithEventBefore(APTEventEnum.CONFIGRURE_OPER);
            APTState.getInstance().DealWithEventAfter(APTEventEnum.CONFIGRURE_OPER);
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
        // TODO Auto-generated method stub
        }
    });
    itemTestSwitchClose[Constant.MEM_INDEX] = new Button(memGroup, SWT.RADIO);
    itemTestSwitchClose[Constant.MEM_INDEX].setText("关");
    itemTestSwitchClose[Constant.MEM_INDEX].setSelection(true);
    settingTabItem.setControl(settingTabRoot);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) TabItem(org.eclipse.swt.widgets.TabItem) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 2 with TabItem

use of org.eclipse.swt.widgets.TabItem in project GT by Tencent.

the class SettingView method createMemTabItem.

/**
	 * 为了迎合兰姐的界面,要求改的好丑啊
	 * @param parent
	 */
private void createMemTabItem(TabFolder parent) {
    TabItem memTabItem = new TabItem(parent, SWT.NONE);
    memTabItem.setText("内存");
    Composite memTabRoot = new Composite(parent, SWT.NONE);
    memTabRoot.setLayout(new FormLayout());
    FormData testPeriodGroupFormData = new FormData();
    testPeriodGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    testPeriodGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    testPeriodGroupFormData.top = new FormAttachment(memTabRoot, Constant.MARGIN_WIDTH_NARROW);
    Group periodGroup = new Group(memTabRoot, SWT.NONE);
    periodGroup.setLayoutData(testPeriodGroupFormData);
    periodGroup.setLayout(new FillLayout(SWT.HORIZONTAL));
    Label memLabel = new Label(periodGroup, SWT.NONE);
    memLabel.setText("采样间隔(ms)");
    itemTestPeriod[Constant.MEM_INDEX] = new Text(periodGroup, SWT.BORDER);
    itemTestPeriod[Constant.MEM_INDEX].setText("3000");
    itemTestPeriod[Constant.MEM_INDEX].addVerifyListener(new SWTNumberVerifyListener());
    itemTestPeriod[Constant.MEM_INDEX].addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            APTState.getInstance().DealWithEventBefore(APTEventEnum.CONFIGRURE_OPER);
            APTState.getInstance().DealWithEventAfter(APTEventEnum.CONFIGRURE_OPER);
        }
    });
    FormData hprofDumpSwitchGroupFormData = new FormData();
    hprofDumpSwitchGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    hprofDumpSwitchGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    hprofDumpSwitchGroupFormData.top = new FormAttachment(periodGroup, Constant.MARGIN_WIDTH_NARROW);
    Group hprofDumpSwitchGroup = new Group(memTabRoot, SWT.NONE);
    hprofDumpSwitchGroup.setLayoutData(hprofDumpSwitchGroupFormData);
    hprofDumpSwitchGroup.setLayout(new FillLayout(SWT.HORIZONTAL));
    Label hprofDumpLabel = new Label(hprofDumpSwitchGroup, SWT.NONE);
    hprofDumpLabel.setText("Dump Hprof");
    hprofDumpSwitch = new Combo(hprofDumpSwitchGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
    hprofDumpSwitch.setItems(new String[] { "否", "是" });
    hprofDumpSwitch.select(0);
    hprofDumpSwitch.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
        //				APTState.getInstance().DealWithEventBefore(APTEventEnum.CONFIGRURE_OPER);
        //				APTState.getInstance().DealWithEventAfter(APTEventEnum.CONFIGRURE_OPER);
        }
    });
    FormData hprofDumpThresholdGroupFormData = new FormData();
    hprofDumpThresholdGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    hprofDumpThresholdGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    hprofDumpThresholdGroupFormData.top = new FormAttachment(hprofDumpSwitchGroup, Constant.MARGIN_WIDTH_NARROW);
    Group hrpofDumpThresholdGroup = new Group(memTabRoot, SWT.NONE);
    hrpofDumpThresholdGroup.setLayoutData(hprofDumpThresholdGroupFormData);
    hrpofDumpThresholdGroup.setLayout(new FillLayout(SWT.HORIZONTAL));
    Label hprofDumpThresholdLabel = new Label(hrpofDumpThresholdGroup, SWT.NONE);
    hprofDumpThresholdLabel.setText("Dump阈值(kB)");
    hprofDumpThreshold = new Text(hrpofDumpThresholdGroup, SWT.BORDER);
    hprofDumpThreshold.setText("30000");
    hprofDumpThreshold.addVerifyListener(new SWTNumberVerifyListener());
    hprofDumpThreshold.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            APTState.getInstance().DealWithEventBefore(APTEventEnum.CONFIGRURE_OPER);
            APTState.getInstance().DealWithEventAfter(APTEventEnum.CONFIGRURE_OPER);
        }
    });
    //Priv Dirty Group
    FormData privGroupFormData = new FormData();
    privGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    privGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    privGroupFormData.top = new FormAttachment(hrpofDumpThresholdGroup, Constant.MARGIN_WIDTH_NARROW);
    Group privGroup = new Group(memTabRoot, SWT.NONE);
    privGroup.setText("Priv Dirty");
    privGroup.setLayoutData(privGroupFormData);
    privGroup.setLayout(new GridLayout(3, true));
    //PSS Group
    FormData pssGroupFormData = new FormData();
    pssGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    pssGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    pssGroupFormData.top = new FormAttachment(privGroup, Constant.MARGIN_WIDTH_NARROW);
    Group pssGroup = new Group(memTabRoot, SWT.NONE);
    pssGroup.setText("PSS");
    pssGroup.setLayoutData(pssGroupFormData);
    pssGroup.setLayout(new GridLayout(3, true));
    //Heap Allocated Group
    FormData heapGroupFormData = new FormData();
    heapGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    heapGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    heapGroupFormData.top = new FormAttachment(pssGroup, Constant.MARGIN_WIDTH_NARROW);
    Group heapGroup = new Group(memTabRoot, SWT.NONE);
    heapGroup.setText("Heap Allocated");
    heapGroup.setLayoutData(heapGroupFormData);
    heapGroup.setLayout(new GridLayout(3, true));
    //Heap Size Group
    FormData heapsizeGroupFormData = new FormData();
    heapsizeGroupFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    heapsizeGroupFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    heapsizeGroupFormData.top = new FormAttachment(heapGroup, Constant.MARGIN_WIDTH_NARROW);
    Group heapsizeGroup = new Group(memTabRoot, SWT.NONE);
    heapsizeGroup.setText("Heap Size");
    heapsizeGroup.setLayoutData(heapsizeGroupFormData);
    heapsizeGroup.setLayout(new GridLayout(3, true));
    memStatCheckBtns = new Button[Constant.ALL_MEM_KIND_COUNT];
    for (int i = 0; i < Constant.ALL_MEM_KIND_COUNT; i++) {
        Group group = null;
        if (i < 3) {
            group = privGroup;
        } else if (i < 6) {
            group = pssGroup;
        } else if (i < 9) {
            group = heapGroup;
        } else {
            group = heapsizeGroup;
        }
        //final int index = i;
        memStatCheckBtns[i] = new Button(group, SWT.CHECK);
        memStatCheckBtns[i].setText(memStatCheckBtnTitles[i]);
        memStatCheckBtns[i].addSelectionListener(new SelectionListener() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                if (isSupportCheckChangeOper) {
                    //APTConsoleFactory.getInstance().APTPrint("内存check更新");
                    GetCurCheckedStateUtil.update();
                }
            }

            @Override
            public void widgetDefaultSelected(SelectionEvent e) {
            }
        });
    }
    //memStatCheckBtns[Constant.PRIV_TOTAL_INDEX].setSelection(true);
    memStatCheckBtns[Constant.PSS_TOTAL_INDEX].setSelection(true);
    //memStatCheckBtns[Constant.HEAPALLOC_TOTAL_INDEX].setSelection(true);
    FormData labelFormData = new FormData();
    labelFormData.left = new FormAttachment(0, Constant.MARGIN_WIDTH);
    labelFormData.right = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    labelFormData.bottom = new FormAttachment(100, -Constant.MARGIN_WIDTH);
    Label showLabel = new Label(memTabRoot, SWT.NONE);
    showLabel.setLayoutData(labelFormData);
    showLabel.setText("提示:测试过程中可动态调整曲线显示");
    showLabel.setForeground(new Color(parent.getDisplay(), 0, 64, 64));
    showLabel.setFont(new Font(parent.getDisplay(), "宋体", 10, SWT.BOLD));
    memTabItem.setControl(memTabRoot);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Color(org.eclipse.swt.graphics.Color) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) FillLayout(org.eclipse.swt.layout.FillLayout) Font(org.eclipse.swt.graphics.Font) TabItem(org.eclipse.swt.widgets.TabItem) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SWTNumberVerifyListener(com.tencent.wstt.apt.ui.custom.SWTNumberVerifyListener) FormAttachment(org.eclipse.swt.layout.FormAttachment) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 3 with TabItem

use of org.eclipse.swt.widgets.TabItem in project dbeaver by serge-rider.

the class ConnectionPageNetwork method activatePage.

@Override
public void activatePage() {
    DataSourceDescriptor dataSource = wizard.getPageSettings().getActiveDataSource();
    DriverDescriptor driver = wizard.getSelectedDriver();
    NetworkHandlerRegistry registry = NetworkHandlerRegistry.getInstance();
    if (prevDataSource == null || prevDataSource != dataSource) {
        for (TabItem item : handlersFolder.getItems()) {
            item.dispose();
        }
        for (NetworkHandlerDescriptor descriptor : registry.getDescriptors(dataSource)) {
            try {
                createHandlerTab(descriptor);
            } catch (DBException e) {
                log.warn(e);
            }
        }
        prevDataSource = dataSource;
        handlersFolder.layout();
        for (TabItem item : handlersFolder.getItems()) {
            ((Composite) item.getControl()).layout();
        }
    }
    TabItem selectItem = null;
    for (NetworkHandlerDescriptor descriptor : registry.getDescriptors(dataSource)) {
        DBWHandlerConfiguration configuration = dataSource.getConnectionConfiguration().getHandler(descriptor.getId());
        if (configuration == null) {
            configuration = new DBWHandlerConfiguration(descriptor, driver);
        }
        HandlerBlock handlerBlock = configurations.get(descriptor);
        if (handlerBlock == null) {
            continue;
        }
        //handlerBlock.useHandlerCheck.setSelection(configuration.isEnabled());
        if (selectItem == null && configuration.isEnabled()) {
            selectItem = handlerBlock.tabItem;
        }
        if (!handlerBlock.loadedConfigs.containsKey(dataSource.getId())) {
            handlerBlock.configurator.loadSettings(configuration);
            handlerBlock.loadedConfigs.put(dataSource.getId(), configuration);
        }
        enableHandlerContent(descriptor);
    }
    if (selectItem != null) {
        handlersFolder.setSelection(selectItem);
    } else {
        handlersFolder.setSelection(0);
    }
}
Also used : TabItem(org.eclipse.swt.widgets.TabItem) DBException(org.jkiss.dbeaver.DBException) DriverDescriptor(org.jkiss.dbeaver.registry.driver.DriverDescriptor) Composite(org.eclipse.swt.widgets.Composite) DBWHandlerConfiguration(org.jkiss.dbeaver.model.net.DBWHandlerConfiguration) NetworkHandlerDescriptor(org.jkiss.dbeaver.registry.network.NetworkHandlerDescriptor) NetworkHandlerRegistry(org.jkiss.dbeaver.registry.network.NetworkHandlerRegistry) DataSourceDescriptor(org.jkiss.dbeaver.registry.DataSourceDescriptor)

Example 4 with TabItem

use of org.eclipse.swt.widgets.TabItem in project translationstudio8 by heartsome.

the class SpellPage method createContents.

@Override
protected Control createContents(Composite parent) {
    isInit = true;
    Composite tParent = new Composite(parent, SWT.BORDER);
    tParent.setLayoutData(new GridData(GridData.FILL_BOTH));
    tParent.setLayout(new GridLayout());
    addSpellInstalGroup(tParent);
    tabFolder = new TabFolder(tParent, SWT.NONE);
    tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
    hunspellTabItem = new TabItem(tabFolder, SWT.NONE);
    hunspellTabItem.setText(Messages.getString("qa.preference.SpellPage.hunspellTab"));
    aspellTabItem = new TabItem(tabFolder, SWT.NONE);
    aspellTabItem.setText(Messages.getString("qa.preference.SpellPage.aspellTab"));
    createHunspellCmp();
    createAspellCmp();
    initData();
    return parent;
}
Also used : TabItem(org.eclipse.swt.widgets.TabItem) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) TabFolder(org.eclipse.swt.widgets.TabFolder)

Example 5 with TabItem

use of org.eclipse.swt.widgets.TabItem in project azure-tools-for-java by Microsoft.

the class AppServiceCreateDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    setMessage("Create Azure App Service");
    setTitle("Create App Service");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite composite = new Composite(area, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
    Group grpAppService = new Group(composite, SWT.NONE);
    grpAppService.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
    grpAppService.setLayout(new GridLayout(3, false));
    Label lblAppName = new Label(grpAppService, SWT.NONE);
    lblAppName.setText("Enter name");
    textAppName = new Text(grpAppService, SWT.BORDER);
    textAppName.addFocusListener(new FocusAdapter() {

        @Override
        public void focusGained(FocusEvent e) {
            cleanError();
        }
    });
    textAppName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textAppName.setMessage("<enter name>");
    dec_textAppName = decorateContorolAndRegister(textAppName);
    Label lblazurewebsitescom = new Label(grpAppService, SWT.NONE);
    lblazurewebsitescom.setText(".azurewebsites.net");
    Label lblWebContainer = new Label(grpAppService, SWT.NONE);
    lblWebContainer.setText("Web container");
    comboWebContainer = new Combo(grpAppService, SWT.READ_ONLY);
    comboWebContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    dec_comboWebContainer = decorateContorolAndRegister(comboWebContainer);
    Label lblSubscription = new Label(grpAppService, SWT.NONE);
    lblSubscription.setText("Subscription");
    comboSubscription = new Combo(grpAppService, SWT.READ_ONLY);
    comboSubscription.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fillResourceGroups();
            fillAppServicePlans();
            fillAppServicePlansDetails();
            fillAppServicePlanLocations();
        }
    });
    dec_comboSubscription = decorateContorolAndRegister(comboSubscription);
    comboSubscription.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    // ====
    tabFolder = new TabFolder(composite, SWT.NONE);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    tabItemAppServicePlan = new TabItem(tabFolder, SWT.NONE);
    tabItemAppServicePlan.setText("App service plan");
    compositeAppServicePlan = new Composite(tabFolder, SWT.NONE);
    tabItemAppServicePlan.setControl(compositeAppServicePlan);
    compositeAppServicePlan.setLayout(new GridLayout(2, false));
    btnAppServiceCreateNew = new Button(compositeAppServicePlan, SWT.RADIO);
    btnAppServiceCreateNew.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            radioAppServicePlanLogic();
        }
    });
    btnAppServiceCreateNew.setSelection(true);
    btnAppServiceCreateNew.setBounds(0, 0, 90, 16);
    btnAppServiceCreateNew.setText("Create new");
    textAppSevicePlanName = new Text(compositeAppServicePlan, SWT.BORDER);
    textAppSevicePlanName.addFocusListener(new FocusAdapter() {

        @Override
        public void focusGained(FocusEvent e) {
            cleanError();
        }
    });
    textAppSevicePlanName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textAppSevicePlanName.setMessage("<enter name>");
    dec_textAppSevicePlanName = decorateContorolAndRegister(textAppSevicePlanName);
    lblAppServiceCreateNewLocation = new Label(compositeAppServicePlan, SWT.NONE);
    GridData gd_lblAppServiceCreateNewLocation = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblAppServiceCreateNewLocation.horizontalIndent = 15;
    lblAppServiceCreateNewLocation.setLayoutData(gd_lblAppServiceCreateNewLocation);
    lblAppServiceCreateNewLocation.setText("Location");
    comboAppServicePlanLocation = new Combo(compositeAppServicePlan, SWT.READ_ONLY);
    comboAppServicePlanLocation.addFocusListener(new FocusAdapter() {

        @Override
        public void focusGained(FocusEvent e) {
            cleanError();
        }
    });
    comboAppServicePlanLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    dec_comboAppServicePlanLocation = decorateContorolAndRegister(comboAppServicePlanLocation);
    lblAppServiceCreateNewPricingTier = new Label(compositeAppServicePlan, SWT.NONE);
    GridData gd_lblAppServiceCreateNewPricingTier = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblAppServiceCreateNewPricingTier.horizontalIndent = 15;
    lblAppServiceCreateNewPricingTier.setLayoutData(gd_lblAppServiceCreateNewPricingTier);
    lblAppServiceCreateNewPricingTier.setText("Pricing tier");
    comboAppServicePlanPricingTier = new Combo(compositeAppServicePlan, SWT.READ_ONLY);
    comboAppServicePlanPricingTier.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    btnAppServiceUseExisting = new Button(compositeAppServicePlan, SWT.RADIO);
    btnAppServiceUseExisting.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            radioAppServicePlanLogic();
        }
    });
    btnAppServiceUseExisting.setText("Use existing");
    comboAppServicePlan = new Combo(compositeAppServicePlan, SWT.READ_ONLY);
    comboAppServicePlan.setEnabled(false);
    comboAppServicePlan.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    comboAppServicePlan.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fillAppServicePlansDetails();
        }
    });
    comboAppServicePlan.setBounds(0, 0, 26, 22);
    dec_comboAppServicePlan = decorateContorolAndRegister(comboAppServicePlan);
    lblAppServiceUseExictingLocation = new Label(compositeAppServicePlan, SWT.NONE);
    lblAppServiceUseExictingLocation.setEnabled(false);
    GridData gd_lblAppServiceUseExictingLocation = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblAppServiceUseExictingLocation.horizontalIndent = 15;
    lblAppServiceUseExictingLocation.setLayoutData(gd_lblAppServiceUseExictingLocation);
    lblAppServiceUseExictingLocation.setText("Location");
    lblAppSevicePlanLocation = new Label(compositeAppServicePlan, SWT.NONE);
    lblAppSevicePlanLocation.setEnabled(false);
    lblAppSevicePlanLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    lblAppSevicePlanLocation.setText("N/A");
    lblAppServiceUseExistiogPrisingTier = new Label(compositeAppServicePlan, SWT.NONE);
    lblAppServiceUseExistiogPrisingTier.setEnabled(false);
    GridData gd_lblAppServiceUseExistiogPrisingTier = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblAppServiceUseExistiogPrisingTier.horizontalIndent = 15;
    lblAppServiceUseExistiogPrisingTier.setLayoutData(gd_lblAppServiceUseExistiogPrisingTier);
    lblAppServiceUseExistiogPrisingTier.setText("Pricing tier");
    lblAppServicePlanPricingTier = new Label(compositeAppServicePlan, SWT.NONE);
    lblAppServicePlanPricingTier.setEnabled(false);
    lblAppServicePlanPricingTier.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    lblAppServicePlanPricingTier.setText("N/A");
    new Label(compositeAppServicePlan, SWT.NONE);
    //dec_comboAppServicePlanPricingTier = decorateContorolAndRegister(comboAppServicePlanPricingTier);
    linkAppServicePricing = new Link(compositeAppServicePlan, SWT.NONE);
    linkAppServicePricing.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    linkAppServicePricing.setText("<a>App service pricing details</a>");
    linkAppServicePricing.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("https://azure.microsoft.com/en-us/pricing/details/app-service/"));
            } catch (PartInitException | MalformedURLException ex) {
                LOG.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "widgetSelected@SelectionAdapter@linkAppServicePricing@AppServiceCreateDialog", ex));
            }
        }
    });
    tabItemResourceGroup = new TabItem(tabFolder, SWT.NONE);
    tabItemResourceGroup.setText("Resource group");
    compositeResourceGroup = new Composite(tabFolder, SWT.NONE);
    tabItemResourceGroup.setControl(compositeResourceGroup);
    compositeResourceGroup.setLayout(new GridLayout(2, false));
    btnResourceGroupCreateNew = new Button(compositeResourceGroup, SWT.RADIO);
    btnResourceGroupCreateNew.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            radioResourceGroupLogic();
        }
    });
    btnResourceGroupCreateNew.setSelection(true);
    btnResourceGroupCreateNew.setText("Create new");
    textResourceGroupName = new Text(compositeResourceGroup, SWT.BORDER);
    textResourceGroupName.addFocusListener(new FocusAdapter() {

        @Override
        public void focusGained(FocusEvent e) {
            cleanError();
        }
    });
    textResourceGroupName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textResourceGroupName.setBounds(0, 0, 64, 19);
    textResourceGroupName.setMessage("<enter name>");
    dec_textNewResGrName = decorateContorolAndRegister(textResourceGroupName);
    btnResourceGroupUseExisting = new Button(compositeResourceGroup, SWT.RADIO);
    btnResourceGroupUseExisting.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            radioResourceGroupLogic();
        }
    });
    btnResourceGroupUseExisting.setText("Use existing");
    comboResourceGroup = new Combo(compositeResourceGroup, SWT.READ_ONLY);
    comboResourceGroup.setEnabled(false);
    comboResourceGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    comboResourceGroup.setBounds(0, 0, 26, 22);
    dec_comboSelectResGr = decorateContorolAndRegister(comboResourceGroup);
    tabItemJDK = new TabItem(tabFolder, SWT.NONE);
    tabItemJDK.setText("JDK");
    compositeJDK = new Composite(tabFolder, SWT.NONE);
    tabItemJDK.setControl(compositeJDK);
    compositeJDK.setLayout(new GridLayout(3, false));
    btnJdkDefault = new Button(compositeJDK, SWT.RADIO);
    btnJdkDefault.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            radioJdkLogic();
        }
    });
    btnJdkDefault.setSelection(true);
    btnJdkDefault.setText("Default");
    lblJdkDefaultComment = new Label(compositeJDK, SWT.NONE);
    lblJdkDefaultComment.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    lblJdkDefaultComment.setText("Deploy the default JDK (JDK 8)");
    new Label(compositeJDK, SWT.NONE);
    btnJdk3rdParty = new Button(compositeJDK, SWT.RADIO);
    btnJdk3rdParty.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            radioJdkLogic();
        }
    });
    btnJdk3rdParty.setText("3rd party");
    comboJdk3Party = new Combo(compositeJDK, SWT.READ_ONLY);
    comboJdk3Party.setEnabled(false);
    comboJdk3Party.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    dec_comboJdk3Party = decorateContorolAndRegister(comboJdk3Party);
    linkJdkLicense = new Link(compositeJDK, SWT.NONE);
    linkJdkLicense.setEnabled(false);
    linkJdkLicense.setText("<a>License</a>");
    linkJdkLicense.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(AzulZuluModel.getLicenseUrl()));
            } catch (Exception ex) {
                LOG.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "widgetSelected@SelectionAdapter@AppServiceCreateDialo", ex));
            }
        }
    });
    btnJdkOwnDownloadUrl = new Button(compositeJDK, SWT.RADIO);
    btnJdkOwnDownloadUrl.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            radioJdkLogic();
        }
    });
    btnJdkOwnDownloadUrl.setText("Download URL");
    textJdkOwnUrl = new Text(compositeJDK, SWT.BORDER);
    textJdkOwnUrl.addFocusListener(new FocusAdapter() {

        @Override
        public void focusGained(FocusEvent e) {
            cleanError();
        }
    });
    textJdkOwnUrl.setEnabled(false);
    textJdkOwnUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textJdkOwnUrl.setMessage("<enter url>");
    dec_textJdkOwnUrl = decorateContorolAndRegister(textJdkOwnUrl);
    new Label(compositeJDK, SWT.NONE);
    lblJdkOwnSrorageAccountKey = new Label(compositeJDK, SWT.NONE);
    GridData gd_lblJdkOwnSrorageAccountKey = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblJdkOwnSrorageAccountKey.horizontalIndent = 15;
    lblJdkOwnSrorageAccountKey.setLayoutData(gd_lblJdkOwnSrorageAccountKey);
    lblJdkOwnSrorageAccountKey.setText("Storage account key");
    textJdkOwnStorageAccountKey = new Text(compositeJDK, SWT.BORDER);
    textJdkOwnStorageAccountKey.setEnabled(false);
    textJdkOwnStorageAccountKey.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textJdkOwnStorageAccountKey.setMessage("<enter storage account key>");
    decorateContorolAndRegister(textJdkOwnStorageAccountKey);
    new Label(compositeJDK, SWT.NONE);
    new Label(compositeJDK, SWT.NONE);
    lblJdkOwnComment = new Label(compositeJDK, SWT.NONE);
    lblJdkOwnComment.setEnabled(false);
    lblJdkOwnComment.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    lblJdkOwnComment.setText("(If the URL above is a private blob)");
    new Label(compositeJDK, SWT.NONE);
    DateFormat df = new SimpleDateFormat("yyMMddHHmmss");
    String date = df.format(new Date());
    textAppName.setText("webapp-" + date);
    textAppSevicePlanName.setText("asp-" + date);
    textResourceGroupName.setText("rg-webapp-" + date);
    fillWebContainers();
    fillSubscriptions();
    fillResourceGroups();
    fillAppServicePlans();
    fillAppServicePlansDetails();
    fillAppServicePlanLocations();
    fillAppServicePlanPricingTiers();
    fill3PartyJdk();
    return area;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) ResourceGroup(com.microsoft.azure.management.resources.ResourceGroup) Group(org.eclipse.swt.widgets.Group) FocusAdapter(org.eclipse.swt.events.FocusAdapter) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) TabFolder(org.eclipse.swt.widgets.TabFolder) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) FocusEvent(org.eclipse.swt.events.FocusEvent) URL(java.net.URL) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) MalformedURLException(java.net.MalformedURLException) Date(java.util.Date) TabItem(org.eclipse.swt.widgets.TabItem) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SimpleDateFormat(java.text.SimpleDateFormat) Link(org.eclipse.swt.widgets.Link)

Aggregations

TabItem (org.eclipse.swt.widgets.TabItem)31 Composite (org.eclipse.swt.widgets.Composite)27 GridLayout (org.eclipse.swt.layout.GridLayout)26 GridData (org.eclipse.swt.layout.GridData)25 TabFolder (org.eclipse.swt.widgets.TabFolder)18 SelectionEvent (org.eclipse.swt.events.SelectionEvent)17 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)15 Label (org.eclipse.swt.widgets.Label)13 Button (org.eclipse.swt.widgets.Button)10 Text (org.eclipse.swt.widgets.Text)9 Combo (org.eclipse.swt.widgets.Combo)6 TableViewer (org.eclipse.jface.viewers.TableViewer)5 Group (org.eclipse.swt.widgets.Group)5 ModifyEvent (org.eclipse.swt.events.ModifyEvent)4 ModifyListener (org.eclipse.swt.events.ModifyListener)4 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)3 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)3 StyledText (org.eclipse.swt.custom.StyledText)3 SelectionListener (org.eclipse.swt.events.SelectionListener)3 FormAttachment (org.eclipse.swt.layout.FormAttachment)3