Navigation Menu

Skip to content

Commit

Permalink
Added check for cml file in the generate 3d handler
Browse files Browse the repository at this point in the history
solves bug 3218
  • Loading branch information
goglepox committed Jun 12, 2012
1 parent 02dae77 commit 669e2f3
Showing 1 changed file with 22 additions and 0 deletions.
Expand Up @@ -29,7 +29,10 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
Expand Down Expand Up @@ -85,8 +88,27 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
final List<String> final_fnames = null;
final List<IResource> final_foldersToRefresh = foldersToRefresh;

IContentType cmlType = Platform
.getContentTypeManager()
.getContentType( "net.bioclipse.contenttypes.cml.singleMolecule2d" );

IBalloonManager balloon = Activator.getDefault().getJavaBalloonManager();
for ( IFile input : inputFiles ) {
try {
IContentDescription contentDescirpton = input
.getContentDescription();
if ( contentDescirpton != null && contentDescirpton
.getContentType().isKindOf( cmlType ) ) {
balloon.generate3Dcoordinates( input.getRawLocation()
.toOSString() );
return null;
}
} catch ( Exception e ) {
LogUtils.handleException( e, logger,
"net.bioclipse.balloon.business" );
return null;
}

balloon.generate3Dcoordinates( input, new BioclipseUIJob<IFile>() {

@Override
Expand Down

0 comments on commit 669e2f3

Please sign in to comment.