Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-03-27 01:09:16 +0000
committerSusan Franklin2009-03-27 01:09:16 +0000
commit97e143c9ee791821464189eeea99335dbc040dd0 (patch)
tree67e2c74cff97c3bbc592823172299e5f1cf64f05 /bundles
parent9ffd1314026bea08df0cb8b0417e4901ff07c920 (diff)
downloadrt.equinox.p2-97e143c9ee791821464189eeea99335dbc040dd0.tar.gz
rt.equinox.p2-97e143c9ee791821464189eeea99335dbc040dd0.tar.xz
rt.equinox.p2-97e143c9ee791821464189eeea99335dbc040dd0.zip
Bug 260625 - [ui] Deselect / Select all in Update Manager for Available updates
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java49
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties2
3 files changed, 52 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java
index 4f9ce30cf..4081a7132 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java
@@ -250,6 +250,8 @@ public class ProvUIMessages extends NLS {
public static String RevertDialog_Title;
public static String RevertProfileWizardPage_ErrorRetrievingHistory;
public static String RollbackProfileElement_InvalidSnapshot;
+ public static String SelectableIUsPage_Select_All;
+ public static String SelectableIUsPage_Deselect_All;
public static String TrustCertificateDialog_Details;
public static String TrustCertificateDialog_Title;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
index e25d65196..17dba8614 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.dialogs;
+import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
import org.eclipse.equinox.internal.p2.ui.model.ElementUtils;
import org.eclipse.equinox.internal.p2.ui.model.IUElementListRoot;
import org.eclipse.equinox.internal.p2.ui.viewers.IUDetailsLabelProvider;
@@ -20,6 +21,7 @@ import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
import org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy;
import org.eclipse.equinox.internal.provisional.p2.ui.viewers.*;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
@@ -105,7 +107,6 @@ public class SelectableIUsPage extends ProvisioningWizardPage implements ISelect
public void checkStateChanged(CheckStateChangedEvent event) {
setPageComplete(tableViewer.getCheckedElements().length > 0);
}
-
});
// Filters and sorters before establishing content, so we don't refresh unnecessarily.
@@ -121,8 +122,12 @@ public class SelectableIUsPage extends ProvisioningWizardPage implements ISelect
tableViewer.setLabelProvider(labelProvider);
setInitialCheckState();
+ // Select and Deselect All buttons
+ createSelectButtons(composite);
+
// The text area shows a description of the selected IU, or error detail if applicable.
iuDetailsGroup = new IUDetailsGroup(sashForm, tableViewer, convertWidthInCharsToPixels(ILayoutConstants.DEFAULT_TABLE_WIDTH), false);
+
detailsArea = iuDetailsGroup.getDetailsArea();
setControl(sashForm);
@@ -130,6 +135,48 @@ public class SelectableIUsPage extends ProvisioningWizardPage implements ISelect
Dialog.applyDialogFont(sashForm);
}
+ private void createSelectButtons(Composite parent) {
+ Composite buttonParent = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 3;
+ gridLayout.marginWidth = 0;
+ gridLayout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ buttonParent.setLayout(gridLayout);
+ GridData data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+ buttonParent.setLayoutData(data);
+
+ Button selectAll = new Button(buttonParent, SWT.PUSH);
+ selectAll.setText(ProvUIMessages.SelectableIUsPage_Select_All);
+ setButtonLayoutData(selectAll);
+ selectAll.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ tableViewer.setAllChecked(true);
+ setPageComplete(tableViewer.getCheckedElements().length > 0);
+ }
+ });
+
+ Button deselectAll = new Button(buttonParent, SWT.PUSH);
+ deselectAll.setText(ProvUIMessages.SelectableIUsPage_Deselect_All);
+ setButtonLayoutData(deselectAll);
+ deselectAll.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ tableViewer.setAllChecked(false);
+ setPageComplete(tableViewer.getCheckedElements().length > 0);
+ }
+ });
+
+ // dummy to take extra space
+ Label dummy = new Label(buttonParent, SWT.NONE);
+ data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ dummy.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);
+ }
+
protected CheckboxTableViewer createTableViewer(Composite parent) {
// The viewer allows selection of IU's for browsing the details,
// and checking to include in the provisioning operation.
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties
index e69449b2f..dc74fffcc 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties
@@ -239,6 +239,8 @@ QueryableMetadataRepositoryManager_MultipleRepositoriesNotFound=Some repositorie
QueryableMetadataRepositoryManager_RepositoryQueryProgress=Retrieving information from {0}
QueryableProfileRegistry_QueryProfileProgress=Getting profiles
QueryableUpdates_UpdateListProgress=Assembling list of updates
+SelectableIUsPage_Select_All=Select &All
+SelectableIUsPage_Deselect_All=&Deselect All
SizeComputingWizardPage_SizeJobTitle=Computing size
SizingPhaseSet_PhaseSetName=Compute sizes

Back to the top