Skip to content

Commit

Permalink
Merge pull request #99 from Teiid-Designer/teiiddes-1364
Browse files Browse the repository at this point in the history
teiiddes-1364
  • Loading branch information
blafond committed Feb 8, 2013
2 parents b1e02ab + aade73a commit ca1e13c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ ImportWsdlValidationPage.objectHeader=wsdl file
ImportWsdlValidationPage.lineNumber=line number
ImportWsdlValidationPage.title=Validation Problems
ImportWsdlValidationPage.One_or_more_selected_WSDL_files_have_errors=One or more selected WSDL files have errors. Please correct or remove the file(s)to proceed.
ImportWsdlValidationPage.One_or_more_selected_WSDL_files_have_warnings=One or more selected WSDL files have warnings. Proceeding with warnings may cause issues with model generation.


#=================================================================================================================================
# SelectWsdlOperationsPage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class ImportWsdlValidationPage extends AbstractWizardPage
*/
List wsdlValidationMessages;

private boolean wsdlsHaveErrors = true;
private boolean wsdlsHaveErrors = false;

/**
* Constructs a <code>WsdlValidationPage</code> using the specified builder.
Expand Down Expand Up @@ -143,8 +143,10 @@ public void createControl( Composite theParent ) {
*/
@Override
public boolean canFlipToNextPage() {
// if no WSDLs identified don't let the next page show
return !wsdlsHaveErrors && super.canFlipToNextPage();
// if no WSDLs identified don't let the next page show. Only prevent navigation if an error
// exist.

return !wsdlsHaveErrors && super.canFlipToNextPage();
}

/**
Expand Down Expand Up @@ -458,6 +460,27 @@ public void setVisible( boolean theShowFlag ) {
public boolean hasValidationMessages() {
return wsdlValidationMessages.size() > 0;
}

/**
* Check to see if there are any validation error (not just warning) messages for display.
*
* @return boolean
* @since 8.1
*/
public boolean hasValidationErrors() {
wsdlsHaveErrors = false;
Iterator messageIter = wsdlValidationMessages.listIterator();
while (messageIter.hasNext()){
IValidationMessage message = (IValidationMessage)messageIter.next();
if (message.getSeverity() == IValidationMessage.SEV_ERROR){
wsdlsHaveErrors = true;
}
}

return wsdlsHaveErrors;
}



/**
* Setter for wsdl validation messages related to currently selected wsdl files.
Expand Down Expand Up @@ -504,12 +527,13 @@ public void clearValidationMessages() {
*/
private void validatePage() {
/*
* Check to see if any WSDLs have any validation messages.
* Check to see if any WSDLs have any validation errors and/or warnings.
*/
if (hasValidationMessages()) {
if (hasValidationErrors()) {
WizardUtil.setPageComplete(this, getString("One_or_more_selected_WSDL_files_have_errors"), IMessageProvider.ERROR); //$NON-NLS-1$
}else if(hasValidationMessages()){
WizardUtil.setPageComplete(this, getString("One_or_more_selected_WSDL_files_have_warnings"), IMessageProvider.WARNING); //$NON-NLS-1$
}

}

Image getStatusImage( final int severity ) {
Expand Down

0 comments on commit ca1e13c

Please sign in to comment.