+ Added FoldOperation.owns(Fold) to check whether fold was produced + by a particular FoldOperation. +
+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.
+ + + +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();