List of usage examples for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_MARGIN
int HORIZONTAL_MARGIN
To view the source code for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_MARGIN.
Click Source Link
From source file:org.jboss.tools.project.examples.dialog.xpl.QuickFixPage.java
License:Open Source License
public void createControl(Composite parent) { initializeDialogUnits(parent);// www .j a v a 2 s .c om // Create a new composite as there is the title bar seperator // to deal with Composite control = new Composite(parent, SWT.NONE); control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); setControl(control); PlatformUI.getWorkbench().getHelpSystem().setHelp(control, IWorkbenchHelpContextIds.PROBLEMS_VIEW); FormLayout layout = new FormLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.spacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); control.setLayout(layout); Label resolutionsLabel = new Label(control, SWT.NONE); resolutionsLabel.setText(MarkerMessages.MarkerResolutionDialog_Resolutions_List_Title); resolutionsLabel.setLayoutData(new FormData()); createResolutionsList(control); FormData listData = new FormData(); listData.top = new FormAttachment(resolutionsLabel, 0); listData.left = new FormAttachment(0); listData.right = new FormAttachment(100, 0); listData.height = convertHeightInCharsToPixels(10); resolutionsList.getControl().setLayoutData(listData); Label title = new Label(control, SWT.NONE); title.setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Title); FormData labelData = new FormData(); labelData.top = new FormAttachment(resolutionsList.getControl(), 0); labelData.left = new FormAttachment(0); title.setLayoutData(labelData); createMarkerTable(control); Composite buttons = createTableButtons(control); FormData buttonData = new FormData(); buttonData.top = new FormAttachment(title, 0); buttonData.right = new FormAttachment(100); buttonData.height = convertHeightInCharsToPixels(10); buttons.setLayoutData(buttonData); FormData tableData = new FormData(); tableData.top = new FormAttachment(buttons, 0, SWT.TOP); tableData.left = new FormAttachment(0); tableData.bottom = new FormAttachment(100); tableData.right = new FormAttachment(buttons, 0); tableData.height = convertHeightInCharsToPixels(10); markersTable.getControl().setLayoutData(tableData); Dialog.applyDialogFont(control); if (resolutionsList.getList().getItemCount() > 0) { resolutionsList.setSelection(new StructuredSelection(resolutionsList.getElementAt(0))); } markersTable.setAllChecked(true); }
From source file:org.jboss.tools.project.examples.preferences.SiteDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite parentComposite = (Composite) super.createDialogArea(parent); 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 w w w . ja v a 2 s .c o m composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parentComposite.getFont()); Composite container = new Composite(parentComposite, SWT.FILL); layout = new GridLayout(3, false); layout.marginWidth = layout.marginHeight = 5; container.setLayout(layout); GridData gd = new GridData(GridData.FILL_BOTH); container.setLayoutData(gd); Label nameLabel = new Label(container, SWT.NONE); nameLabel.setText(Messages.SiteDialog_Name); nameText = new Text(container, SWT.SINGLE | SWT.BORDER); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; nameText.setLayoutData(gd); nameText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validatePage(); } }); Label urlLabel = new Label(container, SWT.NONE); urlLabel.setText(Messages.SiteDialog_URL); urlText = new Text(container, SWT.SINGLE | SWT.BORDER); gd = new GridData(GridData.FILL_HORIZONTAL); urlText.setLayoutData(gd); urlText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validatePage(); } }); if (selectedSite != null) { urlText.setText(selectedSite.getUrl().toString()); nameText.setText(selectedSite.getName()); } Button browse = new Button(container, SWT.PUSH); browse.setText(Messages.Browse); browse.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE); dialog.setFilterExtensions(new String[] { "*.xml" }); //$NON-NLS-1$; String result = dialog.open(); if (result == null || result.trim().length() == 0) { return; } try { String urlString = new File(result).toURL().toString(); urlText.setText(urlString); } catch (MalformedURLException e1) { urlText.setText("file:///" + result); //$NON-NLS-1$ } } public void widgetDefaultSelected(SelectionEvent e) { } }); return parentComposite; }
From source file:org.kalypso.contribs.eclipse.jface.wizard.view.WizardView.java
License:Open Source License
/** * Creates and returns the contents of this dialog's button bar. * <p>/* w w w . j a v a 2s . c o m*/ * The <code>Dialog</code> implementation of this framework method lays out a button bar and calls the * <code>createButtonsForButtonBar</code> framework method to populate it. Subclasses may override. * </p> * <p> * The returned control's layout data must be an instance of <code>GridData</code>. * </p> * * @param parent * the parent composite to contain the button bar * @return the button bar control */ protected Control createButtonBar(final Composite parent) { final Composite composite = new Composite(parent, SWT.NONE); // create a layout with spacing and margins appropriate for the font // size. final GridLayout layout = new GridLayout(); layout.numColumns = 0; // this is incremented by createButton layout.makeColumnsEqualWidth = false; layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); composite.setLayout(layout); final GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER); composite.setLayoutData(data); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }
From source file:org.locationtech.udig.style.sld.editor.StyleEditorDialog.java
License:Open Source License
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(2, false); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); composite.setLayout(layout);//from w ww . j av a 2s . c om GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); composite.setLayoutData(data); composite.setFont(parent.getFont()); // add import/export buttons addImportExportButtons(composite); // add apply/revert/close buttons addOkCancelRevertApplyButtons(parent, composite); return composite; }
From source file:org.locationtech.udig.validation.ui.ValidationDialog.java
License:Open Source License
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.FILL); GridLayout layout = new GridLayout(); layout.numColumns = 2;/*from w w w.j a v a 2 s . co m*/ layout.makeColumnsEqualWidth = true; layout.marginWidth = 0; // no spacing here, it's purely a container layout.marginHeight = 0; layout.horizontalSpacing = 0; layout.verticalSpacing = 0; composite.setLayout(layout); GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); composite.setLayoutData(data); composite.setFont(parent.getFont()); // create 2 composites in the composite with left and right aligns Composite leftComp = new Composite(composite, SWT.LEFT); layout = new GridLayout(); layout.numColumns = 2; layout.makeColumnsEqualWidth = true; layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); leftComp.setLayout(layout); data = new GridData(SWT.LEFT, SWT.NONE, true, false); leftComp.setLayoutData(data); leftComp.setFont(parent.getFont()); Composite rightComp = new Composite(composite, SWT.RIGHT); layout = new GridLayout(); layout.numColumns = 2; layout.makeColumnsEqualWidth = true; layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); rightComp.setLayout(layout); data = new GridData(SWT.RIGHT, SWT.NONE, true, false); rightComp.setLayoutData(data); rightComp.setFont(parent.getFont()); // Add the buttons importButton = new Button(leftComp, SWT.PUSH); importButton.setFont(parent.getFont()); importButton.setText(Messages.ValidationDialog_import); importButton.setEnabled(true); importButton.addSelectionListener(new ImportSuiteListener()); setButtonLayoutData(importButton); exportButton = new Button(leftComp, SWT.PUSH); exportButton.setFont(parent.getFont()); exportButton.setText(Messages.ValidationDialog_export); exportButton.setEnabled(false); exportButton.addSelectionListener(new ExportSuiteListener()); setButtonLayoutData(exportButton); runButton = new Button(rightComp, SWT.PUSH); runButton.setFont(parent.getFont()); runButton.setText(Messages.ValidationDialog_run); runButton.setEnabled(false); runButton.addSelectionListener(new RunTestsListener()); setButtonLayoutData(runButton); cancelButton = new Button(rightComp, SWT.PUSH); cancelButton.setText(IDialogConstants.CLOSE_LABEL); cancelButton.setFont(parent.getFont()); cancelButton.setData(new Integer(IDialogConstants.CANCEL_ID)); closeListener = new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { // nothing is happening and the user hit cancel (close) buttonPressed(((Integer) event.widget.getData()).intValue()); } }; // cancelListener = new SelectionListener() { // // public void widgetSelected( SelectionEvent e ) { // // a test is running and the user just hit cancel // // cancel the progress monitor // progressMonitorPart.setCanceled(true); // cancelButton.setEnabled(false); // } // // public void widgetDefaultSelected( SelectionEvent e ) { // widgetSelected(e); // } // // }; cancelButton.addSelectionListener(closeListener); setButtonLayoutData(cancelButton); return composite; }
From source file:org.neo4j.neoclipse.connection.dialogs.CreateAliasDialog.java
License:Apache 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); 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 .j a va2s. com composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parentComposite.getFont()); Composite nameGroup = new Composite(composite, SWT.NONE); layout = new GridLayout(); layout.numColumns = 3; layout.marginWidth = 10; nameGroup.setLayout(layout); GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); nameGroup.setLayoutData(data); Label label = new Label(nameGroup, SWT.WRAP); label.setText(("Name *")); nameField = new Text(nameGroup, SWT.BORDER); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; nameField.setLayoutData(data); nameField.addKeyListener(new KeyListener() { @Override public void keyPressed(org.eclipse.swt.events.KeyEvent e) { validate(); }; @Override public void keyReleased(org.eclipse.swt.events.KeyEvent e) { validate(); }; }); urlField = new DirectoryFieldEditor(Preferences.DATABASE_LOCATION, "URI *", nameGroup); urlField.getTextControl(nameGroup).addKeyListener(new KeyListener() { @Override public void keyReleased(KeyEvent arg0) { validate(); } @Override public void keyPressed(KeyEvent arg0) { validate(); } }); urlField.setPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { validate(); } }); new Label(nameGroup, SWT.NONE); Label label3 = new Label(nameGroup, SWT.WRAP); label3.setText(("i.e http://localhost:7474/db/data/ or C:/neo4j/db ")); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; label3.setLayoutData(data); new Label(nameGroup, SWT.NONE); Composite connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE); connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 0; connectionPropertiesComposite.setLayout(gridLayout); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; connectionPropertiesComposite.setLayoutData(data); autoConnectButton = new Button(connectionPropertiesComposite, SWT.CHECK); GridData gd_autoLogonButton = new GridData(108, SWT.DEFAULT); autoConnectButton.setLayoutData(gd_autoLogonButton); autoConnectButton.setText("Auto Connect"); allowUpgrade = new Button(connectionPropertiesComposite, SWT.CHECK); GridData gd_allowUpgrade = new GridData(128, SWT.DEFAULT); allowUpgrade.setLayoutData(gd_allowUpgrade); allowUpgrade.setText(GraphDatabaseSettings.allow_store_upgrade.name()); allowUpgrade.setSelection(true); Label label4 = new Label(nameGroup, SWT.WRAP); label4.setText(("User")); userField = new Text(nameGroup, SWT.BORDER); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; userField.setLayoutData(data); Label label5 = new Label(nameGroup, SWT.WRAP); label5.setText(("Password")); passwordField = new Text(nameGroup, SWT.BORDER); passwordField.setEchoChar('*'); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; passwordField.setLayoutData(data); new Label(nameGroup, SWT.NONE); connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE); connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 0; connectionPropertiesComposite.setLayout(gridLayout); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; connectionPropertiesComposite.setLayoutData(data); return parentComposite; }
From source file:org.neo4j.neoclipse.entitygen.GenerateEntityDialog.java
License:Apache 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); 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 . ja v a 2 s . co m*/ composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parentComposite.getFont()); Composite nameGroup = new Composite(composite, SWT.NONE); layout = new GridLayout(); layout.numColumns = 3; layout.marginWidth = 10; nameGroup.setLayout(layout); GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); nameGroup.setLayoutData(data); Label label = new Label(nameGroup, SWT.WRAP); label.setText(("Package Name *")); packageName = new Text(nameGroup, SWT.BORDER); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; packageName.setText("com.example.neo4j.persistence"); packageName.setLayoutData(data); packageName.addKeyListener(new KeyListener() { @Override public void keyPressed(org.eclipse.swt.events.KeyEvent e) { validate(); }; @Override public void keyReleased(org.eclipse.swt.events.KeyEvent e) { validate(); }; }); Label label1 = new Label(nameGroup, SWT.WRAP); label1.setText(("Class Name Property*")); classNamePattern = new Text(nameGroup, SWT.BORDER); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; classNamePattern.setText("classname"); classNamePattern.setLayoutData(data); classNamePattern.addKeyListener(new KeyListener() { @Override public void keyPressed(org.eclipse.swt.events.KeyEvent e) { validate(); }; @Override public void keyReleased(org.eclipse.swt.events.KeyEvent e) { validate(); }; }); directory = new DirectoryFieldEditor("Directory", "Directory *", nameGroup); directory.getTextControl(nameGroup).addKeyListener(new KeyListener() { @Override public void keyReleased(KeyEvent arg0) { validate(); } @Override public void keyPressed(KeyEvent arg0) { validate(); } }); directory.setPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { validate(); } }); new Label(nameGroup, SWT.NONE); Label label3 = new Label(nameGroup, SWT.WRAP); label3.setText(("ex: C:/neo4j/stubs ")); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; label3.setLayoutData(data); new Label(nameGroup, SWT.NONE); Composite connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE); connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 0; connectionPropertiesComposite.setLayout(gridLayout); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; connectionPropertiesComposite.setLayoutData(data); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = SIZING_TEXT_FIELD_WIDTH; new Label(nameGroup, SWT.NONE); connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE); connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 0; connectionPropertiesComposite.setLayout(gridLayout); data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.horizontalSpan = 2; connectionPropertiesComposite.setLayoutData(data); return parentComposite; }
From source file:org.nightlabs.eclipse.ui.fckeditor.file.FileListDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { setTitle(Messages.getString("org.nightlabs.eclipse.ui.fckeditor.file.FileListDialog.dialogMessageTitle")); //$NON-NLS-1$ setMessage(// w w w. ja v a2s . co m Messages.getString("org.nightlabs.eclipse.ui.fckeditor.file.FileListDialog.dialogMessageMessage")); //$NON-NLS-1$ // create a composite with standard margins and spacing final 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)); applyDialogFont(composite); BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() { /* (non-Javadoc) * @see java.lang.Runnable#run() */ @Override public void run() { createTopArea(composite); createFileListArea(composite); } }); return composite; // final Composite c = (Composite)super.createDialogArea(parent); // GridLayout gd = ((GridLayout)c.getLayout()); // gd.horizontalSpacing // createFileListArea(c); // return c; }
From source file:org.obeonetwork.dsl.uml2.design.internal.dialogs.ImportMetaclassDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { compositeHeaderMessage = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(1, 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); compositeHeaderMessage.setLayout(layout); final Label headerMessage = new Label(compositeHeaderMessage, SWT.NONE); headerMessage.setText(headerMessageText); final GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.horizontalSpan = 2;/* ww w. jav a2 s . c o m*/ headerMessage.setLayoutData(gridData); final Control dialogArea1 = super.createDialogArea(parent); dialogArea1.setEnabled(true); parent.getParent().getShell().setMinimumSize(600, 700); applyFilter(); setDetailsLabelProvider(new LabelProvider() { @Override public String getText(Object element) { String text = new String(); if (element instanceof Class) { final Class myClass = (Class) element; for (final Comment comment : myClass.getOwnedComments()) { if (text.isEmpty()) { text = text + comment.getBody(); } else { text = text + " " + comment.getBody(); //$NON-NLS-1$ } } } return text; } }); return dialogArea1; }
From source file:org.obeonetwork.dsl.uml2.design.internal.dialogs.InitProfilePluginDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { final Composite parentComposite = (Composite) super.createDialogArea(parent); setTitle("Information about profile versioning"); //$NON-NLS-1$ // create a composite with standard margins and spacing. final Composite composite = new Composite(parentComposite, SWT.NONE); final GridLayout layout = new GridLayout(1, true); 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 .ja v a2 s.co m composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setFont(parentComposite.getFont()); GridData gd; final Composite commentArea = createExportArea(composite); gd = new GridData(SWT.FILL, SWT.CENTER, true, true); commentArea.setLayoutData(gd); applyDialogFont(parentComposite); return parentComposite; }