01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.correction;
05:
06: import org.eclipse.core.resources.IMarker;
07: import org.eclipse.core.resources.IProject;
08: import org.eclipse.core.runtime.CoreException;
09: 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 EnsureNotTransientResolution extends BaseMarkerResolution {
16: public EnsureNotTransientResolution(IField field) {
17: super (field);
18: }
19:
20: public String getLabel() {
21: return "Ensure not a transient";
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()
28: .getConfigurationHelper(project);
29:
30: configHelper.ensureNotTransient(field);
31: m_marker.setAttribute(IMarker.MESSAGE, "No longer a transient");
32: inspectCompilationUnit();
33: }
34: }
|