Search in sources :

Example 6 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.

the class EditVirtualTableDialog method createDialogArea.

/**
	 * Create the dialog area
	 *
	 * @param parent The parent composite to contain the dialog area
	 * @return the dialog area control
	 */
protected Control createDialogArea(Composite parent) {
    Composite parentComp = (Composite) super.createDialogArea(parent);
    Composite composite = new Composite(parentComp, SWT.NONE);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 400;
    gd.widthHint = 710;
    composite.setLayoutData(gd);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    composite.setLayout(layout);
    tabFolder = new TabFolder(composite, SWT.NONE);
    {
        final GridData tgd = new GridData(SWT.FILL, SWT.FILL, true, true);
        tgd.heightHint = 469;
        tgd.widthHint = 621;
        tabFolder.setLayoutData(tgd);
    }
    collationList = erSchema.getCollections();
    createGeneralTabItem(tabFolder);
    createFkIndexTabItem(tabFolder);
    toolTip = new ToolTip(columnsTable.getShell(), SWT.NONE);
    toolTip.setAutoHide(true);
    errorBaloon = new ToolTip(tabFolder.getShell(), SWT.NONE);
    errorBaloon.setAutoHide(true);
    init();
    if (isNewTableFlag) {
        tableNameText.setFocus();
    }
    addNewColumn();
    if (showDefaultType == EditTableAction.MODE_INDEX_EDIT || showDefaultType == EditTableAction.MODE_FK_EDIT) {
        tabFolder.setSelection(1);
    }
    return composite;
}
Also used : ToolTip(org.eclipse.swt.widgets.ToolTip) 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 7 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.

the class BrokerParameterDialog method createDialogArea.

/**
	 * Create the dialog area content
	 * 
	 * @param parent the parent composite
	 * @return the composite
	 */
protected Control createDialogArea(Composite parent) {
    Composite parentComp = (Composite) super.createDialogArea(parent);
    Composite composite = new Composite(parentComp, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);
    GridData gdComposite = new GridData(SWT.FILL, SWT.FILL, true, true);
    gdComposite.heightHint = 440;
    composite.setLayoutData(gdComposite);
    Composite nameComp = new Composite(composite, SWT.NONE);
    nameComp.setLayout(new GridLayout(2, false));
    nameComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    final Label brokerNameLabel = new Label(nameComp, SWT.NONE);
    brokerNameLabel.setText(Messages.brokerNameLbl);
    nameTxt = new Text(nameComp, SWT.BORDER);
    final GridData gdNameTxt = new GridData(SWT.FILL, SWT.CENTER, true, false);
    nameTxt.setLayoutData(gdNameTxt);
    TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
    final GridData gdTabFolder = new GridData(SWT.FILL, SWT.FILL, true, true);
    tabFolder.setLayoutData(gdTabFolder);
    tabFolder.setLayout(new GridLayout());
    TabItem item = new TabItem(tabFolder, SWT.NONE);
    item.setText(Messages.paraParameterNameOfTap);
    item.setControl(createParamComp(tabFolder));
    item = new TabItem(tabFolder, SWT.NONE);
    item.setText(Messages.paraRefreshNameOfTap);
    item.setControl(createRefreshComp(tabFolder));
    initialize();
    if (operation == AddEditType.ADD) {
        setTitle(Messages.addTitle);
        setMessage(Messages.addMsg);
        nameTxt.setEnabled(true);
        getShell().setText(Messages.shellAddTitle);
        brokerMap = new HashMap<String, String>();
        isOkenable[0] = false;
        isOkenable[1] = false;
        isOkenable[2] = false;
    } else {
        editTitle = Messages.bind(Messages.editTitle, brokerMap.get("0"));
        editMsg = Messages.bind(Messages.editMsg, brokerMap.get("0"));
        setTitle(editTitle);
        setMessage(editMsg);
        getShell().setText(Messages.shellEditTitle);
        nameTxt.setEnabled(false);
        isOkenable[0] = true;
        isOkenable[1] = true;
        isOkenable[2] = true;
    }
    nameTxt.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent event) {
            String content = ((Text) event.widget).getText().trim();
            if (content.length() == 0) {
                isOkenable[0] = false;
            } else if (content.equalsIgnoreCase("broker")) {
                setErrorMessage(Messages.errBrokerName);
                isOkenable[0] = false;
            } else {
                boolean hasName = false;
                if (brokerLst != null) {
                    for (Map<String, String> brokerInfo : brokerLst) {
                        if (content.equalsIgnoreCase(brokerInfo.get("0"))) {
                            hasName = true;
                            break;
                        }
                    }
                }
                if (hasName) {
                    isOkenable[0] = false;
                    setErrorMessage(Messages.errReduplicateName);
                } else {
                    isOkenable[0] = true;
                    setErrorMessage(null);
                }
            }
            enableOk();
        }
    });
    return parentComp;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) TabFolder(org.eclipse.swt.widgets.TabFolder) Text(org.eclipse.swt.widgets.Text) TabItem(org.eclipse.swt.widgets.TabItem) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridData(org.eclipse.swt.layout.GridData)

Example 8 with TabFolder

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

the class AzureNewDockerLoginPage method createControl.

/**
	 * Create contents of the wizard.
	 * @param parent
	 */
public void createControl(Composite parent) {
    Composite mainContainer = new Composite(parent, SWT.NONE);
    setControl(mainContainer);
    mainContainer.setLayout(new GridLayout(2, false));
    dockerHostImportKeyvaultCredsRadioButton = new Button(mainContainer, SWT.RADIO);
    GridData gd_dockerHostImportKeyvaultCredsRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostImportKeyvaultCredsRadioButton.horizontalIndent = 5;
    dockerHostImportKeyvaultCredsRadioButton.setLayoutData(gd_dockerHostImportKeyvaultCredsRadioButton);
    dockerHostImportKeyvaultCredsRadioButton.setText("Import credentials from Azure Key Vault:");
    dockerHostImportKeyvaultComboBox = new Combo(mainContainer, SWT.READ_ONLY);
    GridData gd_dockerHostImportKeyvaultComboBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostImportKeyvaultComboBox.widthHint = 230;
    dockerHostImportKeyvaultComboBox.setLayoutData(gd_dockerHostImportKeyvaultComboBox);
    dockerHostNewCredsRadioButton = new Button(mainContainer, SWT.RADIO);
    GridData gd_dockerHostNewCredsRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostNewCredsRadioButton.horizontalIndent = 5;
    dockerHostNewCredsRadioButton.setLayoutData(gd_dockerHostNewCredsRadioButton);
    dockerHostNewCredsRadioButton.setText("New log in credentials:");
    new Label(mainContainer, SWT.NONE);
    credsTabfolder = new TabFolder(mainContainer, SWT.NONE);
    GridData gd_credsTabfolder = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 2);
    gd_credsTabfolder.heightHint = 235;
    credsTabfolder.setLayoutData(gd_credsTabfolder);
    vmCredsTableItem = new TabItem(credsTabfolder, SWT.NONE);
    vmCredsTableItem.setText("VM Credentials");
    Composite vmCredsComposite = new Composite(credsTabfolder, SWT.NONE);
    vmCredsTableItem.setControl(vmCredsComposite);
    vmCredsComposite.setLayout(new GridLayout(6, false));
    Label lblUsername = new Label(vmCredsComposite, SWT.NONE);
    GridData gd_lblUsername = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblUsername.horizontalIndent = 5;
    lblUsername.setLayoutData(gd_lblUsername);
    lblUsername.setText("Username:");
    dockerHostUsernameTextField = new Text(vmCredsComposite, SWT.BORDER);
    GridData gd_dockerHostUsernameTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostUsernameTextField.widthHint = 150;
    dockerHostUsernameTextField.setLayoutData(gd_dockerHostUsernameTextField);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    Label lblPassword = new Label(vmCredsComposite, SWT.NONE);
    GridData gd_lblPassword = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblPassword.horizontalIndent = 5;
    lblPassword.setLayoutData(gd_lblPassword);
    lblPassword.setText("Password:");
    dockerHostFirstPwdField = new Text(vmCredsComposite, SWT.BORDER | SWT.PASSWORD);
    GridData gd_dockerHostFirstPwdField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostFirstPwdField.widthHint = 150;
    dockerHostFirstPwdField.setLayoutData(gd_dockerHostFirstPwdField);
    dockerHostPwdLabel = new Label(vmCredsComposite, SWT.NONE);
    dockerHostPwdLabel.setText("(Optional)");
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    Label lblConfirm = new Label(vmCredsComposite, SWT.NONE);
    GridData gd_lblConfirm = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblConfirm.horizontalIndent = 5;
    lblConfirm.setLayoutData(gd_lblConfirm);
    lblConfirm.setText("Confirm:");
    dockerHostSecondPwdField = new Text(vmCredsComposite, SWT.BORDER | SWT.PASSWORD);
    GridData gd_dockerHostSecondPwdField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostSecondPwdField.widthHint = 150;
    dockerHostSecondPwdField.setLayoutData(gd_dockerHostSecondPwdField);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    Label lblSsh = new Label(vmCredsComposite, SWT.NONE);
    GridData gd_lblSsh = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblSsh.horizontalIndent = 5;
    lblSsh.setLayoutData(gd_lblSsh);
    lblSsh.setText("SSH");
    Label label = new Label(vmCredsComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 5, 1));
    dockerHostNoSshRadioButton = new Button(vmCredsComposite, SWT.RADIO);
    GridData gd_dockerHostNoSshRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1);
    gd_dockerHostNoSshRadioButton.horizontalIndent = 5;
    dockerHostNoSshRadioButton.setLayoutData(gd_dockerHostNoSshRadioButton);
    dockerHostNoSshRadioButton.setText("None");
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    dockerHostAutoSshRadioButton = new Button(vmCredsComposite, SWT.RADIO);
    GridData gd_dockerHostAutoSshRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1);
    gd_dockerHostAutoSshRadioButton.horizontalIndent = 5;
    dockerHostAutoSshRadioButton.setLayoutData(gd_dockerHostAutoSshRadioButton);
    dockerHostAutoSshRadioButton.setText("Auto-generate");
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    dockerHostImportSshRadioButton = new Button(vmCredsComposite, SWT.RADIO);
    GridData gd_dockerHostImportSshRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1);
    gd_dockerHostImportSshRadioButton.horizontalIndent = 5;
    dockerHostImportSshRadioButton.setLayoutData(gd_dockerHostImportSshRadioButton);
    dockerHostImportSshRadioButton.setText("Import from directory:");
    new Label(vmCredsComposite, SWT.NONE);
    new Label(vmCredsComposite, SWT.NONE);
    dockerHostImportSSHTextField = new Text(vmCredsComposite, SWT.BORDER);
    GridData gd_dockerHostImportSSHTextField = new GridData(SWT.FILL, SWT.CENTER, true, false, 5, 1);
    gd_dockerHostImportSSHTextField.horizontalIndent = 24;
    dockerHostImportSSHTextField.setLayoutData(gd_dockerHostImportSSHTextField);
    dockerHostImportSSHBrowseButton = new Button(vmCredsComposite, SWT.NONE);
    dockerHostImportSSHBrowseButton.setText("Browse...");
    daemonCredsTableItem = new TabItem(credsTabfolder, SWT.NONE);
    daemonCredsTableItem.setText("Docker Daemon Credentials");
    Composite daemonCredsComposite = new Composite(credsTabfolder, SWT.NONE);
    daemonCredsTableItem.setControl(daemonCredsComposite);
    daemonCredsComposite.setLayout(new GridLayout(4, false));
    Label lblDockerDaemonPort = new Label(daemonCredsComposite, SWT.NONE);
    GridData gd_lblDockerDaemonPort = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblDockerDaemonPort.horizontalIndent = 5;
    lblDockerDaemonPort.setLayoutData(gd_lblDockerDaemonPort);
    lblDockerDaemonPort.setText("Docker daemon port:");
    dockerDaemonPortTextField = new Text(daemonCredsComposite, SWT.BORDER);
    GridData gd_dockerDaemonPortTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerDaemonPortTextField.widthHint = 50;
    dockerDaemonPortTextField.setLayoutData(gd_dockerDaemonPortTextField);
    new Label(daemonCredsComposite, SWT.NONE);
    Label lblTlsSecurity = new Label(daemonCredsComposite, SWT.NONE);
    GridData gd_lblTlsSecurity = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblTlsSecurity.horizontalIndent = 5;
    lblTlsSecurity.setLayoutData(gd_lblTlsSecurity);
    lblTlsSecurity.setText("TLS security");
    Label label_1 = new Label(daemonCredsComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
    label_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
    dockerHostNoTlsRadioButton = new Button(daemonCredsComposite, SWT.RADIO);
    GridData gd_dockerHostNoTlsRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
    gd_dockerHostNoTlsRadioButton.horizontalIndent = 5;
    dockerHostNoTlsRadioButton.setLayoutData(gd_dockerHostNoTlsRadioButton);
    dockerHostNoTlsRadioButton.setText("None");
    new Label(daemonCredsComposite, SWT.NONE);
    dockerHostAutoTlsRadioButton = new Button(daemonCredsComposite, SWT.RADIO);
    GridData gd_dockerHostAutoTlsRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
    gd_dockerHostAutoTlsRadioButton.horizontalIndent = 5;
    dockerHostAutoTlsRadioButton.setLayoutData(gd_dockerHostAutoTlsRadioButton);
    dockerHostAutoTlsRadioButton.setText("Auto-generate");
    new Label(daemonCredsComposite, SWT.NONE);
    dockerHostImportTlsRadioButton = new Button(daemonCredsComposite, SWT.RADIO);
    GridData gd_dockerHostImportTlsRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
    gd_dockerHostImportTlsRadioButton.horizontalIndent = 5;
    dockerHostImportTlsRadioButton.setLayoutData(gd_dockerHostImportTlsRadioButton);
    dockerHostImportTlsRadioButton.setText("Import from directory:");
    new Label(daemonCredsComposite, SWT.NONE);
    dockerHostImportTLSTextField = new Text(daemonCredsComposite, SWT.BORDER);
    GridData gd_dockerHostImportTLSTextField = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
    gd_dockerHostImportTLSTextField.horizontalIndent = 24;
    dockerHostImportTLSTextField.setLayoutData(gd_dockerHostImportTLSTextField);
    dockerHostImportTLSBrowseButton = new Button(daemonCredsComposite, SWT.NONE);
    dockerHostImportTLSBrowseButton.setText("Browse...");
    dockerHostSaveCredsCheckBox = new Button(mainContainer, SWT.CHECK);
    GridData gd_dockerHostSaveCredsCheckBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostSaveCredsCheckBox.horizontalIndent = 5;
    dockerHostSaveCredsCheckBox.setLayoutData(gd_dockerHostSaveCredsCheckBox);
    dockerHostSaveCredsCheckBox.setText("Save credentials into a new Azure Key Vault:");
    dockerHostNewKeyvaultTextField = new Text(mainContainer, SWT.BORDER);
    GridData gd_dockerHostNewKeyvaultTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostNewKeyvaultTextField.widthHint = 210;
    dockerHostNewKeyvaultTextField.setLayoutData(gd_dockerHostNewKeyvaultTextField);
    FormToolkit toolkit = new FormToolkit(mainContainer.getDisplay());
    toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
    managedForm = new ManagedForm(mainContainer);
    errMsgForm = managedForm.getForm();
    errMsgForm.setVisible(false);
    //		errMsgForm.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    //		errMsgForm.setBackground(mainContainer.getBackground());
    errDispatcher = managedForm.getMessageManager();
    //		errDispatcher.addMessage("dockerHostNameTextField", "Test error", null, IMessageProvider.ERROR, dockerHostNameTextField);
    //		errMsgForm.setMessage("This is an error message", IMessageProvider.ERROR);
    initUIMainContainer(mainContainer);
    mainContainer.setTabList(new Control[] { dockerHostImportKeyvaultCredsRadioButton, dockerHostImportKeyvaultComboBox, dockerHostNewCredsRadioButton, credsTabfolder, dockerHostSaveCredsCheckBox, dockerHostNewKeyvaultTextField });
}
Also used : TabItem(org.eclipse.swt.widgets.TabItem) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Button(org.eclipse.swt.widgets.Button) ManagedForm(org.eclipse.ui.forms.ManagedForm) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) TabFolder(org.eclipse.swt.widgets.TabFolder) Combo(org.eclipse.swt.widgets.Combo) Text(org.eclipse.swt.widgets.Text)

Example 9 with TabFolder

use of org.eclipse.swt.widgets.TabFolder 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)

Example 10 with TabFolder

use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.

the class CreateViewDialog method createDialogArea.

protected Control createDialogArea(Composite parent) {
    parentComp = (Composite) super.createDialogArea(parent);
    Composite composite = new Composite(parentComp, SWT.NONE);
    {
        final GridData gdComposite = new GridData(SWT.FILL, SWT.FILL, true, true);
        composite.setLayoutData(gdComposite);
        GridLayout layout = new GridLayout();
        layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
        layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
        layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
        layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
        layout.numColumns = 1;
        composite.setLayout(layout);
    }
    tabFolder = new TabFolder(composite, SWT.NONE);
    final GridData gdTabFolder = new GridData(SWT.FILL, SWT.FILL, true, true);
    tabFolder.setLayoutData(gdTabFolder);
    final TabItem generalTabItem = new TabItem(tabFolder, SWT.NONE);
    generalTabItem.setText(Messages.tabItemGeneral);
    final Composite compositeGenaral = createGeneralComposite();
    generalTabItem.setControl(compositeGenaral);
    final TabItem ddlTabItem = new TabItem(tabFolder, SWT.NONE);
    ddlTabItem.setText(Messages.tabItemSQLScript);
    final Composite sqlScriptComp = createSQLScriptComposite();
    ddlTabItem.setControl(sqlScriptComp);
    tabFolder.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            boolean isFirstTab = tabFolder.getSelectionIndex() == 0;
            boolean isLastTab = tabFolder.getSelectionIndex() == tabFolder.getItemCount() - 1;
            if (isFirstTab) {
                tableText.setFocus();
            } else if (isLastTab) {
                StringBuilder sb = new StringBuilder();
                String dropSql = makeDropSQLScript();
                if (dropSql.length() > 0) {
                    sb.append(dropSql);
                    sb.append(StringUtil.NEWLINE);
                    sb.append(StringUtil.NEWLINE);
                    sb.append(StringUtil.NEWLINE);
                }
                sb.append(makeCreateSQLScript());
                String ownerNew = ownerCombo.getText();
                String ownerOld = null;
                if (isNewTableFlag) {
                    DatabaseInfo dbInfo = database.getDatabaseInfo();
                    ownerOld = dbInfo.getAuthLoginedDbUserInfo().getName();
                } else {
                    ownerOld = classInfo.getOwnerName();
                }
                boolean isSameUser = StringUtil.isEqualIgnoreCase(ownerOld, ownerNew);
                if (!isSameUser) {
                    sb.append(";");
                    sb.append(StringUtil.NEWLINE);
                    sb.append(StringUtil.NEWLINE);
                    sb.append(StringUtil.NEWLINE);
                    sb.append(makeChangeOwnerSQLScript()).append(";");
                    sb.append(StringUtil.NEWLINE);
                }
                sqlText.setText(formatSql(sb.toString()));
            }
        }
    });
    init();
    tableText.setFocus();
    return parent;
}
Also used : TabItem(org.eclipse.swt.widgets.TabItem) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) DatabaseInfo(com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) TabFolder(org.eclipse.swt.widgets.TabFolder) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Aggregations

TabFolder (org.eclipse.swt.widgets.TabFolder)40 TabItem (org.eclipse.swt.widgets.TabItem)33 GridData (org.eclipse.swt.layout.GridData)30 Composite (org.eclipse.swt.widgets.Composite)28 GridLayout (org.eclipse.swt.layout.GridLayout)27 SelectionEvent (org.eclipse.swt.events.SelectionEvent)12 Text (org.eclipse.swt.widgets.Text)12 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)11 Button (org.eclipse.swt.widgets.Button)11 Label (org.eclipse.swt.widgets.Label)10 Combo (org.eclipse.swt.widgets.Combo)5 Shell (org.eclipse.swt.widgets.Shell)5 FillLayout (org.eclipse.swt.layout.FillLayout)4 Control (org.eclipse.swt.widgets.Control)4 Display (org.eclipse.swt.widgets.Display)4 Group (org.eclipse.swt.widgets.Group)4 Table (org.eclipse.swt.widgets.Table)4 Link (org.eclipse.swt.widgets.Link)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 SWT (org.eclipse.swt.SWT)2