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

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

Introduction

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

Prototype

int VERTICAL_MARGIN

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

Click Source Link

Document

Vertical margin in dialog units (value 7).

Usage

From source file:org.eclipse.papyrus.properties.tabbed.customization.dialog.CustomizeContentWizardPage.java

License:Open Source License

/**
 * {@inheritDoc}//from   w  w w. j  a v  a2  s . co m
 */
public void createControl(Composite parent) {
    Composite composite = new Composite(parent, 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);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    SashForm sashForm = new SashForm(composite, SWT.HORIZONTAL);
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    createContentExplorer(sashForm);
    createConfigurationArea(sashForm);

    sashForm.setWeights(new int[] { 40, 60 });

    setControl(composite);
}

From source file:org.eclipse.pde.internal.ua.ui.wizards.cheatsheet.NewCategoryNameDialog.java

License:Open Source License

/**
 * @param parent//from www .j ava  2 s .  co m
 * @return
 */
private Composite createUIContainer(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    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);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    return composite;
}

From source file:org.eclipse.php.formatter.ui.preferences.CreateProfileDialog.java

License:Open Source License

public Control createDialogArea(Composite parent) {

    final int numColumns = 2;

    GridData gd;/*from  w  w  w. ja va  2  s  .c o m*/

    final GridLayout layout = new GridLayout(numColumns, false);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);

    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(layout);

    // Create "Profile name:" label
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = numColumns;
    gd.widthHint = convertWidthInCharsToPixels(60);
    final Label nameLabel = new Label(composite, SWT.WRAP);
    nameLabel.setText(FormatterMessages.CreateProfileDialog_profile_name_label_text);
    nameLabel.setLayoutData(gd);

    // Create text field to enter name
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = numColumns;
    fNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    fNameText.setLayoutData(gd);
    fNameText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            doValidation();
        }
    });

    // Create "Initialize settings ..." label
    gd = new GridData();
    gd.horizontalSpan = numColumns;
    Label profileLabel = new Label(composite, SWT.WRAP);
    profileLabel.setText(FormatterMessages.CreateProfileDialog_base_profile_label_text);
    profileLabel.setLayoutData(gd);

    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = numColumns;
    fProfileCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
    fProfileCombo.setLayoutData(gd);

    // "Open the edit dialog now" checkbox
    gd = new GridData();
    gd.horizontalSpan = numColumns;
    fEditCheckbox = new Button(composite, SWT.CHECK);
    fEditCheckbox.setText(FormatterMessages.CreateProfileDialog_open_edit_dialog_checkbox_text);
    fEditCheckbox.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            fOpenEditDialog = ((Button) e.widget).getSelection();
        }

        public void widgetDefaultSelected(SelectionEvent e) {
        }
    });

    final IDialogSettings dialogSettings = FormatterUIPlugin.getDefault().getDialogSettings();// .get(PREF_OPEN_EDIT_DIALOG);
    if (dialogSettings.get(PREF_OPEN_EDIT_DIALOG) != null) {
        fOpenEditDialog = dialogSettings.getBoolean(PREF_OPEN_EDIT_DIALOG);
    } else {
        fOpenEditDialog = true;
    }
    fEditCheckbox.setSelection(fOpenEditDialog);

    fProfileCombo.setItems(fSortedNames);
    fProfileCombo.setText(fProfileManager.getProfile(ProfileManager.DEFAULT_PROFILE).getName());
    updateStatus(fEmpty);

    applyDialogFont(composite);

    fNameText.setFocus();

    return composite;
}

From source file:org.eclipse.php.formatter.ui.preferences.RenameProfileDialog.java

License:Open Source License

public Control createDialogArea(Composite parent) {

    final int numColumns = 2;

    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 = numColumns;/*from w  w  w  . ja  v  a 2 s.  c  o m*/

    final Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(layout);

    // Create "Please enter a new name:" label
    GridData gd = new GridData();
    gd.horizontalSpan = numColumns;
    gd.widthHint = convertWidthInCharsToPixels(60);
    fNameLabel = new Label(composite, SWT.NONE);
    fNameLabel.setText(FormatterMessages.RenameProfileDialog_dialog_label_enter_a_new_name);
    fNameLabel.setLayoutData(gd);

    // Create text field to enter name
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = numColumns;
    fNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    fNameText.setSelection(0, fProfile.getName().length());
    fNameText.setLayoutData(gd);
    fNameText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            doValidation();
        }
    });
    fNameText.setText(fProfile.getName());
    fNameText.selectAll();

    applyDialogFont(composite);

    return composite;
}

From source file:org.eclipse.php.internal.debug.ui.pathmapper.PathMapperEntryDialog.java

License:Open Source License

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

    Composite mainComp = new Composite(parent, SWT.None);
    mainComp.setLayout(new GridLayout());
    mainComp.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Remote path text field:
    Label label = new Label(mainComp, SWT.NONE);
    label.setText(Messages.PathMapperEntryDialog_2);

    fRemotePathText = new Text(mainComp, SWT.BORDER);
    fRemotePathText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            ignorePathText.setText(fRemotePathText.getText());
            validate();/*from ww  w . java2s . co m*/
        }
    });
    GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
    fRemotePathText.setLayoutData(layoutData);

    // Radio buttons group:
    Composite typeSelectionGroup = new Composite(mainComp, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.marginTop = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    typeSelectionGroup.setLayout(layout);
    typeSelectionGroup.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label divider = new Label(typeSelectionGroup, SWT.HORIZONTAL | SWT.SEPARATOR);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    divider.setLayoutData(layoutData);

    // Workspace file:
    fWorkspacePathBtn = new Button(typeSelectionGroup, SWT.RADIO);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    fWorkspacePathBtn.setLayoutData(layoutData);
    fWorkspacePathBtn.setText(Messages.PathMapperEntryDialog_3);
    fWorkspacePathBtn.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            boolean enabled = fWorkspacePathBtn.getSelection();
            fWorkspacePathText.setEnabled(enabled);
            fWorkspacePathBrowseBtn.setEnabled(enabled);
            fExternalPathText.setEnabled(!enabled);
            fExternalPathBrowseBtn.setEnabled(!enabled);
            ignorePathText.setEnabled(!enabled);
            validate();
        }
    });

    fWorkspacePathText = new Text(typeSelectionGroup, SWT.BORDER);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    fWorkspacePathText.setLayoutData(layoutData);
    fWorkspacePathText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            fWorkspacePathText.setData(Type.WORKSPACE);
            validate();
        }
    });

    fWorkspacePathBrowseBtn = new Button(typeSelectionGroup, SWT.NONE);
    setButtonLayoutData(fWorkspacePathBrowseBtn);
    fWorkspacePathBrowseBtn.setText(Messages.PathMapperEntryDialog_4);
    fWorkspacePathBrowseBtn.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            WorkspaceBrowseDialog dialog = new WorkspaceBrowseDialog(getShell());
            if (dialog.open() == Window.OK) {
                Object selectedElement = dialog.getSelectedElement();
                fWorkspacePathText.setData(null);
                if (selectedElement instanceof IResource) {
                    IResource resource = (IResource) selectedElement;
                    fWorkspacePathText.setData(Type.WORKSPACE);
                    fWorkspacePathText.setText(resource.getFullPath().toString());
                } else if (selectedElement instanceof IBuildpathEntry) {
                    IBuildpathEntry includePathEntry = (IBuildpathEntry) selectedElement;
                    fWorkspacePathText.setData(
                            includePathEntry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE ? Type.INCLUDE_VAR
                                    : Type.INCLUDE_FOLDER);
                    if (includePathEntry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) {
                        IPath incPath = DLTKCore.getResolvedVariablePath(includePathEntry.getPath());
                        if (incPath != null) {
                            fWorkspacePathText.setText(incPath.toOSString());
                        }
                    } else {
                        fWorkspacePathText.setText(
                                EnvironmentPathUtils.getLocalPath(includePathEntry.getPath()).toOSString());
                    }
                } else if (selectedElement instanceof IPFile) {
                    IPFile ipFile = (IPFile) selectedElement;
                    IBuildpathEntry includePathEntry = ipFile.includePathEntry;
                    fWorkspacePathText.setData(
                            includePathEntry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE ? Type.INCLUDE_VAR
                                    : Type.INCLUDE_FOLDER);
                    fWorkspacePathText.setText(ipFile.file.getAbsolutePath());
                }
            }
        }
    });

    // External file:
    fExternalPathBtn = new Button(typeSelectionGroup, SWT.RADIO);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    fExternalPathBtn.setLayoutData(layoutData);
    fExternalPathBtn.setText(Messages.PathMapperEntryDialog_5);
    fExternalPathBtn.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            boolean enabled = fExternalPathBtn.getSelection();
            fExternalPathText.setEnabled(enabled);
            fExternalPathBrowseBtn.setEnabled(enabled);
            fWorkspacePathText.setEnabled(!enabled);
            fWorkspacePathBrowseBtn.setEnabled(!enabled);
            ignorePathText.setEnabled(!enabled);
            validate();
        }
    });

    fExternalPathText = new Text(typeSelectionGroup, SWT.BORDER);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    fExternalPathText.setLayoutData(layoutData);
    fExternalPathText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            validate();
        }
    });

    fExternalPathBrowseBtn = new Button(typeSelectionGroup, SWT.NONE);
    setButtonLayoutData(fExternalPathBrowseBtn);
    fExternalPathBrowseBtn.setText(Messages.PathMapperEntryDialog_4);
    fExternalPathBrowseBtn.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            DirectoryDialog dialog = new DirectoryDialog(getShell());
            dialog.setMessage("Select local folder");
            String path = dialog.open();
            if (path != null) {
                fExternalPathText.setText(path);
            }
        }
    });

    ignoreMappingBtn = new Button(typeSelectionGroup, SWT.RADIO);
    ignoreMappingBtn.setText(Messages.PathMapperEntryDialog_18);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    ignoreMappingBtn.setLayoutData(layoutData);
    ignoreMappingBtn.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            boolean enabled = ignoreMappingBtn.getSelection();
            fWorkspacePathText.setEnabled(!enabled);
            fWorkspacePathBrowseBtn.setEnabled(!enabled);
            fExternalPathText.setEnabled(!enabled);
            fExternalPathBrowseBtn.setEnabled(!enabled);
            ignorePathText.setEnabled(enabled);
            validate();
        }
    });

    ignorePathText = new Text(typeSelectionGroup, SWT.BORDER | SWT.READ_ONLY);
    ignorePathText.setEnabled(false);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    ignorePathText.setLayoutData(layoutData);
    ignorePathText.setText(""); //$NON-NLS-1$

    applyDialogFont(mainComp);
    initializeValues();
    return parent;
}

From source file:org.eclipse.php.internal.ui.dialogs.saveFiles.SaveAsDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    // top level composite
    Composite parentComposite = (Composite) super.createDialogArea(parent);

    // create a composite with standard margins and spacing
    Composite composite = new Composite(parentComposite, 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);//from www . j a  v a2s.co  m
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parentComposite.getFont());

    Listener listener = new Listener() {
        public void handleEvent(Event event) {
            setDialogComplete(validatePage());
        }
    };

    resourceGroup = new ResourceAndContainerGroup(composite, listener, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
    resourceGroup.setAllowExistingResources(true);

    return parentComposite;
}

From source file:org.eclipse.php.internal.ui.preferences.EditTemplateDialog.java

License:Open Source License

protected Control createDialogArea(Composite ancestor) {
    Composite parent = new Composite(ancestor, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/*www .  j av a 2 s  .c  o  m*/
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);

    parent.setLayout(layout);
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));

    ModifyListener listener = new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            doTextWidgetChanged(e.widget);
        }
    };

    if (fIsNameModifiable) {
        createLabel(parent, PreferencesMessages.EditTemplateDialog_name);

        Composite composite = new Composite(parent, SWT.NONE);
        composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        layout = new GridLayout();
        layout.numColumns = 4;
        layout.marginWidth = 0;
        layout.marginHeight = 0;
        composite.setLayout(layout);

        fNameText = createText(composite);
        fNameText.addFocusListener(new FocusListener() {

            public void focusGained(FocusEvent e) {
            }

            public void focusLost(FocusEvent e) {
                if (fSuppressError) {
                    fSuppressError = false;
                    updateStatusAndButtons();
                }
            }
        });

        createLabel(composite, PreferencesMessages.EditTemplateDialog_context);
        fContextCombo = new Combo(composite, SWT.READ_ONLY);

        for (int i = 0; i < fContextTypes.length; i++) {
            fContextCombo.add(fContextTypes[i][1]);
        }

        fContextCombo.addModifyListener(listener);

        fAutoInsertCheckbox = createCheckbox(composite, PreferencesMessages.EditTemplateDialog_autoinsert);
        fAutoInsertCheckbox.setSelection(fTemplate.isAutoInsertable());
    }

    createLabel(parent, PreferencesMessages.EditTemplateDialog_description);

    int descFlags = fIsNameModifiable ? SWT.BORDER : SWT.BORDER | SWT.READ_ONLY;
    fDescriptionText = new Text(parent, descFlags);
    fDescriptionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    fDescriptionText.addModifyListener(listener);

    Label patternLabel = createLabel(parent, PreferencesMessages.EditTemplateDialog_pattern);
    patternLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    fPatternEditor = createEditor(parent);

    Label filler = new Label(parent, SWT.NONE);
    filler.setLayoutData(new GridData());

    Composite composite = new Composite(parent, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData());

    fInsertVariableButton = new Button(composite, SWT.NONE);
    fInsertVariableButton.setLayoutData(getButtonGridData());
    fInsertVariableButton.setText(PreferencesMessages.EditTemplateDialog_insert_variable);
    fInsertVariableButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            fPatternEditor.getTextWidget().setFocus();
            fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
        }

        public void widgetDefaultSelected(SelectionEvent e) {
        }
    });

    fDescriptionText.setText(fTemplate.getDescription());
    if (fIsNameModifiable) {
        fNameText.setText(fTemplate.getName());
        fNameText.addModifyListener(listener);
        fContextCombo.select(getIndex(fTemplate.getContextTypeId()));
    } else {
        fPatternEditor.getControl().setFocus();
    }
    initializeActions();

    applyDialogFont(parent);
    return composite;
}

From source file:org.eclipse.php.internal.ui.preferences.PHPBasePreferencePage.java

License:Open Source License

protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);// w  ww  .java 2  s.c o m

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    result.setLayout(layout);

    Group doubleClickGroup = new Group(result, SWT.NONE);
    doubleClickGroup.setLayout(new GridLayout());
    doubleClickGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    doubleClickGroup.setText(PHPUIMessages.PHPBasePreferencePage_doubleclick_action);
    addRadioButton(doubleClickGroup, PHPUIMessages.PHPBasePreferencePage_doubleclick_gointo, DOUBLE_CLICK,
            DOUBLE_CLICK_GOES_INTO);
    addRadioButton(doubleClickGroup, PHPUIMessages.PHPBasePreferencePage_doubleclick_expand, DOUBLE_CLICK,
            DOUBLE_CLICK_EXPANDS);
    Dialog.applyDialogFont(result);
    return result;
}

From source file:org.eclipse.php.internal.ui.preferences.PHPProjectLayoutPreferencePage.java

License:Open Source License

protected Control createPreferenceContent(Composite parent) {
    initializeDialogUnits(parent);/*from  w  w  w .  j  av a  2  s . c o m*/

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.numColumns = 2;
    result.setLayout(layout);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;

    Group sourceFolderGroup = new Group(result, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    sourceFolderGroup.setLayout(layout);
    sourceFolderGroup.setLayoutData(gd);
    sourceFolderGroup.setText(PreferencesMessages.NewPHPProjectPreferencePage_sourcefolder_label);

    int indent = 0;

    fProjectAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewPHPProjectPreferencePage_sourcefolder_project, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.FALSE, indent);
    fProjectAsSourceFolder.addSelectionListener(fSelectionListener);

    fFoldersAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewPHPProjectPreferencePage_sourcefolder_folder, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.TRUE, indent);
    fFoldersAsSourceFolder.addSelectionListener(fSelectionListener);

    indent = convertWidthInCharsToPixels(4);

    fSrcFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fSrcFolderNameLabel.setText(PreferencesMessages.NewPHPProjectPreferencePage_folders_src);
    fSrcFolderNameText = addTextControl(sourceFolderGroup, fSrcFolderNameLabel, SRCBIN_SRCNAME, indent);
    fSrcFolderNameText.addModifyListener(fModifyListener);

    fBinFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fBinFolderNameLabel.setText(PreferencesMessages.NewPHPProjectPreferencePage_folders_public);
    fBinFolderNameText = addTextControl(sourceFolderGroup, fBinFolderNameLabel, SRCBIN_BINNAME, indent);
    fBinFolderNameText.addModifyListener(fModifyListener);

    validateFolders();

    return result;
}

From source file:org.eclipse.php.internal.ui.wizards.PHPProjectWizardFirstPage.java

License:Open Source License

/**
 * Initialize a grid layout with the default Dialog settings.
 *///from w ww. j  a  v  a2  s  .  com
public GridLayout initGridLayout(GridLayout layout, boolean margins) {
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    if (margins) {
        layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
        layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    } else {
        layout.marginWidth = 0;
        layout.marginHeight = 0;
    }
    return layout;
}