Search in sources :

Example 1 with ManagedForm

use of org.eclipse.ui.forms.ManagedForm 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 2 with ManagedForm

use of org.eclipse.ui.forms.ManagedForm in project azure-tools-for-java by Microsoft.

the class AzureExportDockerTlsKeysDialog method createDialogArea.

/**
	 * Create contents of the dialog.
	 * @param parent
	 */
@Override
protected Control createDialogArea(Composite parent) {
    setTitle("Export TLS Certificates");
    setMessage(pathToolTip);
    Composite area = (Composite) super.createDialogArea(parent);
    Composite mainContainer = new Composite(area, SWT.NONE);
    mainContainer.setLayout(new GridLayout(2, false));
    GridData gd_mainContainer = new GridData(GridData.FILL_BOTH);
    gd_mainContainer.widthHint = 524;
    mainContainer.setLayoutData(gd_mainContainer);
    exportTlsPathTextField = new Text(mainContainer, SWT.BORDER);
    exportTlsPathTextField.setToolTipText(pathToolTip);
    exportTlsPathTextField.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent event) {
            path = (((Text) event.getSource()).getText());
            if (path != null && Files.isDirectory(Paths.get(path))) {
                errDispatcher.removeMessage("exportTlsPathTextField", exportTlsPathTextField);
                setErrorMessage(null);
            } else {
                errDispatcher.addMessage("exportTlsPathTextField", pathToolTip, null, IMessageProvider.ERROR, exportTlsPathTextField);
                setErrorMessage("Invalid directory path");
            }
        }
    });
    GridData gd_exportTlsPathTextField = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_exportTlsPathTextField.widthHint = 380;
    gd_exportTlsPathTextField.verticalIndent = 5;
    gd_exportTlsPathTextField.horizontalIndent = 5;
    exportTlsPathTextField.setLayoutData(gd_exportTlsPathTextField);
    Button exportTlsPathBrowseButton = new Button(mainContainer, SWT.NONE);
    exportTlsPathBrowseButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            DirectoryDialog directoryDialog = new DirectoryDialog(exportTlsPathTextField.getShell());
            directoryDialog.setText("Select TLS Certificates Directory");
            directoryDialog.setFilterPath(System.getProperty("user.home"));
            String pathSelected = directoryDialog.open();
            if (pathSelected == null) {
                return;
            }
            path = pathSelected;
            exportTlsPathTextField.setText(path);
        }
    });
    GridData gd_exportTlsPathBrowseButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_exportTlsPathBrowseButton.verticalIndent = 5;
    exportTlsPathBrowseButton.setLayoutData(gd_exportTlsPathBrowseButton);
    exportTlsPathBrowseButton.setText("Browse...");
    Label lblNote = new Label(mainContainer, SWT.NONE);
    GridData gd_lblNote = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblNote.verticalIndent = 5;
    gd_lblNote.horizontalIndent = 5;
    lblNote.setLayoutData(gd_lblNote);
    lblNote.setText("Note:");
    new Label(mainContainer, SWT.NONE);
    Label lblAnyExisting = new Label(mainContainer, SWT.NONE);
    GridData gd_lblAnyExisting = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblAnyExisting.horizontalIndent = 20;
    lblAnyExisting.setLayoutData(gd_lblAnyExisting);
    lblAnyExisting.setText("Any existing \"ca.pem\", \"ca-key.pem\", \"cert.pem\",\"key.pem\", \"server.pem\" and \"server-key.pem\"");
    Label lblWillBeOverwritten = new Label(mainContainer, SWT.NONE);
    GridData gd_lblWillBeOverwritten = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblWillBeOverwritten.horizontalIndent = 20;
    lblWillBeOverwritten.setLayoutData(gd_lblWillBeOverwritten);
    lblWillBeOverwritten.setText("certificate files in the selected directory will be overwritten!");
    FormToolkit toolkit = new FormToolkit(mainContainer.getDisplay());
    toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
    managedForm = new ManagedForm(mainContainer);
    errMsgForm = managedForm.getForm();
    errMsgForm.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    errMsgForm.setBackground(mainContainer.getBackground());
    errDispatcher = managedForm.getMessageManager();
    return area;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) ManagedForm(org.eclipse.ui.forms.ManagedForm) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 3 with ManagedForm

use of org.eclipse.ui.forms.ManagedForm in project azure-tools-for-java by Microsoft.

the class AzureInputDockerLoginCredsDialog method createDialogArea.

/**
	 * Create contents of the dialog.
	 * @param parent
	 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite area = (Composite) super.createDialogArea(parent);
    Composite mainContainer = new Composite(area, SWT.NONE);
    mainContainer.setLayout(new GridLayout(4, false));
    mainContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
    copyFromAzureKeyButton = new Button(mainContainer, SWT.NONE);
    GridData gd_copyFromAzureKeyButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
    gd_copyFromAzureKeyButton.horizontalIndent = 3;
    copyFromAzureKeyButton.setLayoutData(gd_copyFromAzureKeyButton);
    copyFromAzureKeyButton.setText("Copy from Azure Key Vault...");
    new Label(mainContainer, SWT.NONE);
    Label separatorCopyKeyVaultLabel = new Label(mainContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    GridData gd_separatorCopyKeyVaultLabel = new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1);
    gd_separatorCopyKeyVaultLabel.widthHint = 199;
    separatorCopyKeyVaultLabel.setLayoutData(gd_separatorCopyKeyVaultLabel);
    new Label(mainContainer, SWT.NONE);
    Label lblUsername = new Label(mainContainer, 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(mainContainer, SWT.BORDER);
    dockerHostUsernameTextField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(mainContainer, SWT.NONE);
    Label lblPassword = new Label(mainContainer, 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(mainContainer, SWT.BORDER | SWT.PASSWORD);
    dockerHostFirstPwdField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(mainContainer, SWT.NONE);
    Label lblConfirm = new Label(mainContainer, 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(mainContainer, SWT.BORDER | SWT.PASSWORD);
    dockerHostSecondPwdField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(mainContainer, SWT.NONE);
    new Label(mainContainer, SWT.NONE);
    new Label(mainContainer, SWT.NONE);
    new Label(mainContainer, SWT.NONE);
    new Label(mainContainer, SWT.NONE);
    Label lblSsh_1 = new Label(mainContainer, SWT.NONE);
    GridData gd_lblSsh_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblSsh_1.horizontalIndent = 3;
    lblSsh_1.setLayoutData(gd_lblSsh_1);
    lblSsh_1.setText("SSH");
    Label lblSsh = new Label(mainContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    lblSsh.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
    lblSsh.setText("SSH");
    new Label(mainContainer, SWT.NONE);
    dockerHostKeepSshRadioButton = new Button(mainContainer, SWT.RADIO);
    GridData gd_dockerHostKeepSshRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
    gd_dockerHostKeepSshRadioButton.horizontalIndent = 5;
    dockerHostKeepSshRadioButton.setLayoutData(gd_dockerHostKeepSshRadioButton);
    dockerHostKeepSshRadioButton.setText("Use current keys");
    new Label(mainContainer, SWT.NONE);
    dockerHostImportSshRadioButton = new Button(mainContainer, SWT.RADIO);
    GridData gd_dockerHostImportSshRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
    gd_dockerHostImportSshRadioButton.horizontalIndent = 5;
    dockerHostImportSshRadioButton.setLayoutData(gd_dockerHostImportSshRadioButton);
    dockerHostImportSshRadioButton.setText("Import from directory:");
    new Label(mainContainer, SWT.NONE);
    new Label(mainContainer, SWT.NONE);
    dockerHostImportSSHTextField = new Text(mainContainer, SWT.BORDER);
    dockerHostImportSSHTextField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    dockerHostImportSSHBrowseButton = new Button(mainContainer, SWT.NONE);
    dockerHostImportSSHBrowseButton.setText("Browse...");
    dockerHostAutoSshRadioButton = new Button(mainContainer, SWT.RADIO);
    GridData gd_dockerHostAutoSshRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
    gd_dockerHostAutoSshRadioButton.horizontalIndent = 5;
    dockerHostAutoSshRadioButton.setLayoutData(gd_dockerHostAutoSshRadioButton);
    dockerHostAutoSshRadioButton.setText("Regenerate keys");
    new Label(mainContainer, SWT.NONE);
    FormToolkit toolkit = new FormToolkit(mainContainer.getDisplay());
    toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
    managedForm = new ManagedForm(mainContainer);
    errMsgForm = managedForm.getForm();
    errMsgForm.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    errMsgForm.setBackground(mainContainer.getBackground());
    errDispatcher = managedForm.getMessageManager();
    initUIComponents(mainContainer);
    return area;
}
Also used : 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) Text(org.eclipse.swt.widgets.Text)

Example 4 with ManagedForm

use of org.eclipse.ui.forms.ManagedForm in project jbosstools-hibernate by jbosstools.

the class HibernateConfigurationForm method createPartControl.

public void createPartControl(Composite cotainer) {
    this.container = cotainer;
    managedForm = new ManagedForm(container);
    getForm().setText(MapperMessages.HibernateConfigurationForm_hibernate_configuration);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = true;
    getForm().getBody().setLayout(layout);
    createFormParts();
    managedForm.initialize();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ManagedForm(org.eclipse.ui.forms.ManagedForm)

Example 5 with ManagedForm

use of org.eclipse.ui.forms.ManagedForm in project webtools.servertools by eclipse.

the class OverviewEditorPart method createPartControl.

/**
 * Creates the SWT controls for this workbench part.
 *
 * @param parent the parent control
 */
public final void createPartControl(final Composite parent) {
    managedForm = new ManagedForm(parent);
    setManagedForm(managedForm);
    ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();
    toolkit.decorateFormHeading(form.getForm());
    form.setText(Messages.serverEditorOverviewPageTitle);
    form.setImage(ImageResource.getImage(ImageResource.IMG_SERVER));
    form.getBody().setLayout(new GridLayout());
    Composite columnComp = toolkit.createComposite(form.getBody());
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    // layout.marginHeight = 10;
    // layout.marginWidth = 10;
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = 10;
    columnComp.setLayout(layout);
    columnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
    // left column
    Composite leftColumnComp = toolkit.createComposite(columnComp);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 10;
    layout.horizontalSpacing = 0;
    leftColumnComp.setLayout(layout);
    leftColumnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
    createGeneralSection(leftColumnComp, toolkit);
    insertSections(leftColumnComp, "org.eclipse.wst.server.editor.overview.left");
    // right column
    Composite rightColumnComp = toolkit.createComposite(columnComp);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 10;
    layout.horizontalSpacing = 0;
    rightColumnComp.setLayout(layout);
    rightColumnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
    createPublishSection(rightColumnComp, toolkit);
    createTimeoutSection(rightColumnComp, toolkit);
    insertSections(rightColumnComp, "org.eclipse.wst.server.editor.overview.right");
    form.reflow(true);
    initialize();
    if (serverName != null) {
        serverName.setFocus();
    } else if (serverConfiguration != null)
        serverConfiguration.setFocus();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ManagedForm(org.eclipse.ui.forms.ManagedForm) IManagedForm(org.eclipse.ui.forms.IManagedForm) GridData(org.eclipse.swt.layout.GridData)

Aggregations

ManagedForm (org.eclipse.ui.forms.ManagedForm)11 GridLayout (org.eclipse.swt.layout.GridLayout)10 GridData (org.eclipse.swt.layout.GridData)9 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)9 Composite (org.eclipse.swt.widgets.Composite)8 Button (org.eclipse.swt.widgets.Button)7 Label (org.eclipse.swt.widgets.Label)7 Text (org.eclipse.swt.widgets.Text)7 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Combo (org.eclipse.swt.widgets.Combo)3 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)2 TabFolder (org.eclipse.swt.widgets.TabFolder)2 TabItem (org.eclipse.swt.widgets.TabItem)2 URL (java.net.URL)1 LocalResourceManager (org.eclipse.jface.resource.LocalResourceManager)1 ComboViewer (org.eclipse.jface.viewers.ComboViewer)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1