Example usage for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH

List of usage examples for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH.

Prototype

int MINIMUM_MESSAGE_AREA_WIDTH

To view the source code for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH.

Click Source Link

Document

Minimum width of message area in dialog units (value 300).

Usage

From source file:org.eclipse.bpmn2.modeler.ui.property.dialogs.NamespacesEditingDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    composite.getChildren();/*from   w w  w  .j a v a 2 s .c o  m*/
    if (namespace != null) {
        Label label = new Label(composite, SWT.WRAP);
        label.setText(Messages.NamespacesEditingDialog_Namespace);
        GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
                | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
        label.setLayoutData(data);
        label.setFont(parent.getFont());

        namespaceText = new Text(composite, getInputTextStyle());
        namespaceText.setText(namespace);
        namespaceText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
        namespaceText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                validateInput();
            }
        });

        namespaceErrorText = new Text(composite, SWT.READ_ONLY | SWT.WRAP);
        namespaceErrorText
                .setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
        namespaceErrorText
                .setBackground(namespaceErrorText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));

    }
    return composite;
}

From source file:org.eclipse.buckminster.jnlp.HelpLinkErrorDialog.java

License:Open Source License

@Override
protected Control createMessageArea(Composite composite) {

    // create image
    Image image = getImage();/*w w w . j  ava 2 s  .c  o  m*/
    if (image != null) {
        imageLabel = new Label(composite, SWT.NULL);
        image.setBackground(imageLabel.getBackground());
        imageLabel.setImage(image);
        imageLabel.setLayoutData(
                new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING));
    }

    Composite msgComposite = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = layout.marginWidth = 0;
    msgComposite.setLayout(layout);

    GridData data;

    // create message
    if (message != null) {
        Label msgLabel = new Label(msgComposite, getMessageLabelStyle());
        msgLabel.setText(message);
        data = new GridData(
                GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
        msgLabel.setLayoutData(data);
    }

    new Label(msgComposite, SWT.NONE);

    Composite linkComposite = new Composite(msgComposite, SWT.NONE);
    layout = new GridLayout(2, false);
    layout.marginHeight = layout.marginWidth = 0;
    linkComposite.setLayout(layout);

    new Label(linkComposite, SWT.NONE).setText(Messages.HelpLinkErrorDialog_read_more_at);

    Link helpLink = new Link(linkComposite, SWT.NONE);
    helpLink.setText("<a>" + m_helpLinkTitle + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
    helpLink.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (m_helpLinkURL != null) {
                if (m_errorCode == null) {
                    Program.launch(m_helpLinkURL);
                } else {
                    Program.launch(m_helpLinkURL + "?errorCode=" + m_errorCode); //$NON-NLS-1$
                }
            }
        }
    });

    // after start set focus to OK button not to help link
    getShell().addFocusListener(new FocusAdapter() {

        private boolean m_passFocusToOk = true;

        @Override
        public void focusGained(FocusEvent e) {
            if (m_passFocusToOk) {
                getButton(IDialogConstants.OK_ID).setFocus();
                m_passFocusToOk = false;
            }
        }
    });

    return composite;
}

From source file:org.eclipse.buckminster.jnlp.p2.HelpLinkErrorDialog.java

License:Open Source License

@Override
protected Control createMessageArea(Composite composite) {

    // create image
    Image image = getImage();/*from  w ww . j a  v a2s .  co m*/
    if (image != null) {
        imageLabel = new Label(composite, SWT.NULL);
        image.setBackground(imageLabel.getBackground());
        imageLabel.setImage(image);
        imageLabel.setLayoutData(
                new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING));
    }

    Composite msgComposite = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = layout.marginWidth = 0;
    msgComposite.setLayout(layout);

    GridData data;

    // create message
    if (message != null) {
        Label msgLabel = new Label(msgComposite, getMessageLabelStyle());
        msgLabel.setText(message);
        data = new GridData(
                GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
        msgLabel.setLayoutData(data);
    }

    new Label(msgComposite, SWT.NONE);

    Link helpLink = new Link(msgComposite, SWT.NONE);
    helpLink.setText("<a>Report the problem</a>");
    helpLink.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            Program.launch(MaterializationUtils.createMailtoURL(m_errorEmailRecipient, m_errorEmailSubject,
                    MaterializationUtils.createStatusMessage(m_status)));
        }
    });

    // after start set focus to OK button not to help link
    getShell().addFocusListener(new FocusAdapter() {

        private boolean m_passFocusToOk = true;

        @Override
        public void focusGained(FocusEvent e) {
            if (m_passFocusToOk) {
                getButton(IDialogConstants.OK_ID).setFocus();
                m_passFocusToOk = false;
            }
        }
    });

    return composite;
}

From source file:org.eclipse.buildship.ui.notification.ExceptionDetailsDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite dialogArea = (Composite) super.createDialogArea(parent);
    dialogArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // dialog image
    ((GridLayout) dialogArea.getLayout()).numColumns = 2;
    Label imageLabel = new Label(dialogArea, 0);
    this.image.setBackground(imageLabel.getBackground());
    imageLabel.setImage(this.image);
    imageLabel// w  w  w  .  ja  v  a2 s  .c  o m
            .setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING));

    // composite to include all text widgets
    Composite textArea = new Composite(dialogArea, SWT.NONE);
    GridLayout textAreaLayout = new GridLayout(1, false);
    textAreaLayout.verticalSpacing = FontUtils.getFontHeightInPixels(parent.getFont());
    textAreaLayout.marginWidth = textAreaLayout.marginHeight = 0;
    textArea.setLayout(textAreaLayout);
    GridData textAreaLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
    textAreaLayoutData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    textArea.setLayoutData(textAreaLayoutData);

    Composite stackLayoutContainer = new Composite(textArea, SWT.NONE);
    this.stackLayout = new StackLayout();
    stackLayoutContainer.setLayout(this.stackLayout);
    stackLayoutContainer.setLayoutData(new GridData(GridData.FILL_BOTH));

    // single error container
    this.singleErrorContainer = new Composite(stackLayoutContainer, SWT.NONE);
    GridLayout singleErrorContainerLayout = new GridLayout(1, false);
    singleErrorContainerLayout.marginWidth = singleErrorContainerLayout.marginHeight = 0;
    this.singleErrorContainer.setLayout(singleErrorContainerLayout);
    this.stackLayout.topControl = this.singleErrorContainer;

    // single error label
    this.singleErrorMessageLabel = new Label(this.singleErrorContainer, SWT.WRAP);
    GridData messageLabelGridData = new GridData();
    messageLabelGridData.verticalAlignment = SWT.TOP;
    messageLabelGridData.grabExcessHorizontalSpace = true;
    this.singleErrorMessageLabel.setLayoutData(messageLabelGridData);
    this.singleErrorMessageLabel.setText(message);

    // single error details
    this.singleErrorDetailsLabel = new Label(this.singleErrorContainer, SWT.WRAP);
    GridData detailsLabelGridData = new GridData();
    detailsLabelGridData.verticalAlignment = SWT.TOP;
    detailsLabelGridData.grabExcessHorizontalSpace = true;
    this.singleErrorDetailsLabel.setLayoutData(detailsLabelGridData);
    this.singleErrorDetailsLabel.setText(details);

    // multi error container
    this.multiErrorContainer = new Composite(stackLayoutContainer, SWT.NONE);
    GridLayout multiErrorContainerLayout = new GridLayout(1, false);
    multiErrorContainerLayout.marginWidth = multiErrorContainerLayout.marginHeight = 0;
    this.multiErrorContainer.setLayout(multiErrorContainerLayout);

    // multi error label
    this.multiErrorMessageLabel = new Label(this.multiErrorContainer, SWT.WRAP);
    this.multiErrorMessageLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    this.multiErrorMessageLabel.setText(message);

    // multi error messages displayed in a list viewer
    GridData multiErrorExceptionListGridData = new GridData();
    multiErrorExceptionListGridData.horizontalAlignment = SWT.FILL;
    multiErrorExceptionListGridData.verticalAlignment = SWT.FILL;
    multiErrorExceptionListGridData.grabExcessHorizontalSpace = true;
    multiErrorExceptionListGridData.grabExcessVerticalSpace = true;
    multiErrorExceptionListGridData.widthHint = 800;
    this.exceptionsViewer = new TableViewer(this.multiErrorContainer, SWT.MULTI);
    this.exceptionsViewer.getControl().setLayoutData(multiErrorExceptionListGridData);
    this.exceptionsViewer.setContentProvider(new ArrayContentProvider());
    this.exceptionsViewer.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            if (element instanceof Throwable) {
                return ((Throwable) element).getMessage();
            } else {
                return "";
            }
        }
    });
    this.exceptionsViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            updateStacktraceArea();
        }
    });

    // set clipboard
    this.clipboard = new Clipboard(getShell().getDisplay());

    // update
    updateDisplayedExceptions();

    return dialogArea;
}

From source file:org.eclipse.buildship.ui.view.execution.FailureDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    GridData containerGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    containerGridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    container.setLayoutData(containerGridData);
    container.setLayout(new GridLayout(5, false));

    Label operationNameLabel = new Label(container, SWT.NONE);
    operationNameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
    operationNameLabel.setText(ExecutionViewMessages.Dialog_Failure_Operation_Label);

    this.operationNameText = new Label(container, SWT.NONE);
    GridData operationNameLayoutData = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    this.operationNameText.setLayoutData(operationNameLayoutData);

    this.backButton = new Button(container, SWT.FLAT | SWT.CENTER);
    this.backButton.setToolTipText(ExecutionViewMessages.Dialog_Failure_Back_Tooltip);
    this.backButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    this.backButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_BACK));

    this.nextButton = new Button(container, SWT.FLAT | SWT.CENTER);
    this.nextButton.setToolTipText(ExecutionViewMessages.Dialog_Failure_Next_Tooltip);
    this.nextButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    this.nextButton
            .setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_FORWARD));

    this.copyButton = new Button(container, SWT.FLAT | SWT.CENTER);
    this.copyButton.setToolTipText(ExecutionViewMessages.Dialog_Failure_Copy_Details_Tooltip);
    this.copyButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    this.copyButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_COPY));

    Label messageLabel = new Label(container, SWT.NONE);
    messageLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
    messageLabel.setText(ExecutionViewMessages.Dialog_Failure_Message_Label);

    this.messageText = new Text(container, SWT.BORDER);
    GridData messageTextLayoutData = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
    this.messageText.setLayoutData(messageTextLayoutData);
    this.messageText.setEditable(false);

    Label detailsLabel = new Label(container, SWT.NONE);
    detailsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
    detailsLabel.setText(ExecutionViewMessages.Dialog_Failure_Details_Label);

    this.detailsText = new Text(container, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    GridData detailsTextGridData = new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1);
    detailsTextGridData.heightHint = 200;
    this.detailsText.setLayoutData(detailsTextGridData);
    this.detailsText.setEditable(false);

    this.urlLabel = new Label(container, SWT.NONE);
    this.urlLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    this.urlLabel.setText(ExecutionViewMessages.Dialog_Failure_Link_Label);

    this.urlLink = new Link(container, SWT.NONE);
    this.urlLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1));

    this.clipboard = new Clipboard(parent.getDisplay());

    initSelectionIndex();//from www. jav a  2 s. co  m
    initEventListeners();
    update();

    return container;
}

From source file:org.eclipse.cdt.debug.internal.ui.propertypages.SignalPropertyPage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    noDefaultAndApplyButton();/*w  ww. ja v a  2s  .c o m*/
    Composite composite = new Composite(parent, SWT.NONE);
    Font font = parent.getFont();
    composite.setFont(font);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Create description field
    try {
        String description = getSignal().getDescription();
        Label label = new Label(composite, SWT.WRAP);
        label.setText(MessageFormat.format(PropertyPageMessages.getString("SignalPropertyPage.0"), //$NON-NLS-1$
                new String[] { description }));
        GridData data = new GridData(
                GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
        label.setLayoutData(data);
        label.setFont(font);
    } catch (DebugException e1) {
    }

    // Create pass button
    try {
        boolean pass = getSignal().isPassEnabled();
        fPassButton = new SelectionButtonDialogField(SWT.CHECK);
        fPassButton.setLabelText(PropertyPageMessages.getString("SignalPropertyPage.1")); //$NON-NLS-1$
        fPassButton.setSelection(pass);
        fPassButton.setEnabled(getSignal().canModify());
        fPassButton.doFillIntoGrid(composite, 1);
    } catch (DebugException e) {
    }

    // Create stop button
    try {
        boolean stop = getSignal().isStopEnabled();
        fStopButton = new SelectionButtonDialogField(SWT.CHECK);
        fStopButton.setLabelText(PropertyPageMessages.getString("SignalPropertyPage.2")); //$NON-NLS-1$
        fStopButton.setSelection(stop);
        fStopButton.setEnabled(getSignal().canModify());
        fStopButton.doFillIntoGrid(composite, 1);
    } catch (DebugException e) {
    }

    setValid(true);
    return composite;
}

From source file:org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.detailsupport.DetailPaneMaxLengthDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    Label label = new Label(composite, SWT.WRAP);
    label.setText(MessagesForDetailPane.PaneMaxLengthDialog_MaxCharactersToDisplay);
    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
            | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
    data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(data);/*from www . j  a va 2  s.  c o m*/
    label.setFont(parent.getFont());
    fTextWidget = new Text(composite, SWT.SINGLE | SWT.BORDER);
    fTextWidget.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    fTextWidget.setText(fValue);
    fTextWidget.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent e) {
            validateInput();
            fValue = fTextWidget.getText();
        }
    });
    fErrorTextWidget = new Text(composite, SWT.READ_ONLY);
    fErrorTextWidget.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    fErrorTextWidget.setBackground(fErrorTextWidget.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    setErrorMessage(fErrorMessage);
    applyDialogFont(composite);
    return composite;
}

From source file:org.eclipse.cdt.internal.autotools.ui.actions.SingleInputDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {

    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);

    CLabel label0 = new CLabel(composite, SWT.WRAP);
    label0.setText(firstMessage);//from   w w w .j a  v a  2  s  . c om
    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
            | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
    data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label0.setLayoutData(data);
    label0.setFont(parent.getFont());

    // remove error message dialog from focusing.
    composite.getTabList()[2].setVisible(false);
    composite.getTabList()[2].setEnabled(false);

    return composite;
}

From source file:org.eclipse.cdt.internal.autotools.ui.actions.TwoInputDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {

    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);

    CLabel label0 = new CLabel(composite, SWT.WRAP);
    label0.setText(firstMessage);//  w  ww.java2s  .  c  o m
    Label label = new Label(composite, SWT.WRAP);
    label.setText(secondMessage);
    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
            | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
    data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label0.setLayoutData(data);
    label0.setFont(parent.getFont());
    label.setLayoutData(data);
    label.setFont(parent.getFont());

    secondText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    secondText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    secondText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            validateInput();
        }
    });

    // remove error message dialog from focusing.
    composite.getTabList()[2].setVisible(false);
    composite.getTabList()[2].setEnabled(false);

    return composite;
}

From source file:org.eclipse.cdt.launch.remote.RemoteUIHelper.java

License:Open Source License

/**
 * Open dialog for user to create a new connection.
 *
 * @param shell - the shell//from  w  ww  .  ja va  2s.  c o  m
 */
public static void newConnectionDialog(Shell shell) {
    /*
     * Evoke native new connection wizard and save connection
     *    if created by the user.
     */
    class NewRemoteConnectionDialog extends Dialog {
        private String title;
        private Combo fConnSelection;
        private IRemoteServicesManager manager;

        protected NewRemoteConnectionDialog(Shell parentShell, String windowTitle) {
            super(parentShell);
            title = windowTitle;
            manager = Activator.getService(IRemoteServicesManager.class);
        }

        @Override
        protected void configureShell(Shell newShell) {
            super.configureShell(newShell);
            newShell.setText(title);
        }

        @Override
        protected Control createDialogArea(Composite parent) {
            Composite composite = (Composite) super.createDialogArea(parent);

            Label label = new Label(composite, SWT.WRAP);
            label.setText(Messages.RemoteCMainTab_New_conntype_combo_label);
            GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
                    | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
            data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
            label.setLayoutData(data);
            label.setFont(parent.getFont());
            fConnSelection = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
            ArrayList<String> suitableConnections = new ArrayList<>();
            for (IRemoteConnectionType type : manager.getAllConnectionTypes()) {
                if (type.canAdd()
                        && type.getConnectionServices().contains(IRemoteCommandShellService.class.getName())) {
                    fConnSelection.setData(type.getName(), type.getId());
                    suitableConnections.add(type.getName());
                }
            }
            fConnSelection.setItems(suitableConnections.toArray(new String[0]));
            fConnSelection.select(0);

            applyDialogFont(composite);
            return composite;
        }

        @Override
        protected void buttonPressed(int buttonId) {
            if (buttonId == IDialogConstants.OK_ID) {
                String connTypeId = (String) fConnSelection.getData(fConnSelection.getText());
                IRemoteConnectionType connType = manager.getConnectionType(connTypeId);
                IRemoteUIConnectionService fUIConnectionManager = connType
                        .getService(IRemoteUIConnectionService.class);
                IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(this.getShell());

                IRemoteConnectionWorkingCopy wc = wizard.open();
                if (wc != null) {
                    try {
                        wc.save();
                    } catch (RemoteConnectionException e) {
                        logError(e);
                    }
                }
            }
            super.buttonPressed(buttonId);
        }
    }

    NewRemoteConnectionDialog dlg = new NewRemoteConnectionDialog(shell, Messages.RemoteCMainTab_New_title);
    dlg.setBlockOnOpen(true);
    dlg.open();
}