Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added CDKException message text in SMARTS dialog
Fixes bug: 1197
  • Loading branch information
jonalv authored and egonw committed Jun 15, 2010
1 parent d98b748 commit de960fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Expand Up @@ -22,4 +22,6 @@ Import-Package: net.bioclipse.core.business,
net.bioclipse.core.domain,
net.bioclipse.core.domain.props,
org.apache.log4j,
org.eclipse.core.resources
org.eclipse.core.resources,
org.openscience.cdk.exception,
org.openscience.cdk.smiles.smarts
Expand Up @@ -27,6 +27,8 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.smiles.smarts.SMARTSQueryTool;


public class AddEditSmartsDialog extends TitleAreaDialog{
Expand Down Expand Up @@ -151,13 +153,16 @@ private void updateStatus(){
setErrorMessage("SMARTS string must not be empty");
return;
}

if (!(cdk.isValidSmarts( txtSmarts.getText() ))){
setErrorMessage( "SMARTS string is not valid. " );
try {
new SMARTSQueryTool( txtSmarts.getText() );
} catch (CDKException e) {
setErrorMessage( "SMARTS string is not valid: \""
+ e.getMessage() + "\"" );
}
}

getButtonBar().update();

}

private void showMessage(String message) {
Expand Down

0 comments on commit de960fe

Please sign in to comment.