Changeset 4133
- Timestamp:
- Dec 22, 2009, 8:50:54 PM (11 years ago)
- Location:
- devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpAbstractBuilder.java
r4125 r4133 18 18 19 19 public abstract class RfpAbstractBuilder extends IncrementalProjectBuilder { 20 private RfpProject rfpProject; 21 20 22 protected RfpProject getRfpProject () { 21 return RfpCore.getRfpProject(getProject()); 23 if (rfpProject == null) 24 rfpProject = RfpProject.get(getProject()); 25 return rfpProject; 22 26 } 23 27 … … 28 32 fullBuild(monitor); 29 33 else { 30 RfpProject rfpProject = getRfpProject(); 31 IResourceDelta delta = getDelta(rfpProject.getProject()); 32 if (delta == null || delta.findMember(rfpProject.getFile(".classpath").getProjectRelativePath()) != null) 34 IResourceDelta delta = getDelta(getProject()); 35 if (delta == null || delta.findMember(getProject().getFile(".classpath").getProjectRelativePath()) != null) 33 36 fullBuild(monitor); 34 37 else -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpBuilder.java
r4125 r4133 316 316 return null; 317 317 deleteMarkers(file); 318 if (Rfp Core.getRfpProject(project).getModuleName(file) == null)318 if (RfpProject.get(project).getModuleName(file) == null) 319 319 return null; 320 320 if (RfpProject.isRefFile(file)) { 321 Checker.getR5(new IdeCompilerEnvironment(Rfp Core.getRfpProject(project), file,321 Checker.getR5(new IdeCompilerEnvironment(RfpProject.get(project), file, 322 322 new StringReader(document))); 323 323 return null; 324 324 } else 325 return Checker.getModuleImplementation(new IdeCompilerEnvironment(Rfp Core.getRfpProject(project), file,325 return Checker.getModuleImplementation(new IdeCompilerEnvironment(RfpProject.get(project), file, 326 326 new StringReader(document))); 327 327 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpCore.java
r3655 r4133 1 1 package org.refal.rfpdt.core; 2 2 3 import java.util.WeakHashMap;4 3 5 import org.eclipse.core.resources.IProject;6 4 import org.eclipse.core.runtime.IStatus; 7 5 import org.eclipse.core.runtime.Plugin; … … 13 11 public class RfpCore extends Plugin { 14 12 private static RfpCore plugin = null; 15 16 private static final WeakHashMap<IProject, RfpProject> rfpProjects = new WeakHashMap<IProject, RfpProject>();17 13 18 14 private static void log (IStatus status) { … … 30 26 31 27 /** 32 * Logs a message to the plugin's error log 28 * Logs a message to the plugin's error log. 33 29 * 34 30 * @param message … … 41 37 } 42 38 43 public static void log (Throwable e) { 44 log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, "Internal error", e)); 45 } 46 47 /** May return <code>null</code> if argument is <code>null</code>. */ 48 public static RfpProject getRfpProject (IProject project) { 49 if (project == null) 50 return null; 51 RfpProject rfpProject = RfpCore.rfpProjects.get(project); 52 if (rfpProject == null) { 53 rfpProject = new RfpProject(project); 54 RfpCore.rfpProjects.put(project, rfpProject); 55 } 56 return rfpProject; 39 /** 40 * Logs a exception to the plugin's error log. 41 * 42 * @param exception 43 * Exception to be logger 44 */ 45 public static void log (Exception exception) { 46 log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, "Internal error", exception)); 57 47 } 58 48 -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpNature.java
r3642 r4133 36 36 project.setDescription(projectDesc, null); 37 37 // setup the classpath 38 IJavaProject javaProject = Rfp Core.getRfpProject(project).getJavaProject();38 IJavaProject javaProject = RfpProject.get(project).getJavaProject(); 39 39 IClasspathEntry[] entriesOld = javaProject.getRawClasspath(); 40 40 IClasspathEntry[] entriesNew = new IClasspathEntry[entriesOld.length + 2]; -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpProject.java
r4125 r4133 2 2 3 3 import java.io.ByteArrayInputStream; 4 import java.util.WeakHashMap; 4 5 5 6 import org.eclipse.core.resources.IFile; … … 22 23 23 24 public class RfpProject { 25 private static final WeakHashMap<IProject, RfpProject> rfpProjects = new WeakHashMap<IProject, RfpProject>(); 26 27 /** May return <code>null</code> if argument is <code>null</code>. */ 28 public static RfpProject get (IProject project) { 29 if (project == null) 30 return null; 31 RfpProject rfpProject = RfpProject.rfpProjects.get(project); 32 if (rfpProject == null) { 33 rfpProject = new RfpProject(project); 34 RfpProject.rfpProjects.put(project, rfpProject); 35 } 36 return rfpProject; 37 } 38 39 public static boolean isRfFile (IResource resource) { 40 return resource instanceof IFile && resource.getFileExtension() != null 41 && resource.getFileExtension().equals("rf"); 42 } 43 44 public static boolean isRfiFile (IResource resource) { 45 return resource instanceof IFile && resource.getFileExtension() != null 46 && resource.getFileExtension().equals("rfi"); 47 } 48 49 public static boolean isRefFile (IResource resource) { 50 return resource instanceof IFile && resource.getFileExtension() != null 51 && resource.getFileExtension().equals("ref"); 52 } 53 24 54 private final IProject project; 25 55 private final IJavaProject javaProject; … … 28 58 private final IScopeContext[] scopes; 29 59 30 RfpProject (IProject project) {60 private RfpProject (IProject project) { 31 61 this.project = project; 32 62 this.javaProject = JavaCore.create(project); … … 156 186 157 187 public static String staticGetModuleName (IFile file) { 158 RfpProject rfpProject = Rfp Core.getRfpProject(file.getProject());188 RfpProject rfpProject = RfpProject.get(file.getProject()); 159 189 return rfpProject == null ? null : rfpProject.getModuleName(file); 160 190 } … … 198 228 ICompilerPreferences.ADD_SOURCE, false, scopes); 199 229 } 200 201 public static boolean isRfFile (IResource resource) {202 return resource instanceof IFile && resource.getFileExtension() != null203 && resource.getFileExtension().equals("rf");204 }205 206 public static boolean isRfiFile (IResource resource) {207 return resource instanceof IFile && resource.getFileExtension() != null208 && resource.getFileExtension().equals("rfi");209 }210 211 public static boolean isRefFile (IResource resource) {212 return resource instanceof IFile && resource.getFileExtension() != null213 && resource.getFileExtension().equals("ref");214 }215 230 }
Note: See TracChangeset
for help on using the changeset viewer.