org.netbeans.api.java.classpath/1 1.29.1

org.netbeans.api.java.queries
Class SourceForBinaryQuery.Result2

java.lang.Object
  extended by org.netbeans.api.java.queries.SourceForBinaryQuery.Result2
All Implemented Interfaces:
SourceForBinaryQuery.Result
Enclosing class:
SourceForBinaryQuery

public static class SourceForBinaryQuery.Result2
extends Object
implements SourceForBinaryQuery.Result

Result of finding sources, encapsulating the answer as well as the ability to listen to it. In addition to the Result it provides information if the source root(s) should be preferred over the binaries used by the java infrastructure. Most of the clients don't need this information, so thay can use the original SourceForBinaryQuery.Result.

Since:
1.15

Method Summary
 void addChangeListener(ChangeListener l)
          Add a listener to changes in the roots.
 FileObject[] getRoots()
          Get the source roots.
 boolean preferSources()
          This method is used by the java infrastructure to find out whether the sources should be preferred over the binaries.
 void removeChangeListener(ChangeListener l)
          Remove a listener to changes in the roots.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRoots

public FileObject[] getRoots()
Description copied from interface: SourceForBinaryQuery.Result
Get the source roots.

Specified by:
getRoots in interface SourceForBinaryQuery.Result
Returns:
array of roots of sources (may be empty but not null)

addChangeListener

public void addChangeListener(ChangeListener l)
Description copied from interface: SourceForBinaryQuery.Result
Add a listener to changes in the roots.

Specified by:
addChangeListener in interface SourceForBinaryQuery.Result
Parameters:
l - a listener to add

removeChangeListener

public void removeChangeListener(ChangeListener l)
Description copied from interface: SourceForBinaryQuery.Result
Remove a listener to changes in the roots.

Specified by:
removeChangeListener in interface SourceForBinaryQuery.Result
Parameters:
l - a listener to remove

preferSources

public boolean preferSources()
This method is used by the java infrastructure to find out whether the sources should be preferred over the binaries.

Returns:
true if sources should be used by the java infrastructure
See Also:
SourceForBinaryQueryImplementation2

org.netbeans.api.java.classpath/1 1.29.1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.