KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > terracotta > dso > correction > EnsureNotLockedResolution


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package org.terracotta.dso.correction;
5
6 import org.eclipse.core.resources.IMarker;
7 import org.eclipse.core.resources.IProject;
8 import org.eclipse.core.runtime.CoreException;
9 import org.eclipse.core.runtime.IProgressMonitor;
10 import org.eclipse.jdt.core.IMethod;
11
12 import org.terracotta.dso.ConfigurationHelper;
13 import org.terracotta.dso.TcPlugin;
14
15 public class EnsureNotLockedResolution extends BaseMarkerResolution {
16   public EnsureNotLockedResolution(IMethod method) {
17     super(method);
18   }
19   
20   public String JavaDoc getLabel() {
21     return "Ensure not locked";
22   }
23
24   public void run(IProgressMonitor monitor) throws CoreException {
25     IMethod method = (IMethod)m_element;
26     IProject project = method.getJavaProject().getProject();
27     ConfigurationHelper configHelper = TcPlugin.getDefault().getConfigurationHelper(project);
28     
29     configHelper.ensureNotLocked(method);
30     m_marker.setAttribute(IMarker.MESSAGE, "No longer locked");
31     inspectCompilationUnit();
32   }
33 }
34
35
Popular Tags