List of usage examples for org.eclipse.jface.dialogs IDialogConstants VERTICAL_MARGIN
int VERTICAL_MARGIN
To view the source code for org.eclipse.jface.dialogs IDialogConstants VERTICAL_MARGIN.
Click Source Link
From source file:com.microsoft.tfs.client.common.ui.teambuild.editors.QueueEditorPage.java
License:Open Source License
private void createControls(final Composite composite) { final GridLayout layout = new GridLayout(1, false); layout.horizontalSpacing = 0;/*from w ww .j a va2 s .c om*/ layout.verticalSpacing = 0; layout.marginWidth = 0; layout.marginHeight = 0; composite.setLayout(layout); final Composite header = new Composite(composite, SWT.NONE); GridDataBuilder.newInstance().hFill().hGrab().applyTo(header); /* Compute metrics in pixels */ final GC gc = new GC(header); final FontMetrics fontMetrics = gc.getFontMetrics(); gc.dispose(); final GridLayout headerLayout = new GridLayout(3, false); headerLayout.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_SPACING); headerLayout.verticalSpacing = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_SPACING); headerLayout.marginWidth = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_MARGIN); headerLayout.marginHeight = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_MARGIN); header.setLayout(headerLayout); SWTUtil.createLabel(header, Messages.getString("QueueEditorPage.BuildDefinitionLabelText")); //$NON-NLS-1$ SWTUtil.createLabel(header, Messages.getString("QueueEditorPage.StatusFilterLabelText")); //$NON-NLS-1$ SWTUtil.createLabel(header, buildServer.getBuildServerVersion().isV3OrGreater() ? Messages.getString("QueueEditorPage.ControlFilterLabelText") //$NON-NLS-1$ : Messages.getString("QueueEditorPage.AgentFilterLabelText")); //$NON-NLS-1$ buildDefinitionFilterCombo = new Combo(header, SWT.READ_ONLY); GridDataBuilder.newInstance().fill().hGrab().applyTo(buildDefinitionFilterCombo); statusFilterCombo = new Combo(header, SWT.READ_ONLY); GridDataBuilder.newInstance().fill().applyTo(statusFilterCombo); ControlSize.setCharWidthHint(statusFilterCombo, 25); controllerFilterCombo = new Combo(header, SWT.READ_ONLY); GridDataBuilder.newInstance().fill().applyTo(controllerFilterCombo); ControlSize.setCharWidthHint(controllerFilterCombo, 30); onlyMyBuildsCheck = new Button(header, SWT.CHECK); onlyMyBuildsCheck.setText(Messages.getString("BuildEditorPage.OnlyMyBuilds")); //$NON-NLS-1$ onlyMyBuildsCheck.setEnabled(buildServer.getBuildServerVersion().isV3OrGreater()); GridDataBuilder.newInstance().fill().hSpan(3).applyTo(onlyMyBuildsCheck); final Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL); GridDataBuilder.newInstance().hGrab().hFill().applyTo(separator); queuedBuildsTable = new QueuedBuildsTableControl(composite, SWT.MULTI | SWT.FULL_SELECTION | TableControl.NO_BORDER, buildServer); GridDataBuilder.newInstance().hSpan(layout).grab().fill().applyTo(queuedBuildsTable); queuedBuildsTable.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(final DoubleClickEvent event) { onDoubleClick(event); } }); queuedBuildsTable.getContextMenu().addMenuListener(new IMenuListener() { @Override public void menuAboutToShow(final IMenuManager manager) { fillMenu(manager); } }); populateCombos(false); getSite().setSelectionProvider(this); buildDefinitionFilterCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { filterChanged(); } }); statusFilterCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { filterChanged(); } }); controllerFilterCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { filterChanged(); } }); onlyMyBuildsCheck.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { filterChanged(); } }); }
From source file:com.microsoft.tfs.client.common.ui.vcexplorer.versioncontrol.FindInSourceControlEditor.java
License:Open Source License
@Override public void createPartControl(final Composite parent) { final IEditorInput editorInput = getEditorInput(); repository = getEditorInput().getRepository(); setPartName(editorInput.getName());/*from w w w .jav a 2s . co m*/ setTitleToolTip(editorInput.getToolTipText()); final Composite partComposite = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(1, true); layout.marginWidth = 0; layout.marginHeight = 0; layout.horizontalSpacing = 0; layout.verticalSpacing = 0; partComposite.setLayout(layout); final Composite labelComposite = new Composite(partComposite, SWT.NONE); /* Compute metrics in pixels */ final GC gc = new GC(labelComposite); final FontMetrics fontMetrics = gc.getFontMetrics(); gc.dispose(); final FillLayout labelCompositeLayout = new FillLayout(); labelCompositeLayout.marginWidth = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_MARGIN) / 2; labelCompositeLayout.marginHeight = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_MARGIN) / 2; labelComposite.setLayout(labelCompositeLayout); GridDataBuilder.newInstance().hGrab().hFill().applyTo(labelComposite); resultsLabel = new Label(labelComposite, SWT.NONE); tableComposite = new Composite(partComposite, SWT.NONE); GridDataBuilder.newInstance().grab().fill().applyTo(tableComposite); tableStack = new StackLayout(); tableComposite.setLayout(tableStack); pendingChangesTable = new FindInSourceControlPendingChangesTable(tableComposite, SWT.FULL_SELECTION | SWT.MULTI); createActions(); menuManager = new MenuManager("menu"); //$NON-NLS-1$ menuManager.setRemoveAllWhenShown(true); menuManager.addMenuListener(new IMenuListener() { @Override public void menuAboutToShow(final IMenuManager manager) { fillContextMenu(manager); } }); pendingChangesTable.getTable().setMenu(menuManager.createContextMenu(pendingChangesTable)); /* * Proxy selection changes in both tables to listeners. */ final ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() { @Override public void selectionChanged(final SelectionChangedEvent event) { ((ISelectionChangedListener) selectionChangedListeners.getListener()).selectionChanged(event); } }; pendingChangesTable.addSelectionChangedListener(selectionChangedListener); pendingChangesTable.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(final DoubleClickEvent event) { openInSCEAction.run(); } }); TFSCommonUIClientPlugin.getDefault().getProductPlugin().getRepositoryManager() .addListener(repositoryManagerListener); }
From source file:com.microsoft.tfs.client.common.ui.views.DeprecatedByTeamExplorerView.java
License:Open Source License
@Override public final void createPartControl(final Composite parent) { /* Compute metrics in pixels */ final GC gc = new GC(parent); final FontMetrics fontMetrics = gc.getFontMetrics(); gc.dispose();/*from w w w . j ava 2s. co m*/ final GridLayout layout = new GridLayout(2, false); layout.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_SPACING) * 2; layout.verticalSpacing = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_SPACING); layout.marginWidth = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_MARGIN); parent.setLayout(layout); final Label imageLabel = new Label(parent, SWT.NONE); imageLabel.setImage(Display.getCurrent().getSystemImage(SWT.ICON_INFORMATION)); final Link textLabel = new Link(parent, SWT.READ_ONLY | SWT.WRAP); textLabel.setText(Messages.getString("DeprecatedByTeamExplorerView.DeprecatedText")); //$NON-NLS-1$ textLabel.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { try { final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage(); page.showView(TeamExplorerView.ID); } catch (final Exception f) { log.warn("Could not open Team Explorer View", f); //$NON-NLS-1$ MessageDialog.openError(getSite().getShell(), Messages.getString("DeprecatedByTeamExplorerView.OpenViewFailedTitle"), //$NON-NLS-1$ Messages.getString("DeprecatedByTeamExplorerView.OpenViewFailedMessage")); //$NON-NLS-1$ } } }); GridDataBuilder.newInstance().hGrab().hFill().applyTo(textLabel); }
From source file:com.nginious.http.plugin.NewProjectPageOne.java
License:Apache License
public void createControl(Composite parent) { initializeDialogUnits(parent);/*from www . jav a 2 s . c o m*/ final Composite composite = new Composite(parent, SWT.NULL); composite.setFont(parent.getFont()); composite.setLayout(initGridLayout(new GridLayout(1, false), true)); composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); // create UI elements Control nameControl = createNameControl(composite); nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Composite nameComposite = (Composite) nameControl; this.nameText = (Text) nameComposite.getChildren()[1]; nameText.addListener(SWT.KeyUp, this); Control locationControl = createLocationControl(composite); locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Control jreControl = createJRESelectionControl(composite); jreControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); int horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); int verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); int marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); int marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); this.block = new PropertiesBlock(horizontalSpacing, verticalSpacing, marginWidth, marginHeight); block.setListenPortValidator(this); block.createControls(composite); Control infoControl = createInfoControl(composite); infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); setControl(composite); }
From source file:com.nginious.http.plugin.NewProjectPageOne.java
License:Apache License
private GridLayout initGridLayout(GridLayout layout, boolean margins) { layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); if (margins) { layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); } else {/*w w w . jav a 2 s .c o m*/ layout.marginWidth = 0; layout.marginHeight = 0; } return layout; }
From source file:com.nginious.http.plugin.ProjectPropertyPage.java
License:Apache License
protected Control createContents(Composite parent) { initializeDialogUnits(parent);/*from w w w . ja v a 2 s . c o m*/ IAdaptable element = this.getElement(); if (element instanceof IJavaProject) { IJavaProject javaProject = (IJavaProject) element; this.project = javaProject.getProject(); } else { this.project = (IProject) element; } final Composite composite = new Composite(parent, SWT.NULL); composite.setFont(parent.getFont()); composite.setLayout(initGridLayout(new GridLayout(1, false), true)); composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); int horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); int verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); int marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); int marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); this.block = new PropertiesBlock(this.project, horizontalSpacing, verticalSpacing, marginWidth, marginHeight); block.createControls(composite); return composite; }
From source file:com.nokia.carbide.remoteconnections.internal.ui.ClientServiceSiteUI2.java
License:Open Source License
public void createComposite(Composite parent) { initializeDialogUnits(parent);//from w w w . j ava 2 s .com Group group = new Group(parent, SWT.NONE); group.setText(Messages.getString("ClientServiceSiteUI2.UseConnectionGroupLabel")); //$NON-NLS-1$ group.setLayout(new GridLayout()); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); group.setData(UID, "useConnectionGroup"); //$NON-NLS-1$ viewer = new ComboViewer(group, SWT.READ_ONLY); viewer.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { Check.checkContract(element instanceof String); String id = (String) element; return connectionNames.get(id); } }); viewer.setContentProvider(new ArrayContentProvider()); GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); viewer.getCombo().setLayoutData(gd); viewer.getControl().setData(UID, "viewer"); //$NON-NLS-1$ viewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); String connection = (String) selection.getFirstElement(); if (connection != null && !connection.equals(ClientServiceSiteUI2.this.connection)) { ClientServiceSiteUI2.this.connection = connection; fireConnectionSelected(); } } }); final Composite composite = new Composite(group, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.makeColumnsEqualWidth = true; layout.marginWidth = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = Dialog.convertVerticalDLUsToPixels(fm, IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = Dialog.convertVerticalDLUsToPixels(fm, IDialogConstants.VERTICAL_SPACING); composite.setLayout(layout); gd = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER); composite.setLayoutData(gd); composite.setFont(parent.getFont()); newButton = new Button(composite, SWT.PUSH); newButton.setText(Messages.getString("ClientServiceSiteUI2.NewButtonLabel")); //$NON-NLS-1$ newButton.setFont(JFaceResources.getDialogFont()); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); int widthHint = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.BUTTON_WIDTH); Point minSize = newButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); gd.widthHint = Math.max(widthHint, minSize.x); newButton.setLayoutData(gd); newButton.setData(UID, "newButton"); //$NON-NLS-1$ newButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { SettingsWizard wizard = new SettingsWizard(null, service); wizard.open(composite.getShell()); IConnection connection = wizard.getConnectionToEdit(); // note: refresh ASAP so the selection will be valid; but endure a listener event // which will redo this refreshUI(); setViewerInput(connection); } }); editButton = new Button(composite, SWT.PUSH); editButton.setText(Messages.getString("ClientServiceSiteUI2.EditButtonLabel")); //$NON-NLS-1$ editButton.setFont(JFaceResources.getDialogFont()); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); widthHint = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.BUTTON_WIDTH); minSize = editButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); gd.widthHint = Math.max(widthHint, minSize.x); editButton.setLayoutData(gd); editButton.setData(UID, "editButton"); //$NON-NLS-1$ editButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); Object value = selection.getFirstElement(); if (value instanceof String) { IConnection editConnection = getActualConnection((String) value); SettingsWizard wizard = new SettingsWizard(editConnection, service); wizard.open(composite.getShell()); // leave the viewer the same, callback will refresh anything needed } } }); // attach listeners RemoteConnectionsActivator.getConnectionsManager().addConnectionListener(this); RemoteConnectionsActivator.getConnectionsManager().addConnectionStoreChangedListener(this); // remove listeners on dispose group.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { RemoteConnectionsActivator.getConnectionsManager() .removeConnectionListener(ClientServiceSiteUI2.this); RemoteConnectionsActivator.getConnectionsManager() .removeConnectionStoreChangedListener(ClientServiceSiteUI2.this); } }); setViewerInput(null); }
From source file:com.nokia.carbide.remoteconnections.ui.ClientServiceSiteUI.java
License:Open Source License
public void createComposite(Composite parent) { initializeDialogUnits(parent);/*from ww w. j a v a 2 s . c om*/ Group group = new Group(parent, SWT.NONE); group.setText(Messages.getString("ClientServiceSiteUI.UseConnectionGroupLabel")); //$NON-NLS-1$ group.setLayout(new GridLayout()); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); group.setData(UID, "useConnectionGroup"); //$NON-NLS-1$ viewer = new ComboViewer(group, SWT.READ_ONLY); viewer.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { Check.checkContract(element instanceof IConnection); return ((IConnection) element).getDisplayName(); } }); viewer.setContentProvider(new ArrayContentProvider()); GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); viewer.getCombo().setLayoutData(gd); viewer.getControl().setData(UID, "viewer"); //$NON-NLS-1$ viewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); IConnection connection = (IConnection) selection.getFirstElement(); if (!connection.equals(ClientServiceSiteUI.this.connection)) { ClientServiceSiteUI.this.connection = connection; fireConnectionSelected(); } } }); final Composite composite = new Composite(group, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.makeColumnsEqualWidth = true; layout.marginWidth = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = Dialog.convertVerticalDLUsToPixels(fm, IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = Dialog.convertVerticalDLUsToPixels(fm, IDialogConstants.VERTICAL_SPACING); composite.setLayout(layout); gd = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER); composite.setLayoutData(gd); composite.setFont(parent.getFont()); newButton = new Button(composite, SWT.PUSH); newButton.setText(Messages.getString("ClientServiceSiteUI.NewButtonLabel")); //$NON-NLS-1$ newButton.setFont(JFaceResources.getDialogFont()); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); int widthHint = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.BUTTON_WIDTH); Point minSize = newButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); gd.widthHint = Math.max(widthHint, minSize.x); newButton.setLayoutData(gd); newButton.setData(UID, "newButton"); //$NON-NLS-1$ newButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { SettingsWizard wizard = new SettingsWizard(null, service); wizard.open(composite.getShell()); setViewerInput(wizard.getConnectionToEdit()); } }); editButton = new Button(composite, SWT.PUSH); editButton.setText(Messages.getString("ClientServiceSiteUI.EditButtonLabel")); //$NON-NLS-1$ editButton.setFont(JFaceResources.getDialogFont()); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); widthHint = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.BUTTON_WIDTH); minSize = editButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); gd.widthHint = Math.max(widthHint, minSize.x); editButton.setLayoutData(gd); editButton.setData(UID, "editButton"); //$NON-NLS-1$ editButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); Object value = selection.getFirstElement(); if (value instanceof IConnection) { SettingsWizard wizard = new SettingsWizard((IConnection) value, service); wizard.open(composite.getShell()); setViewerInput(wizard.getConnectionToEdit()); } } }); setViewerInput(null); }
From source file:com.nokia.carbide.search.system.internal.ui.SearchDialog.java
License:Open Source License
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 w w w . j a v a 2 s .com*/ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // create help control if needed if (isHelpAvailable()) { createHelpControl(composite); } fCustomizeButton = createButton(composite, CUSTOMIZE_ID, SearchMessages.SearchDialog_customize, true); Label filler = new Label(composite, SWT.NONE); filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); layout.numColumns++; fReplaceButton = createActionButton(composite, REPLACE_ID, SearchMessages.SearchDialog_replaceAction, true); fReplaceButton.setVisible(fCurrentPage instanceof IReplacePage); Button searchButton = createActionButton(composite, SEARCH_ID, SearchMessages.SearchDialog_searchAction, true); searchButton.setEnabled(fDescriptors.size() > 0); super.createButtonsForButtonBar(composite); // cancel button return composite; }
From source file:com.nokia.carbide.search.system.internal.ui.text.ReplaceDialog2.java
License:Open Source License
protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 0; // createActionButton increments 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 . java 2 s.co m*/ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fReplaceButton = createActionButton(composite, REPLACE, SearchMessages.ReplaceDialog_replace, true); fReplaceAllInFileButton = createActionButton(composite, REPLACE_ALL_IN_FILE, SearchMessages.ReplaceDialog_replaceAllInFile, false); Label filler = new Label(composite, SWT.NONE); filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); fReplaceAllButton = createActionButton(composite, REPLACE_ALL, SearchMessages.ReplaceDialog_replaceAll, false); fSkipButton = createActionButton(composite, SKIP, SearchMessages.ReplaceDialog_skip, false); fSkipFileButton = createActionButton(composite, SKIP_FILE, SearchMessages.ReplaceDialog_skipFile, false); filler = new Label(composite, SWT.NONE); filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); super.createButtonsForButtonBar(composite); // cancel button layout.numColumns = 4; // createActionButton increments return composite; }