Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormzhu2011-05-10 03:18:47 +0000
committermzhu2011-05-10 03:18:47 +0000
commita1f5e6d9b79ae200e38f455a1cd8aed4ba445596 (patch)
tree19c9257e5836f241cfbb0fb3301dd61375319611 /bundles/org.eclipse.equinox.p2.ui.importexport
parent188a385d34c350e987059dd0a4d5c9223696310e (diff)
downloadrt.equinox.p2-a1f5e6d9b79ae200e38f455a1cd8aed4ba445596.tar.gz
rt.equinox.p2-a1f5e6d9b79ae200e38f455a1cd8aed4ba445596.tar.xz
rt.equinox.p2-a1f5e6d9b79ae200e38f455a1cd8aed4ba445596.zip
fix bugzilla 344496
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.importexport')
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java2
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java41
3 files changed, 42 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java
index 8b94349cb..e772ceb53 100755
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java
@@ -43,6 +43,8 @@ public class Messages extends NLS {
public static String ImportPage_InstallLatestVersion;
public static String ImportPage_QueryFeaturesJob;
public static String AbstractImportPage_SameVersionInstalled;
+ public static String AbstractPage_ButtonDeselectAll;
+ public static String AbstractPage_ButtonSelectAll;
public static String ImportPage_TITLE;
public static String ImportWizard_WINDOWTITLE;
public static String Page_BUTTON_BROWSER;
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
index 01636381b..f20db72ae 100755
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
@@ -40,6 +40,8 @@ ImportPage_IMPORT_NOTIFICATION=The installation job has been scheduled.
ImportPage_InstallLatestVersion=Install latest version of selected software.
ImportPage_QueryFeaturesJob=Query selected software...
AbstractImportPage_SameVersionInstalled={0} (Disabled due to it has been already installed)
+AbstractPage_ButtonDeselectAll=Deselect All
+AbstractPage_ButtonSelectAll=Select All
ImportPage_TITLE=Import software configuration
ImportWizard_WINDOWTITLE=Import
ImportFromInstallationPage_DESTINATION_LABEL=Specify an existing Eclipse installation
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
index 378e5a4b0..0db7e792c 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
@@ -32,8 +32,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
@@ -230,7 +229,12 @@ public abstract class AbstractPage extends WizardPage implements Listener {
}
protected void createInstallationTable(final Composite parent) {
- viewer = CheckboxTableViewer.newCheckList(parent, SWT.MULTI | SWT.BORDER);
+ Group group = new Group(parent, SWT.NONE);
+ GridData griddata = new GridData(GridData.FILL, GridData.FILL, true, true);
+ griddata.verticalSpan = griddata.horizontalSpan = 0;
+ group.setLayoutData(griddata);
+ group.setLayout(new GridLayout(1, false));
+ viewer = CheckboxTableViewer.newCheckList(group, SWT.MULTI | SWT.BORDER);
final Table table = viewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(false);
@@ -290,6 +294,37 @@ public abstract class AbstractPage extends WizardPage implements Listener {
viewer.getControl().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
viewer.getControl().setSize(300, 200);
viewer.setInput(getInput());
+ Composite buttons = new Composite(group, SWT.NONE);
+ buttons.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+ buttons.setLayout(new RowLayout(SWT.HORIZONTAL));
+ Button selectAll = new Button(buttons, SWT.PUSH);
+ selectAll.setText(Messages.AbstractPage_ButtonSelectAll);
+ selectAll.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ for (TableItem item : viewer.getTable().getItems()) {
+ if (!item.getChecked()) {
+ item.setChecked(true);
+ Event event = new Event();
+ event.widget = item.getParent();
+ event.detail = SWT.CHECK;
+ event.item = item;
+ event.type = SWT.Selection;
+ viewer.getTable().notifyListeners(SWT.Selection, event);
+ }
+ }
+ updatePageCompletion();
+ }
+ });
+ Button deselectAll = new Button(buttons, SWT.PUSH);
+ deselectAll.setText(Messages.AbstractPage_ButtonDeselectAll);
+ deselectAll.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ viewer.setAllChecked(false);
+ updatePageCompletion();
+ }
+ });
}
protected ICheckStateProvider getViewerDefaultState() {

Back to the top