From e564d213078e2b8b6ee2b8a0e5066a45fc276c3e Mon Sep 17 00:00:00 2001 From: David Weiser Date: Wed, 24 May 2017 14:58:01 +0200 Subject: Bug 514806 - p2 installation dialog move Select All and Deselect All button to the side of the filtered tree Change-Id: I4d7f13fc747c02d562ccbc4f41997e35736c8a7c Signed-off-by: David Weiser --- .../internal/p2/ui/dialogs/AvailableIUsPage.java | 38 ++++++++++++++-------- .../p2/ui/dialogs/RepositorySelectionGroup.java | 1 + 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java index a75fd1289..3242115cc 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java @@ -106,6 +106,7 @@ public class AvailableIUsPage extends ProvisioningWizardPage implements ISelecta Composite aboveSash = new Composite(sashForm, SWT.NONE); GridLayout grid = new GridLayout(); + grid.numColumns = 2; grid.marginWidth = 0; grid.marginHeight = 0; aboveSash.setLayout(grid); @@ -140,6 +141,7 @@ public class AvailableIUsPage extends ProvisioningWizardPage implements ISelecta // select buttons createSelectButtons(aboveSash); + createSelectionCount(aboveSash); // Details area iuDetailsGroup = new IUDetailsGroup(sashForm, availableIUGroup.getStructuredViewer(), SWT.DEFAULT, true); @@ -184,6 +186,24 @@ public class AvailableIUsPage extends ProvisioningWizardPage implements ISelecta Dialog.applyDialogFont(composite); } + private void createSelectionCount(Composite parentComposite) { + Composite selectionCountComposite = new Composite(parentComposite, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginWidth = 0; + layout.verticalSpacing = 10; + selectionCountComposite.setLayout(layout); + selectionCountComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); + + selectionCount = new Label(selectionCountComposite, SWT.NONE); + GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); + selectionCount.setLayoutData(data); + + // separator underneath + Label sep = new Label(selectionCountComposite, SWT.HORIZONTAL | SWT.SEPARATOR); + GridData separatorGridData = new GridData(SWT.FILL, SWT.CENTER, true, false); + sep.setLayoutData(separatorGridData); + } + private Composite createProgressBar(Composite parent) { final Composite progressBarComposite = new Composite(parent, SWT.NONE); Label progressBarLabel = new Label(progressBarComposite, SWT.NONE); @@ -227,12 +247,14 @@ public class AvailableIUsPage extends ProvisioningWizardPage implements ISelecta private void createSelectButtons(Composite parent) { Composite buttonParent = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(); - gridLayout.numColumns = 3; + gridLayout.numColumns = 1; + gridLayout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); + gridLayout.marginHeight = 0; gridLayout.marginWidth = 0; gridLayout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); buttonParent.setLayout(gridLayout); - GridData data = new GridData(SWT.FILL, SWT.DEFAULT, true, false); + GridData data = new GridData(SWT.FILL, SWT.DEFAULT, false, false); buttonParent.setLayoutData(data); Button selectAll = new Button(buttonParent, SWT.PUSH); @@ -244,18 +266,6 @@ public class AvailableIUsPage extends ProvisioningWizardPage implements ISelecta deselectAll.setText(ProvUIMessages.SelectableIUsPage_Deselect_All); setButtonLayoutData(deselectAll); deselectAll.addListener(SWT.Selection, event -> setAllChecked(false)); - - // dummy to take extra space - selectionCount = new Label(buttonParent, SWT.NONE); - data = new GridData(SWT.FILL, SWT.CENTER, true, true); - data.horizontalIndent = 20; // breathing room - selectionCount.setLayoutData(data); - - // separator underneath - Label sep = new Label(buttonParent, SWT.HORIZONTAL | SWT.SEPARATOR); - data = new GridData(SWT.FILL, SWT.DEFAULT, true, false); - data.horizontalSpan = 3; - sep.setLayoutData(data); } // The viewer method is deprecated because it only applies to visible items, diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java index d4cbbfb9b..dd485c42c 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java @@ -106,6 +106,7 @@ public class RepositorySelectionGroup { layout.marginTop = 0; layout.marginBottom = IDialogConstants.VERTICAL_SPACING; layout.numColumns = 4; + layout.marginWidth = 0; comboComposite.setLayout(layout); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); comboComposite.setLayoutData(gd); -- cgit v1.2.3