Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Sanchez2013-03-25 12:48:09 -0400
committerFred Bricon2013-05-03 11:35:06 -0400
commitf71c812a697b945f3a0259e49c32fd11b369ca16 (patch)
tree7c141a2a84225cc463710659591561b24514f945
parenta7eaa67cdfdda51ad85795c4779a010ecf13a19b (diff)
downloadm2e-core-f71c812a697b945f3a0259e49c32fd11b369ca16.tar.gz
m2e-core-f71c812a697b945f3a0259e49c32fd11b369ca16.tar.xz
m2e-core-f71c812a697b945f3a0259e49c32fd11b369ca16.zip
404178 : Validation messages from MavenProjectWizardArchetypeParametersPage shown before the page is shown
- I wrote 100% of the code; - I have the right to contribute the code to Eclipse; - The file header contains the appropriate License header
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java35
1 files changed, 27 insertions, 8 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
index a638a9df..48623097 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2013 Sonatype, Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,6 +70,8 @@ import org.eclipse.m2e.core.ui.internal.components.TextComboBoxCellEditor;
* a project (thus the class name pun).
*/
public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWizardPage {
+ private boolean _isVisible;
+
private static final Logger log = LoggerFactory.getLogger(MavenProjectWizardArchetypeParametersPage.class);
public static final String DEFAULT_VERSION = "0.0.1-SNAPSHOT"; //$NON-NLS-1$
@@ -304,9 +306,11 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
* @see org.eclipse.jface.wizard.WizardPage#setPageComplete(boolean)
*/
void validate() {
- String error = validateInput();
- setErrorMessage(error);
- setPageComplete(error == null);
+ if(isVisibleInternal()) {
+ String error = validateInput();
+ setErrorMessage(error);
+ setPageComplete(error == null);
+ }
}
private String validateInput() {
@@ -538,19 +542,26 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
/** Loads the group value when the page is displayed. */
public void setVisible(boolean visible) {
super.setVisible(visible);
+ setVisibleInternal(visible);
+
+ boolean shouldValidate = false;
if(visible) {
+
+ if(archetypeChanged && archetype != null) {
+ archetypeChanged = false;
+ loadArchetypeDescriptor();
+ shouldValidate = true;
+ }
+
if(groupIdCombo.getText().length() == 0 && groupIdCombo.getItemCount() > 0) {
groupIdCombo.setText(groupIdCombo.getItem(0));
packageCombo.setText(getDefaultJavaPackage());
packageCustomized = false;
}
- if(archetypeChanged && archetype != null) {
- archetypeChanged = false;
- loadArchetypeDescriptor();
+ if(shouldValidate)
validate();
- }
updatePropertyEditors();
}
@@ -642,4 +653,12 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
return pkg.toString();
}
+
+ private boolean isVisibleInternal() {
+ return _isVisible;
+ }
+
+ private void setVisibleInternal(boolean visible) {
+ _isVisible = visible;
+ }
}

Back to the top