List of usage examples for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING
int HORIZONTAL_SPACING
To view the source code for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING.
Click Source Link
From source file:org.eclipse.ant.internal.ui.datatransfer.AntNewJavaProjectPage.java
License:Open Source License
@Override public void createControl(Composite parent) { initializeDialogUnits(parent);//from ww w .j a va 2s. co m Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = IDialogConstants.VERTICAL_MARGIN; layout.marginWidth = IDialogConstants.HORIZONTAL_MARGIN; layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.numColumns = 3; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parent.getFont()); createProjectNameGroup(composite); createProjectLocationGroup(composite); createTargetsTable(composite); fLinkButton = new Button(composite, SWT.CHECK); fLinkButton.setText(DataTransferMessages.AntNewJavaProjectPage_24); fLinkButton.setFont(parent.getFont()); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = false; gd.horizontalSpan = 2; fLinkButton.setLayoutData(gd); validatePage(); // Show description on opening setErrorMessage(null); setMessage(null); setControl(composite); }
From source file:org.eclipse.b3.aggregator.presentation.FindIUDialog.java
License:Open Source License
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 0; // create 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 ww . j a v a 2 s . co m composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label filler = new Label(composite, SWT.NONE); filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); layout.numColumns++; findButton = createButton(composite, FIND_ID, getString("_UI_FindIUDialog_findButton"), true); findButton.setEnabled(isFindEnabled()); createButton(composite, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); return composite; }
From source file:org.eclipse.b3.aggregator.presentation.VersionRangeEditorDialog.java
License:Open Source License
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 0; // create 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 ww w . jav a2s . com*/ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label filler = new Label(composite, SWT.NONE); filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); layout.numColumns++; okButton = createButton(composite, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); okButton.setEnabled(isOKEnabled()); createButton(composite, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); return composite; }
From source file:org.eclipse.birt.report.data.oda.jdbc.ui.util.ExceptionDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { createMessageArea(parent);// w ww . ja v a2s . c om // 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); layout.numColumns = 2; composite.setLayout(layout); GridData childData = new GridData(GridData.FILL_BOTH); childData.horizontalSpan = 2; composite.setLayoutData(childData); composite.setFont(parent.getFont()); return composite; }
From source file:org.eclipse.birt.report.designer.data.ui.property.AbstractTitlePropertyDialog.java
License:Open Source License
private void createDialogTitleArea(Composite parent) { Composite contents = new Composite(parent, SWT.NONE); contents.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); FormLayout layout = new FormLayout(); contents.setLayout(layout);//from ww w .j a v a 2s .c om titleArea = new Composite(contents, SWT.NONE); initializeDialogUnits(titleArea); FormData titleAreaData = new FormData(); titleAreaData.top = new FormAttachment(0, 0); titleAreaData.left = new FormAttachment(0, 0); titleAreaData.right = new FormAttachment(100, 0); titleArea.setLayoutData(titleAreaData); layout = new FormLayout(); titleArea.setLayout(layout); // add a dispose listener titleArea.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if (titleAreaColor != null) { titleAreaColor.dispose(); } } }); // Determine the background color of the title bar Display display = titleArea.getDisplay(); Color background; Color foreground; if (titleAreaRGB != null) { titleAreaColor = new Color(display, titleAreaRGB); background = titleAreaColor; foreground = null; } else { background = JFaceColors.getBannerBackground(display); foreground = JFaceColors.getBannerForeground(display); } int verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); int horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); titleArea.setBackground(background); // Dialog image @ right titleImageLabel = new Label(titleArea, SWT.CENTER); titleImageLabel.setBackground(background); if (titleImage == null || titleImage.isDisposed()) { titleImageLabel.setImage(JFaceResources.getImage(DLG_IMG_TITLE_BANNER)); } else { titleImageLabel.setImage(titleImage); } FormData imageData = new FormData(); imageData.top = new FormAttachment(0, 0); // Note: do not use horizontalSpacing on the right as that would be a // regression from // the R2.x style where there was no margin on the right and images are // flush to the right // hand side. see reopened comments in 41172 imageData.right = new FormAttachment(100, 0); // horizontalSpacing titleImageLabel.setLayoutData(imageData); // Title label @ top, left titleLabel = new Label(titleArea, SWT.LEFT); JFaceColors.setColors(titleLabel, foreground, background); titleLabel.setFont(JFaceResources.getBannerFont()); titleLabel.setText(" ");//$NON-NLS-1$ FormData titleData = new FormData(); titleData.top = new FormAttachment(0, verticalSpacing); titleData.right = new FormAttachment(titleImageLabel); titleData.left = new FormAttachment(0, horizontalSpacing); titleLabel.setLayoutData(titleData); messageImageLabel = new Label(titleArea, SWT.CENTER); messageImageLabel.setBackground(background); messageLabel = new Text(titleArea, SWT.WRAP | SWT.READ_ONLY); JFaceColors.setColors(messageLabel, foreground, background); messageLabel.setText(" \n "); // two lines//$NON-NLS-1$ messageLabel.setFont(JFaceResources.getDialogFont()); messageLabelHeight = messageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; leftFillerLabel = new Label(titleArea, SWT.CENTER); leftFillerLabel.setBackground(background); setLayoutsForNormalMessage(verticalSpacing, horizontalSpacing); determineTitleImageLargest(); Label titleBarSeparator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR); titleBarSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); }
From source file:org.eclipse.birt.report.designer.data.ui.property.AbstractTitlePropertyDialog.java
License:Open Source License
private void layoutForNewMessage() { int verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); int horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); // If there are no images then layout as normal if (errorMessage == null && messageImage == null) { setImageLabelVisible(false);//from w ww . j a v a 2s . c o m setLayoutsForNormalMessage(verticalSpacing, horizontalSpacing); } else { messageImageLabel.setVisible(true); leftFillerLabel.setVisible(true); /** * Note that we do not use horizontalSpacing here as when the * background of the messages changes there will be gaps between the * icon label and the message that are the background color of the * shell. We add a leading space elsewhere to compendate for this. */ FormData data = new FormData(); data.left = new FormAttachment(0, H_GAP_IMAGE); data.top = new FormAttachment(titleLabel, verticalSpacing); messageImageLabel.setLayoutData(data); data = new FormData(); data.top = new FormAttachment(messageImageLabel, 0); data.left = new FormAttachment(0, 0); data.bottom = new FormAttachment(messageLabel, 0, SWT.BOTTOM); data.right = new FormAttachment(messageImageLabel, 0, SWT.RIGHT); data = new FormData(); data.top = new FormAttachment(messageImageLabel, 0, SWT.TOP); data.left = new FormAttachment(0, 0); data.bottom = new FormAttachment(messageImageLabel, 0, SWT.BOTTOM); data.right = new FormAttachment(messageImageLabel, 0); leftFillerLabel.setLayoutData(data); FormData messageLabelData = new FormData(); messageLabelData.top = new FormAttachment(titleLabel, verticalSpacing); messageLabelData.right = new FormAttachment(titleImageLabel); messageLabelData.left = new FormAttachment(messageImageLabel, 0); messageLabelData.height = messageLabelHeight; if (titleImageLargest) messageLabelData.bottom = new FormAttachment(titleImageLabel, 0, SWT.BOTTOM); messageLabel.setLayoutData(messageLabelData); } // Do not layout before the dialog area has been created // to avoid incomplete calculations. if (dialogArea != null) { titleArea.getParent().layout(true); titleArea.layout(true); } }
From source file:org.eclipse.birt.report.designer.internal.ui.dialogs.TableOptionBindingDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { loadPreference();//w w w. j a v a2 s .c o m 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);// w w w . jav a2s . 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(); }/* w w w . j a v a 2 s. c o m*/ // 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);//from w ww.ja v a 2s .c om 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; }