Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2013-01-24 16:43:01 +0000
committerPascal Rapicault2013-01-24 16:43:01 +0000
commitf04f46d6d283a6235367872b5eaa7e3e483509ed (patch)
treee765fca147cdcd1234030c9c5be8e0441bf0f46b /bundles
parent5243d497142b0f2631bcda8b5fed67d7ce0ddbd5 (diff)
parentc32f1112f9b3d28bd3208ddb11c54ef2010b5eac (diff)
downloadrt.equinox.p2-f04f46d6d283a6235367872b5eaa7e3e483509ed.tar.gz
rt.equinox.p2-f04f46d6d283a6235367872b5eaa7e3e483509ed.tar.xz
rt.equinox.p2-f04f46d6d283a6235367872b5eaa7e3e483509ed.zip
Merge branch 'master' into prapicau/sharedInstall-part1
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java52
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java1
3 files changed, 53 insertions, 6 deletions
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 9c60a00aa..787afb824 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
@@ -59,6 +59,7 @@ public abstract class AbstractPage extends WizardPage implements Listener {
protected P2ImportExport importexportService = null;
protected CheckboxTreeViewer viewer = null;
protected Exception finishException;
+ protected boolean entryChanged = false;
protected static IProfileRegistry profileRegistry = null;
static IProvisioningAgent agent = null;
@@ -306,13 +307,53 @@ public abstract class AbstractPage extends WizardPage implements Listener {
restoreWidgetValues();
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
destinationNameField.setLayoutData(data);
- destinationNameField.addListener(SWT.FocusOut, this);
- destinationNameField.addListener(SWT.FocusIn, new Listener() {
+ destinationNameField.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleDestinationChanged(getDestinationValue());
+ }
+ });
+ destinationNameField.addKeyListener(new KeyListener() {
+
+ /*
+ * @see KeyListener.keyPressed
+ */
+ public void keyPressed(KeyEvent e) {
+ if (e.character == SWT.CR) {
+ entryChanged = false;
+ handleDestinationChanged(getDestinationValue());
+ }
+ }
- public void handleEvent(Event event) {
- destinationNameField.clearSelection();
+ public void keyReleased(KeyEvent e) {
+ // do nothing
+ }
+ });
+ destinationNameField.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ entryChanged = true;
}
});
+ destinationNameField.addFocusListener(new FocusListener() {
+ /*
+ * @see FocusListener.focusGained(FocusEvent)
+ */
+ public void focusGained(FocusEvent e) {
+ //Do nothing when getting focus
+ }
+
+ /*
+ * @see FocusListener.focusLost(FocusEvent)
+ */
+ public void focusLost(FocusEvent e) {
+ //Clear the flag to prevent constant update
+ if (entryChanged) {
+ entryChanged = false;
+ handleDestinationChanged(getDestinationValue());
+ }
+
+ }
+ });
+
destinationBrowseButton = new Button(composite, SWT.PUSH);
destinationBrowseButton.setText(Messages.Page_BUTTON_BROWSER);
destinationBrowseButton.addListener(SWT.Selection, this);
@@ -588,8 +629,7 @@ public abstract class AbstractPage extends WizardPage implements Listener {
if (source == destinationBrowseButton) {
handleDestinationBrowseButtonPressed();
- } else
- handleDestinationChanged(getDestinationValue());
+ }
updatePageCompletion();
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java
index 7f08a673b..661f2b52f 100755
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java
@@ -36,6 +36,7 @@ public class ExportPage extends AbstractPage {
label.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
if (getSelfProfile() == null) {
label.setText(Messages.ExportPage_ERROR_CONFIG);
+ setPageComplete(false);
} else {
label.setText(Messages.ExportPage_Label);
@@ -147,4 +148,9 @@ public class ExportPage extends AbstractPage {
protected int getBrowseDialogStyle() {
return SWT.SAVE;
}
+
+ @Override
+ protected void handleDestinationChanged(String newDestination) {
+ updatePageCompletion();
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
index ad546c086..5796aafa4 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
@@ -296,6 +296,7 @@ public class ImportPage extends AbstractImportPage implements ISelectableIUsPage
}
} else
viewer.setInput(null);
+ updatePageCompletion();
}
private boolean hasEntriesWithoutRepo() {

Back to the top