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.birt.report.designer.internal.ui.dialogs.TableOptionBindingDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    loadPreference();//from w  w w .ja v a 2  s  . c om

    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));
    applyDialogFont(composite);

    new Label(composite, SWT.NONE).setText(MSG_DATA_SET);

    dataSetCombo = new Combo(composite, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    dataSetCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    dataSetCombo.setVisibleItemCount(30);
    String[] dataSets = ChoiceSetFactory.getDataSets();
    String[] newList = new String[dataSets.length + 1];
    System.arraycopy(dataSets, 0, newList, 1, dataSets.length);
    newList[0] = NONE;
    dataSetCombo.setItems(newList);
    dataSetCombo.select(0);

    autoChk = new Button(composite, SWT.CHECK);
    autoChk.setText(Messages.getString("TableOptionDialog.text.AutoSummary")); //$NON-NLS-1$
    GridData gdata = new GridData(GridData.FILL_HORIZONTAL);
    gdata.horizontalSpan = 2;
    gdata.verticalIndent = 10;
    gdata.horizontalIndent = 10;
    autoChk.setLayoutData(gdata);
    autoChk.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (dataSetCombo.getSelectionIndex() == 0) {
                rowEditor.setEnabled(!autoChk.getSelection());
            }
        }
    });

    final Composite contentPane = new Composite(composite, SWT.NONE);
    gdata = new GridData(GridData.FILL_BOTH);
    gdata.horizontalSpan = 2;
    gdata.minimumWidth = 400;
    gdata.minimumHeight = 250;
    contentPane.setLayoutData(gdata);
    contentPane.setLayout(new GridLayout());

    createStaticUI(contentPane);

    dataSetCombo.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (dataSetCombo.getSelectionIndex() > 0) {
                createBindingUI(contentPane);
            } else {
                createStaticUI(contentPane);
            }

            contentPane.layout();
        };
    });

    UIUtil.bindHelp(parent, IHelpContextIds.TABLE_OPTION_DIALOG_ID);

    return composite;
}

From source file:org.eclipse.birt.report.designer.ui.dialogs.CascadingParametersDialog.java

License:Open Source License

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

    ScrolledComposite sc = new ScrolledComposite((Composite) super.createDialogArea(parent),
            SWT.H_SCROLL | SWT.V_SCROLL);
    sc.setLayout(new FillLayout());
    sc.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(sc);//from w ww  .j  ava2 s. c o  m

    mainContent = new Composite(sc, 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);
    mainContent.setLayout(layout);

    UIUtil.bindHelp(parent, IHelpContextIds.CASCADING_PARAMETER_DIALOG_ID);

    GridData data = new GridData(GridData.FILL_BOTH);

    maxStrLengthProperty = getMaxStrLength(PROPERTY_LABEL_STRING, mainContent);

    maxStrLengthOption = getMaxStrLength(OPTION_LABEL_STRING, mainContent);

    mainContent.setLayoutData(data);

    createGeneralPart(mainContent);

    createChoicePart(mainContent);

    createDynamicParamsPart(mainContent);

    createPropertiesPart(mainContent);

    createSortingArea(mainContent);

    createOptionsPart(mainContent);

    createLabel(mainContent, null);
    errorMessageLine = new CLabel(mainContent, SWT.NONE);
    GridData msgLineGridData = new GridData(GridData.FILL_HORIZONTAL);
    msgLineGridData.horizontalSpan = 2;
    errorMessageLine.setLayoutData(msgLineGridData);

    sc.setContent(mainContent);
    sc.setExpandHorizontal(true);
    // sc.setExpandVertical( true );
    sc.setMinWidth(500);
    // sc.setMinHeight( 570 );

    Point size = mainContent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    mainContent.setSize(size);

    return sc;
}

From source file:org.eclipse.birt.report.designer.ui.dialogs.GroupDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    // Assert.isNotNull( dataSetList );

    if (sytleChoicesAll == null) {
        sytleChoicesAll = getAllStyleChoices();
    }/*from   ww w .j a v a  2s.com*/

    // Composite topComposite = (Composite) super.createDialogArea( parent
    // );

    ScrolledComposite scrollContent = new ScrolledComposite((Composite) super.createDialogArea(parent),
            SWT.H_SCROLL | SWT.V_SCROLL);
    scrollContent.setAlwaysShowScrollBars(false);
    scrollContent.setExpandHorizontal(true);
    scrollContent.setMinWidth(600);
    scrollContent.setLayout(new FillLayout());
    scrollContent.setLayoutData(new GridData(GridData.FILL_BOTH));

    applyDialogFont(scrollContent);

    Composite topComposite = new Composite(scrollContent, 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);
    topComposite.setLayout(layout);

    createTitleArea(topComposite);

    Composite composite = new Composite(topComposite, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    composite.setLayout(new GridLayout(2, true));
    createFieldArea(composite);
    createGroupArea(composite);
    createBookmarkArea(topComposite);
    createTOCArea(topComposite);
    createFilterSortingArea(topComposite);
    UIUtil.bindHelp(parent, IHelpContextIds.GROUP_DIALOG_ID);

    Point size = topComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    topComposite.setSize(size.x, size.y);

    scrollContent.setContent(topComposite);

    return scrollContent;
}

From source file:org.eclipse.birt.report.designer.ui.dialogs.InputParameterDialog.java

License:Open Source License

protected Control createDialogArea(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);//  ww w .ja va  2 s  .  com
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);

    new Label(composite, SWT.NONE).setText(Messages.getString("InputParameterDialog.msg.requiredParam")); //$NON-NLS-1$

    scrollPane = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);
    scrollPane.setExpandHorizontal(true);
    scrollPane.setExpandVertical(true);

    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = 400;
    gd.heightHint = 400;
    scrollPane.setLayoutData(gd);

    createParameters();

    UIUtil.bindHelp(parent, IHelpContextIds.INPUT_PARAMETERS_DIALOG_ID);

    return composite;
}

From source file:org.eclipse.birt.report.designer.ui.ide.wizards.WizardSaveAsPage.java

License:Open Source License

public void createControl(Composite parent) {

    // create a composite with standard margins and spacing
    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);/* w  w w.  j  a v  a  2 s.  c  om*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parent.getFont());

    Listener listener = new Listener() {

        public void handleEvent(Event event) {
            validatePage();
            try {
                getContainer().updateButtons();
            } catch (Throwable e) {
                // ignore
            }
        }
    };

    resourceGroup = new ResourceAndContainerGroup(composite, listener,
            Messages.getString("WizardSaveAsPage.FileLabel"), //$NON-NLS-1$
            "file", //$NON-NLS-1$
            false, 200);
    resourceGroup.setAllowExistingResources(true);

    setControl(composite);

    initializeControls();

    UIUtil.bindHelp(getControl(), IHelpContextIds.SAVE_AS_WIZARD_ID);
}

From source file:org.eclipse.birt.report.extension.barcode.BarCodeBuilder.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(3, 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);/*from w w  w . j a  va  2s  .c o  m*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    createTextArea(composite);

    Label lb = new Label(composite, SWT.None);
    lb.setText("Barcode Type:"); //$NON-NLS-1$

    barCodeType = new ComboViewer(composite, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);
    //      barCodeType.add("");
    //      for (String bcType : BAR_CODE_TYPES) {
    //         barCodeType.add(bcType);
    //      }
    barCodeType.setContentProvider(ArrayContentProvider.getInstance());
    barCodeType.setLabelProvider(new LabelProvider() {
        @Override
        public String getText(Object element) {
            return ((BarCodeGenerator) element).getLabel();
        }
    });
    barCodeType.setInput(BarCodeGenerator.values());
    GridData gd = new GridData();
    gd.widthHint = 100;
    barCodeType.getControl().setLayoutData(gd);

    applyDialogFont(composite);

    try {
        initValues();
    } catch (SemanticException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return composite;
}

From source file:org.eclipse.birt.sample.reportitem.rotatedtext.RotatedTextBuilder.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(3, 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);// w  w  w . j a va2s .c om
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    createTextArea(composite);

    Label lb = new Label(composite, SWT.None);
    lb.setText("Rotation Angle:"); //$NON-NLS-1$

    sclAngle = new Scale(composite, SWT.None);
    sclAngle.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    sclAngle.setMinimum(0);
    sclAngle.setMaximum(360);
    sclAngle.setIncrement(10);

    lbAngle = new Label(composite, SWT.None);
    GridData gd = new GridData();
    gd.widthHint = 20;
    lbAngle.setLayoutData(gd);

    sclAngle.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
            lbAngle.setText(String.valueOf(sclAngle.getSelection()));
        }

        public void widgetSelected(SelectionEvent e) {
            lbAngle.setText(String.valueOf(sclAngle.getSelection()));
        }
    });

    applyDialogFont(composite);

    initValues();

    return composite;
}

From source file:org.eclipse.cdt.core.testplugin.util.VerifyDialog.java

License:Open Source License

@Override
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);
    composite.setSize(SIZING_WIDTH, SWT.DEFAULT);
    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   w  w w.java 2 s  .c o m*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    createTestSelectionGroup(composite);
    createCheckListGroup(composite);

    _queryLabel = new Label(composite, SWT.NONE);
    _queryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    initializeTest();
    return composite;
}

From source file:org.eclipse.cdt.cpp.ui.internal.dialogs.CustomMessageDialog.java

License:Open Source License

protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);

    // create a layout with spacing and margins appropriate for the font size.
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/*from w ww .ja  v a2 s  .c  o m*/
    composite.setLayout(layout);

    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    composite.setLayoutData(data);

    composite.setFont(parent.getFont());
    // create composite for the don't show button
    Composite leftPane = new Composite(composite, SWT.NONE);

    // create a layout with spacing and margins appropriate for the font size.
    GridLayout leftPaneLayout = new GridLayout();
    leftPaneLayout.numColumns = 1;
    leftPaneLayout.makeColumnsEqualWidth = true;
    leftPaneLayout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    leftPaneLayout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    leftPaneLayout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    leftPaneLayout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);

    leftPane.setLayout(leftPaneLayout);

    GridData leftPaneData = new GridData(
            GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_CENTER);
    leftPane.setLayoutData(leftPaneData);

    // Add a check box if needed
    if (extraButtonLabels != null)
        createExtraButtonsForButtonBar(leftPane);
    // create composite to hold the butons
    Composite rightPane = new Composite(composite, SWT.NONE);

    // create a layout with spacing and margins appropriate for the font size.
    GridLayout rightPaneLayout = new GridLayout();
    rightPaneLayout.numColumns = 0; // this is incremented by createButton
    rightPaneLayout.makeColumnsEqualWidth = true;
    rightPaneLayout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    rightPaneLayout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    rightPaneLayout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    rightPaneLayout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);

    rightPane.setLayout(rightPaneLayout);

    GridData rightPanedata = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    rightPane.setLayoutData(rightPanedata);
    // Add the buttons to the button bar.
    createButtonsForButtonBar(rightPane);
    return composite;
}

From source file:org.eclipse.cdt.debug.internal.ui.actions.RegisterGroupDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    getShell().setText(ActionMessages.getString("RegisterGroupDialog.5")); //$NON-NLS-1$
    setTitle(ActionMessages.getString("RegisterGroupDialog.6")); //$NON-NLS-1$
    //   setTitleImage( CDebugImages.get( CDebugImages.IMG_WIZBAN_REGISTER_GROUP ) );
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getShell(), ICDebugHelpContextIds.REGISTER_GROUP);
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = Math.max(fNameField.getNumberOfControls(), fListField.getNumberOfControls());
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    composite.setLayout(layout);//www .  ja  va  2s  .  co m
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    Dialog.applyDialogFont(composite);
    PixelConverter converter = new PixelConverter(composite);
    new Separator().doFillIntoGrid(composite, layout.numColumns, converter.convertHeightInCharsToPixels(1));
    fNameField.doFillIntoGrid(composite, layout.numColumns);
    fNameField.getTextControl(null).selectAll();
    new Separator().doFillIntoGrid(composite, layout.numColumns, converter.convertHeightInCharsToPixels(1));
    fListField.doFillIntoGrid(composite, layout.numColumns + 1);
    LayoutUtil.setHorizontalSpan(fListField.getLabelControl(null), layout.numColumns);
    LayoutUtil.setHeigthHint(fListField.getListControl(null), convertWidthInCharsToPixels(30));
    LayoutUtil.setHorizontalGrabbing(fListField.getListControl(null));
    setMessage(null);
    return composite;
}