Ejemplo n.º 1
0
 /**
  * Treat the file specially if it represents a metadata file, which includes: - project
  * description file (.project) - project preferences files (*.prefs)
  *
  * <p>This method is called whenever it is discovered that a file has been modified (added,
  * removed, or changed).
  */
 public void updateMetadataFiles() throws CoreException {
   int count = path.segmentCount();
   String name = path.segment(1);
   // is this a project description file?
   if (count == 2 && name.equals(IProjectDescription.DESCRIPTION_FILE_NAME)) {
     Project project = (Project) getProject();
     project.updateDescription();
     // Discard stale project natures on ProjectInfo
     ProjectInfo projectInfo = (ProjectInfo) project.getResourceInfo(false, true);
     projectInfo.discardNatures();
     return;
   }
   // check to see if we are in the .settings directory
   if (count == 3 && EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME.equals(name)) {
     ProjectPreferences.updatePreferences(this);
     return;
   }
 }