diff -r 8c3a3587e223 editor.fold/apichanges.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/editor.fold/apichanges.xml Mon Mar 03 15:14:28 2008 +0100 @@ -0,0 +1,169 @@ + + + + + + + + + + + + + Fold API + + Fold SPI + + + + + + + + FoldOperation.owns(Fold) added + + + + + +

+ Added FoldOperation.owns(Fold) to check whether fold was produced + by a particular FoldOperation. +

+
+ +
+
+ + + + + Fold API Changes by Date + + + + + + +

Introduction

+ +

What do the Dates Mean?

+ +

The supplied dates indicate when the API change was made, on the CVS +trunk. From this you can generally tell whether the change should be +present in a given build or not; for trunk builds, simply whether it +was made before or after the change; for builds on a stabilization +branch, whether the branch was made before or after the given date. In +some cases corresponding API changes have been made both in the trunk +and in an in-progress stabilization branch, if they were needed for a +bug fix; this ought to be marked in this list.

+ + + +
+ + +
+ +
diff -r 8c3a3587e223 editor.fold/manifest.mf --- a/editor.fold/manifest.mf Mon Mar 03 10:08:05 2008 +0100 +++ b/editor.fold/manifest.mf Mon Mar 03 15:14:28 2008 +0100 @@ -1,5 +1,5 @@ Manifest-Version: 1.0 Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.fold/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/fold/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 AutoUpdate-Show-In-Client: false diff -r 8c3a3587e223 editor.fold/nbproject/project.properties --- a/editor.fold/nbproject/project.properties Mon Mar 03 10:08:05 2008 +0100 +++ b/editor.fold/nbproject/project.properties Mon Mar 03 15:14:28 2008 +0100 @@ -38,5 +38,6 @@ # made subject to such option by the copyright holder. javadoc.arch=${basedir}/arch.xml +javadoc.apichanges=${basedir}/apichanges.xml #javadoc.base=../../../editor/fold #cp.extra= diff -r 8c3a3587e223 editor.fold/src/org/netbeans/spi/editor/fold/FoldOperation.java --- a/editor.fold/src/org/netbeans/spi/editor/fold/FoldOperation.java Mon Mar 03 10:08:05 2008 +0100 +++ b/editor.fold/src/org/netbeans/spi/editor/fold/FoldOperation.java Mon Mar 03 15:14:28 2008 +0100 @@ -45,6 +45,7 @@ import org.netbeans.api.editor.fold.Fold import org.netbeans.api.editor.fold.Fold; import org.netbeans.api.editor.fold.FoldHierarchy; import org.netbeans.api.editor.fold.FoldType; +import org.netbeans.modules.editor.fold.ApiPackageAccessor; import org.netbeans.modules.editor.fold.FoldHierarchyTransactionImpl; import org.netbeans.modules.editor.fold.FoldOperationImpl; import org.netbeans.modules.editor.fold.SpiPackageAccessor; @@ -179,6 +180,17 @@ public final class FoldOperation { } /** + * Check whether this fold operation has produced the given fold. + * + * @param fold non-null fold. + * @return true if this fold operation produced the given fold (by its addToHierarchy() method) + * or false otherwise. + */ + public boolean owns(Fold fold) { + return (ApiPackageAccessor.get().foldGetOperation(fold) == impl); + } + + /** * Return extra info object passed to fold at time of its creation. * * @return extra information object specific for the fold diff -r 8c3a3587e223 editor.fold/test/unit/src/org/netbeans/modules/editor/fold/SimpleFoldManagerTest.java --- a/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/SimpleFoldManagerTest.java Mon Mar 03 10:08:05 2008 +0100 +++ b/editor.fold/test/unit/src/org/netbeans/modules/editor/fold/SimpleFoldManagerTest.java Mon Mar 03 15:14:28 2008 +0100 @@ -117,7 +117,7 @@ public class SimpleFoldManagerTest exten public void initFolds(FoldHierarchyTransaction transaction) { try { - getOperation().addToHierarchy( + Fold fold = getOperation().addToHierarchy( REGULAR_FOLD_TYPE, "...", // non-null to properly count fold's size (non-null desc gets set) // NOI18N false, @@ -125,6 +125,9 @@ public class SimpleFoldManagerTest exten null, transaction ); + + assertTrue(getOperation().owns(fold)); + } catch (BadLocationException e) { e.printStackTrace(); fail();