1 19 20 package org.netbeans.modules.java.freeform; 21 22 import java.beans.PropertyChangeEvent ; 23 import java.beans.PropertyChangeListener ; 24 import java.beans.PropertyChangeSupport ; 25 import java.io.File ; 26 import java.net.MalformedURLException ; 27 import java.net.URI ; 28 import java.net.URL ; 29 import java.util.ArrayList ; 30 import java.util.Arrays ; 31 import java.util.Collections ; 32 import java.util.HashMap ; 33 import java.util.HashSet ; 34 import java.util.Iterator ; 35 import java.util.LinkedHashMap ; 36 import java.util.List ; 37 import java.util.Map ; 38 import java.util.Set ; 39 import java.util.WeakHashMap ; 40 import java.util.concurrent.CountDownLatch ; 41 import java.util.concurrent.TimeUnit ; 42 import org.netbeans.api.java.classpath.ClassPath; 43 import org.netbeans.api.java.classpath.GlobalPathRegistry; 44 import org.netbeans.api.java.platform.JavaPlatform; 45 import org.netbeans.api.java.platform.JavaPlatformManager; 46 import org.netbeans.api.java.platform.Specification; 47 import org.netbeans.api.java.project.JavaProjectConstants; 48 import org.netbeans.api.project.ProjectManager; 49 import org.netbeans.modules.ant.freeform.spi.support.Util; 50 import org.netbeans.modules.java.freeform.jdkselection.JdkConfiguration; 51 import org.netbeans.spi.java.classpath.ClassPathFactory; 52 import org.netbeans.spi.java.classpath.ClassPathImplementation; 53 import org.netbeans.spi.java.classpath.ClassPathProvider; 54 import org.netbeans.spi.java.classpath.FilteringPathResourceImplementation; 55 import org.netbeans.spi.java.classpath.PathResourceImplementation; 56 import org.netbeans.spi.java.classpath.support.ClassPathSupport; 57 import org.netbeans.spi.project.AuxiliaryConfiguration; 58 import org.netbeans.spi.project.support.ant.AntProjectEvent; 59 import org.netbeans.spi.project.support.ant.AntProjectHelper; 60 import org.netbeans.spi.project.support.ant.AntProjectListener; 61 import org.netbeans.spi.project.support.ant.PathMatcher; 62 import org.netbeans.spi.project.support.ant.PropertyEvaluator; 63 import org.netbeans.spi.project.support.ant.PropertyUtils; 64 import org.openide.ErrorManager; 65 import org.openide.filesystems.FileObject; 66 import org.openide.filesystems.FileUtil; 67 import org.openide.modules.SpecificationVersion; 68 import org.openide.util.Mutex; 69 import org.openide.util.Utilities; 70 import org.openide.util.WeakListeners; 71 import org.w3c.dom.Element ; 72 73 95 final class Classpaths implements ClassPathProvider, AntProjectListener, PropertyChangeListener { 96 97 private static final ErrorManager err = ErrorManager.getDefault().getInstance(Classpaths.class.getName()); 98 99 static CountDownLatch TESTING_LATCH = null; 101 102 private AntProjectHelper helper; 103 private PropertyEvaluator evaluator; 104 private AuxiliaryConfiguration aux; 105 106 109 private final Map <String ,Map <FileObject,ClassPath>> classpaths = new HashMap <String ,Map <FileObject,ClassPath>>(); 110 111 114 private final Map <String ,Map <List <String >,MutableClassPathImplementation>> mutablePathImpls = new HashMap <String ,Map <List <String >,MutableClassPathImplementation>>(); 115 116 private final Map <MutableClassPathImplementation,ClassPath> mutableClassPathImpl2ClassPath = new HashMap <MutableClassPathImplementation,ClassPath>(); 117 118 121 private Map <String ,Set <ClassPath>> registeredClasspaths = null; 122 123 public Classpaths(AntProjectHelper helper, PropertyEvaluator evaluator, AuxiliaryConfiguration aux) { 124 this.helper = helper; 125 this.evaluator = evaluator; 126 this.aux = aux; 127 helper.addAntProjectListener(this); 128 evaluator.addPropertyChangeListener(this); 129 } 130 131 public ClassPath findClassPath(final FileObject file, final String type) { 132 return ProjectManager.mutex().readAccess(new Mutex.Action<ClassPath>() { 135 public ClassPath run() { 136 return findClassPathImpl(file, type); 137 } 138 }); 139 } 140 141 private synchronized ClassPath findClassPathImpl(FileObject file, String type) { 142 if (TESTING_LATCH != null) { 143 TESTING_LATCH.countDown(); 145 try { 146 TESTING_LATCH.await(2, TimeUnit.SECONDS); 147 } catch (InterruptedException e) { 148 ErrorManager.getDefault().notify(e); 149 } 150 151 classpaths.clear(); 152 } 153 154 Map <FileObject,ClassPath> classpathsByType = classpaths.get(type); 155 if (classpathsByType == null) { 156 classpathsByType = new WeakHashMap <FileObject,ClassPath>(); 157 classpaths.put(type, classpathsByType); 158 } 159 Iterator it = classpathsByType.entrySet().iterator(); 161 while (it.hasNext()) { 162 Map.Entry entry = (Map.Entry )it.next(); 163 FileObject root = (FileObject)entry.getKey(); 164 if (root == file || FileUtil.isParentOf(root, file)) { 165 return (ClassPath)entry.getValue(); 167 } 168 } 169 Element java = aux.getConfigurationFragment(JavaProjectNature.EL_JAVA, JavaProjectNature.NS_JAVA_2, true); 171 if (java == null) { 172 return null; 173 } 174 List <Element > compilationUnits = Util.findSubElements(java); 175 it = compilationUnits.iterator(); 176 while (it.hasNext()) { 177 Element compilationUnitEl = (Element )it.next(); 178 assert compilationUnitEl.getLocalName().equals("compilation-unit") : compilationUnitEl; 179 List <FileObject> packageRoots = findPackageRoots(helper, evaluator, compilationUnitEl); 180 Iterator it2 = packageRoots.iterator(); 181 while (it2.hasNext()) { 182 FileObject root = (FileObject)it2.next(); 183 if (root == file || FileUtil.isParentOf(root, file)) { 184 ClassPath cp = getPath(compilationUnitEl, packageRoots, type); 186 it2 = packageRoots.iterator(); 187 while (it2.hasNext()) { 188 FileObject root2 = (FileObject)it2.next(); 189 classpathsByType.put(root2, cp); 190 } 191 return cp; 192 } 193 } 194 } 195 return null; 196 } 197 198 199 private static final String [] TYPES = { 200 ClassPath.SOURCE, 201 ClassPath.BOOT, 202 ClassPath.EXECUTE, 203 ClassPath.COMPILE, 204 }; 205 206 211 public void opened() { 212 ProjectManager.mutex().readAccess(new Mutex.Action<Void >() { 214 public Void run() { 215 openedImpl(); 216 return null; 217 } 218 }); 219 } 220 221 private synchronized void openedImpl() { 222 if (registeredClasspaths != null) { 223 return; 224 } 225 Map <String ,Set <ClassPath>> _registeredClasspaths = new HashMap <String ,Set <ClassPath>>(); 226 for (String type : TYPES) { 227 _registeredClasspaths.put(type, new HashSet <ClassPath>()); 228 } 229 Element java = aux.getConfigurationFragment(JavaProjectNature.EL_JAVA, JavaProjectNature.NS_JAVA_2, true); 230 if (java == null) { 231 return; 232 } 233 for (Element compilationUnitEl : Util.findSubElements(java)) { 234 assert compilationUnitEl.getLocalName().equals("compilation-unit") : compilationUnitEl; 235 List <FileObject> packageRoots = findPackageRoots(helper, evaluator, compilationUnitEl); 237 for (String type : TYPES) { 238 Map <FileObject,ClassPath> classpathsByType = classpaths.get(type); 240 if (classpathsByType == null) { 241 classpathsByType = new WeakHashMap <FileObject,ClassPath>(); 242 classpaths.put(type, classpathsByType); 243 } 244 Set <ClassPath> registeredClasspathsOfType = _registeredClasspaths.get(type); 245 assert registeredClasspathsOfType != null; 246 ClassPath cp = null; 248 for (FileObject root : packageRoots) { 249 cp = classpathsByType.get(root); 250 if (cp != null) { 251 break; 252 } 253 } 254 if (cp == null) { 255 cp = getPath(compilationUnitEl, packageRoots, type); 257 for (FileObject root : packageRoots) { 258 classpathsByType.put(root, cp); 259 } 260 } 261 assert cp != null; 262 registeredClasspathsOfType.add(cp); 263 } 264 } 265 if (err.isLoggable(ErrorManager.INFORMATIONAL)) { 266 err.log("classpaths for " + helper.getProjectDirectory() + ": " + classpaths); 267 } 268 this.registeredClasspaths = _registeredClasspaths; 270 GlobalPathRegistry gpr = GlobalPathRegistry.getDefault(); 272 for (String type : TYPES) { 273 Set <ClassPath> registeredClasspathsOfType = registeredClasspaths.get(type); 274 gpr.register(type, registeredClasspathsOfType.toArray(new ClassPath[registeredClasspathsOfType.size()])); 275 } 276 } 277 278 private synchronized void registerNewClasspath(String type, ClassPath cp) { 279 if (registeredClasspaths == null) { 280 return; 281 } 282 Set <ClassPath> s = registeredClasspaths.get(type); 283 s.add(cp); 284 GlobalPathRegistry.getDefault().register(type, new ClassPath[] {cp}); 285 } 286 287 291 public synchronized void closed() { 292 if (registeredClasspaths == null) { 293 return; 294 } 295 GlobalPathRegistry gpr = GlobalPathRegistry.getDefault(); 296 for (int i = 0; i < TYPES.length; i++) { 297 String type = TYPES[i]; 298 Set <ClassPath> registeredClasspathsOfType = registeredClasspaths.get(type); 299 gpr.unregister(type, registeredClasspathsOfType.toArray(new ClassPath[registeredClasspathsOfType.size()])); 300 } 301 registeredClasspaths = null; 302 } 303 304 static List <String > findPackageRootNames(Element compilationUnitEl) { 305 List <String > names = new ArrayList <String >(); 306 Iterator it = Util.findSubElements(compilationUnitEl).iterator(); 307 while (it.hasNext()) { 308 Element e = (Element ) it.next(); 309 if (!e.getLocalName().equals("package-root")) { continue; 311 } 312 String location = Util.findText(e); 313 names.add(location); 314 } 315 return names; 316 } 317 318 static Map <String ,FileObject> findPackageRootsByName(AntProjectHelper helper, PropertyEvaluator evaluator, List <String > packageRootNames) { 319 Map <String ,FileObject> roots = new LinkedHashMap <String ,FileObject>(); 320 Iterator it = packageRootNames.iterator(); 321 while (it.hasNext()) { 322 String location = (String ) it.next(); 323 String locationEval = evaluator.evaluate(location); 324 if (locationEval != null) { 325 File locationFile = helper.resolveFile(locationEval); 326 FileObject locationFileObject = FileUtil.toFileObject(locationFile); 327 if (locationFileObject != null) { 328 if (FileUtil.isArchiveFile(locationFileObject)) { 329 locationFileObject = FileUtil.getArchiveRoot(locationFileObject); 330 } 331 roots.put(location, locationFileObject); 332 } 333 } 334 } 335 return roots; 336 } 337 338 private static List <FileObject> findPackageRoots(AntProjectHelper helper, PropertyEvaluator evaluator, List <String > packageRootNames) { 339 return new ArrayList <FileObject>(findPackageRootsByName(helper, evaluator, packageRootNames).values()); 340 } 341 342 public static List <FileObject> findPackageRoots(AntProjectHelper helper, PropertyEvaluator evaluator, Element compilationUnitEl) { 343 return findPackageRoots(helper, evaluator, findPackageRootNames(compilationUnitEl)); 344 } 345 346 private ClassPath getPath(Element compilationUnitEl, List <FileObject> packageRoots, String type) { 347 if (type.equals(ClassPath.SOURCE) || type.equals(ClassPath.COMPILE) || 348 type.equals(ClassPath.EXECUTE) || type.equals(ClassPath.BOOT)) { 349 List <String > packageRootNames = findPackageRootNames(compilationUnitEl); 350 Map <List <String >,MutableClassPathImplementation> mutablePathImplsByType = mutablePathImpls.get(type); 351 if (mutablePathImplsByType == null) { 352 mutablePathImplsByType = new HashMap <List <String >,MutableClassPathImplementation>(); 353 mutablePathImpls.put(type, mutablePathImplsByType); 354 } 355 MutableClassPathImplementation impl = mutablePathImplsByType.get(packageRootNames); 356 if (impl == null) { 357 impl = new MutableClassPathImplementation(packageRootNames, type, compilationUnitEl); 359 mutablePathImplsByType.put(packageRootNames, impl); 360 } 361 ClassPath cp = mutableClassPathImpl2ClassPath.get(impl); 362 if (cp == null) { 363 cp = ClassPathFactory.createClassPath(impl); 364 mutableClassPathImpl2ClassPath.put(impl, cp); 365 registerNewClasspath(type, cp); 366 } 367 return cp; 368 } else { 369 return null; 371 } 372 } 373 374 private List <URL > createSourcePath(List <String > packageRootNames) { 375 List <URL > roots = new ArrayList <URL >(packageRootNames.size()); 376 for (String location : packageRootNames) { 377 String locationEval = evaluator.evaluate(location); 378 if (locationEval != null) { 379 roots.add(createClasspathEntry(locationEval)); 380 } 381 } 382 return roots; 383 } 384 385 private List <URL > createCompileClasspath(Element compilationUnitEl) { 386 for (Element e : Util.findSubElements(compilationUnitEl)) { 387 if (e.getLocalName().equals("classpath") && e.getAttribute("mode").equals("compile")) { return createClasspath(e); 389 } 390 } 391 return Collections.emptyList(); 393 } 394 395 398 private List <URL > createClasspath(Element classpathEl) { 399 String cp = Util.findText(classpathEl); 400 if (cp == null) { 401 cp = ""; 402 } 403 String cpEval = evaluator.evaluate(cp); 404 if (cpEval == null) { 405 return Collections.emptyList(); 406 } 407 String [] path = PropertyUtils.tokenizePath(cpEval); 408 URL [] pathURL = new URL [path.length]; 409 for (int i = 0; i < path.length; i++) { 410 pathURL[i] = createClasspathEntry(path[i]); 411 } 412 return Arrays.asList(pathURL); 413 } 414 415 private URL createClasspathEntry(String text) { 416 File entryFile = helper.resolveFile(text); 417 URL entry; 418 try { 419 entry = entryFile.toURI().toURL(); 420 } catch (MalformedURLException x) { 421 throw new AssertionError (x); 422 } 423 if (FileUtil.isArchiveFile(entry)) { 424 return FileUtil.getArchiveRoot(entry); 425 } else { 426 String entryS = entry.toExternalForm(); 427 if (!entryS.endsWith("/")) { try { 430 return new URL (entryS + '/'); 431 } catch (MalformedURLException x) { 432 throw new AssertionError (x); 433 } 434 } else { 435 return entry; 436 } 437 } 438 } 439 440 private List <URL > createExecuteClasspath(List <String > packageRoots, Element compilationUnitEl) { 441 for (Element e : Util.findSubElements(compilationUnitEl)) { 442 if (e.getLocalName().equals("classpath") && e.getAttribute("mode").equals("execute")) { return createClasspath(e); 444 } 445 } 446 List <URL > urls = new ArrayList <URL >(); 449 urls.addAll(createCompileClasspath(compilationUnitEl)); 450 boolean foundBuiltTos = false; 451 for (Element builtTo : Util.findSubElements(compilationUnitEl)) { 452 if (!builtTo.getLocalName().equals("built-to")) { continue; 454 } 455 foundBuiltTos = true; 456 String rawtext = Util.findText(builtTo); 457 assert rawtext != null : "Must have nonempty text inside <built-to>"; 458 String text = evaluator.evaluate(rawtext); 459 if (text == null) { 460 continue; 461 } 462 urls.add(createClasspathEntry(text)); 463 } 464 if (!foundBuiltTos) { 465 urls.addAll(createSourcePath(packageRoots)); 466 } 467 return urls; 468 } 469 470 private List <URL > createBootClasspath(Element compilationUnitEl) { 471 for (Element e : Util.findSubElements(compilationUnitEl)) { 472 if (e.getLocalName().equals("classpath") && e.getAttribute("mode").equals("boot")) { return createClasspath(e); 474 } 475 } 476 JavaPlatform platform = new JdkConfiguration(null, helper, evaluator).getSelectedPlatform(); 479 if (platform == null) { 480 JavaPlatformManager jpm = JavaPlatformManager.getDefault(); 482 platform = jpm.getDefaultPlatform(); for (Element e : Util.findSubElements(compilationUnitEl)) { 484 if (e.getLocalName().equals("source-level")) { String level = Util.findText(e); 486 Specification spec = new Specification("j2se", new SpecificationVersion(level)); JavaPlatform[] matchingPlatforms = jpm.getPlatforms(null, spec); 488 if (matchingPlatforms.length > 0) { 489 platform = matchingPlatforms[0]; 491 for (JavaPlatform matchingPlatform : matchingPlatforms) { 492 if (!matchingPlatform.getJavadocFolders().isEmpty()) { 493 platform = matchingPlatform; 494 break; 495 } 496 } 497 for (JavaPlatform matchingPlatform : matchingPlatforms) { 498 if (matchingPlatform.getSourceFolders().getRoots().length > 0) { 499 platform = matchingPlatform; 500 break; 501 } 502 } 503 } 504 break; 505 } 506 } 507 } 508 if (platform != null) { 509 List <ClassPath.Entry> entries = platform.getBootstrapLibraries().entries(); 512 List <URL > urls = new ArrayList <URL >(entries.size()); 513 for (ClassPath.Entry entry : entries) { 514 urls.add(entry.getURL()); 515 } 516 return urls; 517 } else { 518 assert false : "JavaPlatformManager has no default platform"; 519 return Collections.emptyList(); 520 } 521 } 522 523 public void configurationXmlChanged(AntProjectEvent ev) { 524 pathsChanged(); 525 } 526 527 public void propertiesChanged(AntProjectEvent ev) { 528 pathsChanged(); } 530 531 public void propertyChange(PropertyChangeEvent evt) { 532 pathsChanged(); 533 } 534 535 private void pathsChanged() { 536 synchronized (this) { 537 classpaths.clear(); 538 } 539 for (Map <List <String >,MutableClassPathImplementation> m : mutablePathImpls.values()) { 541 for (MutableClassPathImplementation impl : m.values()) { 542 impl.change(); 543 } 544 } 545 } 546 547 551 private final class MutableClassPathImplementation implements ClassPathImplementation { 552 553 private final List <String > packageRootNames; 554 private final String type; 555 private final PropertyChangeSupport pcs = new PropertyChangeSupport (this); 556 private List <URL > roots; private List <PathResourceImplementation> resources; 558 559 public MutableClassPathImplementation(List <String > packageRootNames, String type, Element initialCompilationUnit) { 560 this.packageRootNames = packageRootNames; 561 this.type = type; 562 initRoots(initialCompilationUnit); 563 } 564 565 private Element findCompilationUnit() { 566 Element java = aux.getConfigurationFragment(JavaProjectNature.EL_JAVA, JavaProjectNature.NS_JAVA_2, true); 567 if (java == null) { 568 return null; 569 } 570 List <Element > compilationUnits = Util.findSubElements(java); 571 Iterator it = compilationUnits.iterator(); 572 while (it.hasNext()) { 573 Element compilationUnitEl = (Element )it.next(); 574 assert compilationUnitEl.getLocalName().equals("compilation-unit") : compilationUnitEl; 575 if (packageRootNames.equals(findPackageRootNames(compilationUnitEl))) { 576 return compilationUnitEl; 578 } 579 } 580 return null; 582 } 583 584 587 private boolean initRoots(Element compilationUnitEl) { 588 List <URL > oldRoots = roots; 589 if (compilationUnitEl != null) { 590 if (type.equals(ClassPath.SOURCE)) { 591 roots = createSourcePath(packageRootNames); 592 } else if (type.equals(ClassPath.COMPILE)) { 593 roots = createCompileClasspath(compilationUnitEl); 594 } else if (type.equals(ClassPath.EXECUTE)) { 595 roots = createExecuteClasspath(packageRootNames, compilationUnitEl); 596 } else { 597 assert type.equals(ClassPath.BOOT) : type; 598 roots = createBootClasspath(compilationUnitEl); 599 } 600 } else { 601 roots = Collections.emptyList(); 603 } 604 assert roots != null; 605 if (!roots.equals(oldRoots)) { 606 resources = new ArrayList <PathResourceImplementation>(roots.size()); 607 for (URL root : roots) { 608 assert root.toExternalForm().endsWith("/") : "Had bogus roots " + roots + " for type " + type + " in " + helper.getProjectDirectory(); 609 PathResourceImplementation pri; 610 if (type.equals(ClassPath.SOURCE)) { 611 pri = new SourcePRI(root); 612 } else { 613 pri = ClassPathSupport.createResource(root); 614 } 615 resources.add(pri); 616 } 617 return true; 618 } else { 619 return false; 620 } 621 } 622 623 public List <PathResourceImplementation> getResources() { 624 return resources; 625 } 626 627 630 public void change() { 631 if (initRoots(findCompilationUnit())) { 632 if (err.isLoggable(ErrorManager.INFORMATIONAL)) { 633 err.log("MutableClassPathImplementation.change: packageRootNames=" + packageRootNames + " type=" + type + " roots=" + roots); 634 } 635 pcs.firePropertyChange(ClassPathImplementation.PROP_RESOURCES, null, null); 636 } 637 } 638 639 public void addPropertyChangeListener(PropertyChangeListener listener) { 640 pcs.addPropertyChangeListener(listener); 641 } 642 643 public void removePropertyChangeListener(PropertyChangeListener listener) { 644 pcs.removePropertyChangeListener(listener); 645 } 646 647 } 648 649 private final class SourcePRI implements FilteringPathResourceImplementation, PropertyChangeListener , AntProjectListener { 650 private final URL root; 651 private final PropertyChangeSupport pcs = new PropertyChangeSupport (this); 652 private PathMatcher matcher; 653 private String includes, excludes; 654 public SourcePRI(URL root) { 655 this.root = root; 656 helper.addAntProjectListener(WeakListeners.create(AntProjectListener.class, this, helper)); 657 evaluator.addPropertyChangeListener(WeakListeners.propertyChange(this, evaluator)); 658 computeMatcher(); 659 } 660 private boolean computeMatcher() { 661 String includes = null; 662 String excludes = null; 663 File rootFolder = new File (URI.create(root.toExternalForm())); 666 Element genldata = Util.getPrimaryConfigurationData(helper); 667 Element foldersE = Util.findElement(genldata, "folders", Util.NAMESPACE); if (foldersE != null) { 669 for (Element folderE : Util.findSubElements(foldersE)) { 670 if (folderE.getLocalName().equals("source-folder")) { 671 Element typeE = Util.findElement(folderE, "type", Util.NAMESPACE); if (typeE != null) { 673 String type = Util.findText(typeE); 674 if (type.equals(JavaProjectConstants.SOURCES_TYPE_JAVA)) { 675 Element locationE = Util.findElement(folderE, "location", Util.NAMESPACE); String location = evaluator.evaluate(Util.findText(locationE)); 677 if (location != null && helper.resolveFile(location).equals(rootFolder)) { 678 Element includesE = Util.findElement(folderE, "includes", Util.NAMESPACE); if (includesE != null) { 680 includes = evaluator.evaluate(Util.findText(includesE)); 681 if (includes != null && includes.matches("\\$\\{[^}]+\\}")) { includes = null; 684 } 685 } 686 Element excludesE = Util.findElement(folderE, "excludes", Util.NAMESPACE); if (excludesE != null) { 688 excludes = evaluator.evaluate(Util.findText(excludesE)); 689 } 690 } 691 } 692 } 693 } 694 } 695 } 696 if (!Utilities.compareObjects(includes, this.includes) || !Utilities.compareObjects(excludes, this.excludes)) { 697 this.includes = includes; 698 this.excludes = excludes; 699 matcher = new PathMatcher(includes, excludes, rootFolder); 700 return true; 701 } else { 702 if (matcher == null) { 703 matcher = new PathMatcher(includes, excludes, rootFolder); 704 } 705 return false; 706 } 707 } 708 public URL [] getRoots() { 709 return new URL [] {root}; 710 } 711 public boolean includes(URL root, String resource) { 712 return matcher.matches(resource, true); 713 } 714 public void addPropertyChangeListener(PropertyChangeListener listener) { 715 pcs.addPropertyChangeListener(listener); 716 } 717 public void removePropertyChangeListener(PropertyChangeListener listener) { 718 pcs.removePropertyChangeListener(listener); 719 } 720 public ClassPathImplementation getContent() { 721 return null; 722 } 723 public void propertyChange(PropertyChangeEvent ev) { 724 change(ev); 725 } 726 public void configurationXmlChanged(AntProjectEvent ev) { 727 change(ev); 728 } 729 public void propertiesChanged(AntProjectEvent ev) {} 730 private void change(Object propid) { 731 if (computeMatcher()) { 732 PropertyChangeEvent ev = new PropertyChangeEvent (this, FilteringPathResourceImplementation.PROP_INCLUDES, null, null); 733 ev.setPropagationId(propid); 734 pcs.firePropertyChange(ev); 735 } 736 } 737 } 738 739 } 740 | Popular Tags |