Search in sources :

Example 6 with ManagedForm

use of org.eclipse.ui.forms.ManagedForm in project hale by halestudio.

the class MdlEditorView method createPartControl.

/**
 * This is a callback that will allow us
 * to create the viewer and initialize it.
 */
public void createPartControl(Composite parent) {
    this.formToolkit = new FormToolkit(parent.getDisplay());
    this.overviewForm = this.formToolkit.createScrolledForm(parent);
    this.managedForm = new ManagedForm(this.formToolkit, this.overviewForm);
    this.block = new MismatchPropertiesBlock();
    // $NON-NLS-1$
    this.overviewForm.setText("Mismatch Overview");
    this.overviewForm.setToolTipText("Select a Mismatch and get overview " + "information.");
    block.createContent(this.managedForm);
    this.block.setContentWeight(new int[] { 25, 75 });
    this.overviewForm.setBackgroundImage(MdlUiPlugin.getDefault().getImage(MdlUiPlugin.IMG_FORM_BG));
}
Also used : FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) ManagedForm(org.eclipse.ui.forms.ManagedForm)

Example 7 with ManagedForm

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

the class AzureExportDockerSshKeysDialog method createDialogArea.

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

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

        @Override
        public void widgetSelected(SelectionEvent e) {
            DirectoryDialog directoryDialog = new DirectoryDialog(exportSshPathTextField.getShell());
            directoryDialog.setText("Select SSH Keys Directory");
            directoryDialog.setFilterPath(System.getProperty("user.home"));
            String pathSelected = directoryDialog.open();
            if (pathSelected == null) {
                return;
            }
            path = pathSelected;
            exportSshPathTextField.setText(path);
        }
    });
    GridData gd_exportSshPathBrowseButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_exportSshPathBrowseButton.verticalIndent = 5;
    exportSshPathBrowseButton.setLayoutData(gd_exportSshPathBrowseButton);
    exportSshPathBrowseButton.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 lblAnyExistingidrsa = new Label(mainContainer, SWT.NONE);
    GridData gd_lblAnyExistingidrsa = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblAnyExistingidrsa.horizontalIndent = 20;
    lblAnyExistingidrsa.setLayoutData(gd_lblAnyExistingidrsa);
    lblAnyExistingidrsa.setText("Any existing \"id_rsa\" and \"id_rsa.pub\" files in the selected directory");
    Label lblWillBeOverwritten = new Label(mainContainer, SWT.NONE);
    GridData gd_lblWillBeOverwritten = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblWillBeOverwritten.horizontalIndent = 20;
    lblWillBeOverwritten.setLayoutData(gd_lblWillBeOverwritten);
    lblWillBeOverwritten.setText("will be overwritten!");
    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();
    //		return area;
    return super.createDialogArea(parent);
}
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 8 with ManagedForm

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

the class AzureNewDockerConfigPage 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(3, false));
    Label lblName = new Label(mainContainer, SWT.NONE);
    GridData gd_lblName = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblName.horizontalIndent = 5;
    lblName.setLayoutData(gd_lblName);
    lblName.setText("Name:");
    dockerHostNameTextField = new Text(mainContainer, SWT.BORDER);
    GridData gd_dockerHostNameTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_dockerHostNameTextField.horizontalIndent = 3;
    gd_dockerHostNameTextField.widthHint = 200;
    dockerHostNameTextField.setLayoutData(gd_dockerHostNameTextField);
    Label lblNewLabel = new Label(mainContainer, SWT.NONE);
    GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblNewLabel.horizontalIndent = 5;
    lblNewLabel.setLayoutData(gd_lblNewLabel);
    lblNewLabel.setText("Subscription:");
    dockerSubscriptionComboViewer = new ComboViewer(mainContainer, SWT.READ_ONLY);
    dockerSubscriptionCombo = dockerSubscriptionComboViewer.getCombo();
    dockerSubscriptionCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(mainContainer, SWT.NONE);
    Label lblId = new Label(mainContainer, SWT.NONE);
    GridData gd_lblId = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblId.horizontalIndent = 5;
    lblId.setLayoutData(gd_lblId);
    lblId.setText("Id:");
    dockerSubscriptionIdTextField = new Text(mainContainer, SWT.NONE);
    GridData gd_dockerSubscriptionIdTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerSubscriptionIdTextField.horizontalIndent = 3;
    gd_dockerSubscriptionIdTextField.widthHint = 300;
    dockerSubscriptionIdTextField.setLayoutData(gd_dockerSubscriptionIdTextField);
    dockerSubscriptionIdTextField.setEditable(false);
    dockerSubscriptionIdTextField.setBackground(mainContainer.getBackground());
    new Label(mainContainer, SWT.NONE);
    Label lblRegion = new Label(mainContainer, SWT.NONE);
    GridData gd_lblRegion = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblRegion.horizontalIndent = 5;
    lblRegion.setLayoutData(gd_lblRegion);
    lblRegion.setText("Region:");
    dockerLocationComboBox = new Combo(mainContainer, SWT.READ_ONLY);
    GridData gd_dockerLocationComboBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerLocationComboBox.widthHint = 200;
    dockerLocationComboBox.setLayoutData(gd_dockerLocationComboBox);
    new Label(mainContainer, SWT.NONE);
    hostDetailsTabFolder = new TabFolder(mainContainer, SWT.NONE);
    GridData gd_hostDetailsTabFolder = new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1);
    gd_hostDetailsTabFolder.heightHint = 128;
    hostDetailsTabFolder.setLayoutData(gd_hostDetailsTabFolder);
    vmKindTableItem = new TabItem(hostDetailsTabFolder, SWT.NONE);
    vmKindTableItem.setText("OS and Size");
    vmKindComposite = new Composite(hostDetailsTabFolder, SWT.NONE);
    vmKindTableItem.setControl(vmKindComposite);
    vmKindComposite.setLayout(new GridLayout(3, false));
    Label lblNewLabel_1 = new Label(vmKindComposite, SWT.NONE);
    lblNewLabel_1.setText("Host OS:");
    dockerHostOSTypeComboBox = new Combo(vmKindComposite, SWT.READ_ONLY);
    GridData gd_dockerHostOSTypeComboBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostOSTypeComboBox.widthHint = 200;
    dockerHostOSTypeComboBox.setLayoutData(gd_dockerHostOSTypeComboBox);
    new Label(vmKindComposite, SWT.NONE);
    Label lblSize = new Label(vmKindComposite, SWT.NONE);
    lblSize.setText("Size:");
    dockerHostVMSizeComboBox = new Combo(vmKindComposite, SWT.READ_ONLY);
    GridData gd_dockerHostVMSizeComboBox = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
    gd_dockerHostVMSizeComboBox.widthHint = 200;
    dockerHostVMSizeComboBox.setLayoutData(gd_dockerHostVMSizeComboBox);
    Link dockerPricingHyperlink = new Link(vmKindComposite, SWT.NONE);
    dockerPricingHyperlink.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/"));
            } catch (Exception ex) {
                DefaultLoader.getUIHelper().logError(ex.getMessage(), ex);
            }
        }
    });
    dockerPricingHyperlink.setText("<a>Pricing</a>");
    GridData gd_dockerPricingHyperlink = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 2);
    dockerPricingHyperlink.setLayoutData(gd_dockerPricingHyperlink);
    dockerHostVMPreferredSizesCheckBox = new Button(vmKindComposite, SWT.CHECK);
    dockerHostVMPreferredSizesCheckBox.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
    dockerHostVMPreferredSizesCheckBox.setText("Show preferred sizes only");
    rgTableItem = new TabItem(hostDetailsTabFolder, SWT.NONE);
    rgTableItem.setText("Resource Group");
    Composite rgComposite = new Composite(hostDetailsTabFolder, SWT.NONE);
    rgTableItem.setControl(rgComposite);
    rgComposite.setLayout(new GridLayout(2, false));
    dockerHostNewRGRadioButton = new Button(rgComposite, SWT.RADIO);
    dockerHostNewRGRadioButton.setText("New resource group:");
    dockerHostRGTextField = new Text(rgComposite, SWT.BORDER);
    GridData gd_dockerHostRGTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostRGTextField.horizontalIndent = 3;
    gd_dockerHostRGTextField.widthHint = 200;
    dockerHostRGTextField.setLayoutData(gd_dockerHostRGTextField);
    dockerHostSelectRGRadioButton = new Button(rgComposite, SWT.RADIO);
    dockerHostSelectRGRadioButton.setText("Existing resource group:");
    dockerHostSelectRGComboBox = new Combo(rgComposite, SWT.READ_ONLY);
    GridData gd_dockerHostSelectRGComboBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostSelectRGComboBox.widthHint = 220;
    dockerHostSelectRGComboBox.setLayoutData(gd_dockerHostSelectRGComboBox);
    networkTableItem = new TabItem(hostDetailsTabFolder, SWT.NONE);
    networkTableItem.setText("Network");
    Composite networkComposite = new Composite(hostDetailsTabFolder, SWT.NONE);
    networkTableItem.setControl(networkComposite);
    networkComposite.setLayout(new GridLayout(2, false));
    dockerHostNewVNetRadioButton = new Button(networkComposite, SWT.RADIO);
    dockerHostNewVNetRadioButton.setText("New virtual network");
    dockerHostNewVNetNameTextField = new Text(networkComposite, SWT.BORDER);
    GridData gd_dockerHostNewVNetNameTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostNewVNetNameTextField.horizontalIndent = 3;
    gd_dockerHostNewVNetNameTextField.widthHint = 200;
    dockerHostNewVNetNameTextField.setLayoutData(gd_dockerHostNewVNetNameTextField);
    Label lblAddressSpacecdir = new Label(networkComposite, SWT.NONE);
    GridData gd_lblAddressSpacecdir = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblAddressSpacecdir.horizontalIndent = 18;
    lblAddressSpacecdir.setLayoutData(gd_lblAddressSpacecdir);
    lblAddressSpacecdir.setText("Address space (CDIR):");
    dockerHostNewVNetAddrSpaceTextField = new Text(networkComposite, SWT.BORDER);
    GridData gd_dockerHostNewVNetAddrSpaceTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostNewVNetAddrSpaceTextField.horizontalIndent = 3;
    gd_dockerHostNewVNetAddrSpaceTextField.widthHint = 200;
    dockerHostNewVNetAddrSpaceTextField.setLayoutData(gd_dockerHostNewVNetAddrSpaceTextField);
    dockerHostSelectVNetRadioButton = new Button(networkComposite, SWT.RADIO);
    dockerHostSelectVNetRadioButton.setText("Existing virtual network:");
    dockerHostSelectVnetComboBox = new Combo(networkComposite, SWT.READ_ONLY);
    GridData gd_dockerHostSelectVnetComboBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostSelectVnetComboBox.widthHint = 220;
    dockerHostSelectVnetComboBox.setLayoutData(gd_dockerHostSelectVnetComboBox);
    Label lblSubnet = new Label(networkComposite, SWT.NONE);
    GridData gd_lblSubnet = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblSubnet.horizontalIndent = 18;
    lblSubnet.setLayoutData(gd_lblSubnet);
    lblSubnet.setText("Subnet:");
    dockerHostSelectSubnetComboBox = new Combo(networkComposite, SWT.READ_ONLY);
    GridData gd_dockerHostSelectSubnetComboBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostSelectSubnetComboBox.widthHint = 220;
    dockerHostSelectSubnetComboBox.setLayoutData(gd_dockerHostSelectSubnetComboBox);
    storageTableItem = new TabItem(hostDetailsTabFolder, SWT.NONE);
    storageTableItem.setText("Storage");
    Composite storageComposite = new Composite(hostDetailsTabFolder, SWT.NONE);
    storageTableItem.setControl(storageComposite);
    storageComposite.setLayout(new GridLayout(2, false));
    dockerHostNewStorageRadioButton = new Button(storageComposite, SWT.RADIO);
    dockerHostNewStorageRadioButton.setText("New storage account:");
    dockerNewStorageTextField = new Text(storageComposite, SWT.BORDER);
    GridData gd_dockerNewStorageTextField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerNewStorageTextField.horizontalIndent = 3;
    gd_dockerNewStorageTextField.widthHint = 200;
    dockerNewStorageTextField.setLayoutData(gd_dockerNewStorageTextField);
    dockerHostSelectStorageRadioButton = new Button(storageComposite, SWT.RADIO);
    dockerHostSelectStorageRadioButton.setText("Existing storage account:");
    dockerSelectStorageComboBox = new Combo(storageComposite, SWT.READ_ONLY);
    GridData gd_dockerSelectStorageComboBox = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_dockerSelectStorageComboBox.widthHint = 220;
    dockerSelectStorageComboBox.setLayoutData(gd_dockerSelectStorageComboBox);
    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.FILL, SWT.CENTER, true, true, 2, 1));
    //		errMsgForm.setBackground(mainContainer.getBackground());
    errDispatcher = managedForm.getMessageManager();
    initUIMainContainer(mainContainer);
}
Also used : Composite(org.eclipse.swt.widgets.Composite) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) 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) URL(java.net.URL) TabItem(org.eclipse.swt.widgets.TabItem) GridLayout(org.eclipse.swt.layout.GridLayout) ComboViewer(org.eclipse.jface.viewers.ComboViewer) Button(org.eclipse.swt.widgets.Button) ManagedForm(org.eclipse.ui.forms.ManagedForm) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Link(org.eclipse.swt.widgets.Link)

Example 9 with ManagedForm

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

the class AzureConfigureDockerContainerStep method createControl.

/**
	 * Create contents of the wizard.
	 * @param parent
	 */
public void createControl(Composite parent) {
    Composite mainContainer = new Composite(parent, SWT.NULL);
    setControl(mainContainer);
    mainContainer.setLayout(new GridLayout(3, false));
    Label lblDockerContainerName = new Label(mainContainer, SWT.NONE);
    GridData gd_lblDockerContainerName = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblDockerContainerName.horizontalIndent = 1;
    lblDockerContainerName.setLayoutData(gd_lblDockerContainerName);
    lblDockerContainerName.setText("Container name:");
    dockerContainerNameTextField = new Text(mainContainer, SWT.BORDER);
    dockerContainerNameTextField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(mainContainer, SWT.NONE);
    Label lblNewLabel = new Label(mainContainer, SWT.NONE);
    GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblNewLabel.horizontalIndent = 1;
    lblNewLabel.setLayoutData(gd_lblNewLabel);
    lblNewLabel.setText("Dockerfile settings");
    Label lblDockerfileSettings = new Label(mainContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    lblDockerfileSettings.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
    predefinedDockerfileRadioButton = new Button(mainContainer, SWT.RADIO);
    GridData gd_predefinedDockerfileRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_predefinedDockerfileRadioButton.horizontalIndent = 3;
    predefinedDockerfileRadioButton.setLayoutData(gd_predefinedDockerfileRadioButton);
    predefinedDockerfileRadioButton.setText("Predefined Docker image");
    new Label(mainContainer, SWT.NONE);
    dockerfileComboBox = new Combo(mainContainer, SWT.NONE);
    GridData gd_dockerfileComboBox = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
    gd_dockerfileComboBox.horizontalIndent = 22;
    dockerfileComboBox.setLayoutData(gd_dockerfileComboBox);
    new Label(mainContainer, SWT.NONE);
    customDockerfileRadioButton = new Button(mainContainer, SWT.RADIO);
    GridData gd_customDockerfileRadioButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_customDockerfileRadioButton.horizontalIndent = 3;
    customDockerfileRadioButton.setLayoutData(gd_customDockerfileRadioButton);
    customDockerfileRadioButton.setText("Custom Dockerfile");
    new Label(mainContainer, SWT.NONE);
    customDockerfileTextField = new Text(mainContainer, SWT.BORDER);
    GridData gd_customDockerfileTextField = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
    gd_customDockerfileTextField.horizontalIndent = 22;
    customDockerfileTextField.setLayoutData(gd_customDockerfileTextField);
    customDockerfileBrowseButton = new Button(mainContainer, SWT.NONE);
    customDockerfileBrowseButton.setText("Browse...");
    Label label = new Label(mainContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
    Label lblPortSettings = new Label(mainContainer, SWT.NONE);
    GridData gd_lblPortSettings = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblPortSettings.horizontalIndent = 1;
    lblPortSettings.setLayoutData(gd_lblPortSettings);
    lblPortSettings.setText("Port settings:");
    dockerContainerPortSettings = new Text(mainContainer, SWT.BORDER);
    dockerContainerPortSettings.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(mainContainer, SWT.NONE);
    Label lblForExampletcp = new Label(mainContainer, SWT.NONE);
    GridData gd_lblForExampletcp = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblForExampletcp.horizontalIndent = 22;
    lblForExampletcp.setLayoutData(gd_lblForExampletcp);
    lblForExampletcp.setText("For example \"10022:22\"");
    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.setVisible(false);
    //		errMsgForm.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1));
    //		errMsgForm.setBackground(mainContainer.getBackground());
    errDispatcher = managedForm.getMessageManager();
    //		errMsgForm.setMessage("This is an error message", IMessageProvider.ERROR);
    initUIMainContainer(mainContainer);
}
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) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo)

Example 10 with ManagedForm

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

the class AzureSelectDockerHostPage method createControl.

/**
	 * Create contents of the wizard.
	 * @param parent
	 */
public void createControl(Composite parent) {
    mainContainer = new Composite(parent, SWT.NULL);
    setControl(mainContainer);
    mainContainer.setLayout(new GridLayout(4, false));
    Label lblNewLabel = new Label(mainContainer, SWT.NONE);
    GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblNewLabel.verticalIndent = 1;
    gd_lblNewLabel.horizontalIndent = 1;
    lblNewLabel.setLayoutData(gd_lblNewLabel);
    lblNewLabel.setText("Docker image name:");
    dockerImageNameTextField = new Text(mainContainer, SWT.BORDER);
    GridData gd_dockerImageNameTextField = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_dockerImageNameTextField.verticalIndent = 1;
    dockerImageNameTextField.setLayoutData(gd_dockerImageNameTextField);
    new Label(mainContainer, SWT.NONE);
    Label lblNewLabel_1 = new Label(mainContainer, SWT.NONE);
    GridData gd_lblNewLabel_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
    gd_lblNewLabel_1.horizontalIndent = 1;
    lblNewLabel_1.setLayoutData(gd_lblNewLabel_1);
    lblNewLabel_1.setText("Artifact to deploy (.WAR or .JAR):");
    dockerArtifactPathTextField = new Text(mainContainer, SWT.BORDER);
    dockerArtifactPathTextField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    dockerArtifactPathBrowseButton = new Button(mainContainer, SWT.NONE);
    dockerArtifactPathBrowseButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    dockerArtifactPathBrowseButton.setText("Browse...");
    Label lblHosts = new Label(mainContainer, SWT.NONE);
    lblHosts.setText("Hosts");
    Label label = new Label(mainContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
    dockerHostsTableViewer = new TableViewer(mainContainer, SWT.SINGLE | SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
    dockerHostsTable = dockerHostsTableViewer.getTable();
    dockerHostsTable.setHeaderVisible(true);
    dockerHostsTable.setLinesVisible(true);
    dockerHostsTable.setToolTipText("Check a Docker host from the list or create a new host");
    GridData gd_dockerHostsTableView = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 7);
    gd_dockerHostsTableView.horizontalIndent = 1;
    gd_dockerHostsTableView.heightHint = 155;
    dockerHostsTable.setLayoutData(gd_dockerHostsTableView);
    dockerHostsRefreshButton = new Button(mainContainer, SWT.NONE);
    GridData gd_dockerHostsRefreshButton = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
    gd_dockerHostsRefreshButton.verticalIndent = 1;
    dockerHostsRefreshButton.setLayoutData(gd_dockerHostsRefreshButton);
    dockerHostsRefreshButton.setText(REFRESH);
    dockerHostsViewButton = new Button(mainContainer, SWT.NONE);
    dockerHostsViewButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    dockerHostsViewButton.setText(VIEW);
    dockerHostsAddButton = new Button(mainContainer, SWT.NONE);
    dockerHostsAddButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    dockerHostsAddButton.setText(ADD);
    dockerHostsDeleteButton = new Button(mainContainer, SWT.NONE);
    dockerHostsDeleteButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    dockerHostsDeleteButton.setText("Delete");
    dockerHostsEditButton = new Button(mainContainer, SWT.NONE);
    dockerHostsEditButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    dockerHostsEditButton.setText("Edit");
    new Label(mainContainer, SWT.NONE);
    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.setVisible(false);
    //		errMsgForm.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1));
    //		errMsgForm.setBackground(mainContainer.getBackground());
    errDispatcher = managedForm.getMessageManager();
    //		errMsgForm.setMessage("This is an error message", IMessageProvider.ERROR);
    initUIMainContainer(mainContainer);
}
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) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) Text(org.eclipse.swt.widgets.Text) TableViewer(org.eclipse.jface.viewers.TableViewer)

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