1 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.IField; 11 12 import org.terracotta.dso.ConfigurationHelper; 13 import org.terracotta.dso.TcPlugin; 14 15 public class EnsureNotRootResolution extends BaseMarkerResolution { 16 public EnsureNotRootResolution(IField field) { 17 super(field); 18 } 19 20 public String getLabel() { 21 return "Ensure not a root"; 22 } 23 24 public void run(IProgressMonitor monitor) throws CoreException { 25 IField field = (IField)m_element; 26 IProject project = field.getJavaProject().getProject(); 27 ConfigurationHelper configHelper = TcPlugin.getDefault().getConfigurationHelper(project); 28 29 configHelper.ensureNotRoot(field); 30 m_marker.setAttribute(IMarker.MESSAGE, "No longer a root"); 31 inspectCompilationUnit(); 32 } 33 } 34 | Popular Tags |