Rename setParentData to setupParentData since it's not a setter per se.
TBR=abarth
Review URL: https://codereview.chromium.org/1208293002.
diff --git a/sky/examples/rendering/sector_layout.dart b/sky/examples/rendering/sector_layout.dart
index 85dcc41..a1aa03b 100644
--- a/sky/examples/rendering/sector_layout.dart
+++ b/sky/examples/rendering/sector_layout.dart
@@ -65,7 +65,7 @@
abstract class RenderSector extends RenderObject {
- void setParentData(RenderObject child) {
+ void setupParentData(RenderObject child) {
if (child.parentData is! SectorParentData)
child.parentData = new SectorParentData();
}
@@ -197,7 +197,7 @@
}
}
- void setParentData(RenderObject child) {
+ void setupParentData(RenderObject child) {
// TODO(ianh): avoid code duplication
if (child.parentData is! SectorChildListParentData)
child.parentData = new SectorChildListParentData();
@@ -307,7 +307,7 @@
}
}
- void setParentData(RenderObject child) {
+ void setupParentData(RenderObject child) {
// TODO(ianh): avoid code duplication
if (child.parentData is! SectorChildListParentData)
child.parentData = new SectorChildListParentData();
@@ -407,7 +407,7 @@
markNeedsLayout();
}
- void setParentData(RenderObject child) {
+ void setupParentData(RenderObject child) {
if (child.parentData is! SectorParentData)
child.parentData = new SectorParentData();
}
diff --git a/sky/sdk/lib/rendering/README.md b/sky/sdk/lib/rendering/README.md
index 887f9de..bf1b709 100644
--- a/sky/sdk/lib/rendering/README.md
+++ b/sky/sdk/lib/rendering/README.md
@@ -79,11 +79,11 @@
TODO(ianh): Describe the parent data concept.
-The `setParentData()` method is automatically called for each child
+The `setupParentData()` method is automatically called for each child
when the child's parent is changed. However, if you need to
preinitialise the `parentData` member to set its values before you add
a node to its parent, you can preemptively call that future parent's
-`setParentData()` method with the future child as the argument.
+`setupParentData()` method with the future child as the argument.
TODO(ianh): Discuss putting per-child configuration information for
the parent on the child's parentData.
@@ -161,7 +161,7 @@
* Information about the child managed by the parent, e.g. typically
position information and configuration for the parent's layout,
should be stored on the `parentData` member; to this effect, a
- ParentData subclass should be defined and the `setParentData()`
+ ParentData subclass should be defined and the `setupParentData()`
method should be overriden to initialise the child's parent data
appropriately.
@@ -215,18 +215,18 @@
you fulfill their contract instead.
* If it has any data to store on its children, it must define a
- BoxParentData subclass and override setParentData() to initialise
+ BoxParentData subclass and override setupParentData() to initialise
the child's parent data appropriately, as in the following example.
(If the subclass has an opinion about what type its children must
be, e.g. the way that `RenderBlock` wants its children to be
- `RenderBox` nodes, then change the `setParentData()` signature
+ `RenderBox` nodes, then change the `setupParentData()` signature
accordingly, to catch misuse of the method.)
```dart
class FooParentData extends BoxParentData { ... }
// In RenderFoo
- void setParentData(RenderObject child) {
+ void setupParentData(RenderObject child) {
if (child.parentData is! FooParentData)
child.parentData = new FooParentData();
}
diff --git a/sky/sdk/lib/rendering/block.dart b/sky/sdk/lib/rendering/block.dart
index 0a80015..e119868 100644
--- a/sky/sdk/lib/rendering/block.dart
+++ b/sky/sdk/lib/rendering/block.dart
@@ -21,7 +21,7 @@
addAll(children);
}
- void setParentData(RenderBox child) {
+ void setupParentData(RenderBox child) {
if (child.parentData is! BlockParentData)
child.parentData = new BlockParentData();
}
diff --git a/sky/sdk/lib/rendering/box.dart b/sky/sdk/lib/rendering/box.dart
index a98a931..19d3752 100644
--- a/sky/sdk/lib/rendering/box.dart
+++ b/sky/sdk/lib/rendering/box.dart
@@ -257,7 +257,7 @@
abstract class RenderBox extends RenderObject {
- void setParentData(RenderObject child) {
+ void setupParentData(RenderObject child) {
if (child.parentData is! BoxParentData)
child.parentData = new BoxParentData();
}
diff --git a/sky/sdk/lib/rendering/flex.dart b/sky/sdk/lib/rendering/flex.dart
index 4eee1bd..1bc8b8c 100644
--- a/sky/sdk/lib/rendering/flex.dart
+++ b/sky/sdk/lib/rendering/flex.dart
@@ -74,7 +74,7 @@
}
}
- void setParentData(RenderBox child) {
+ void setupParentData(RenderBox child) {
if (child.parentData is! FlexBoxParentData)
child.parentData = new FlexBoxParentData();
}
diff --git a/sky/sdk/lib/rendering/object.dart b/sky/sdk/lib/rendering/object.dart
index 25083a2..a21db01 100644
--- a/sky/sdk/lib/rendering/object.dart
+++ b/sky/sdk/lib/rendering/object.dart
@@ -49,7 +49,7 @@
// node out, and any other nodes who happen to know exactly what
// kind of node that is.
dynamic parentData; // TODO(ianh): change the type of this back to ParentData once the analyzer is cleverer
- void setParentData(RenderObject child) {
+ void setupParentData(RenderObject child) {
// override this to setup .parentData correctly for your class
assert(!debugDoingLayout);
assert(!debugDoingPaint);
@@ -62,7 +62,7 @@
assert(!debugDoingLayout);
assert(!debugDoingPaint);
assert(child != null);
- setParentData(child);
+ setupParentData(child);
super.adoptChild(child);
markNeedsLayout();
}
diff --git a/sky/sdk/lib/rendering/stack.dart b/sky/sdk/lib/rendering/stack.dart
index ed8dfbe..a487aa5 100644
--- a/sky/sdk/lib/rendering/stack.dart
+++ b/sky/sdk/lib/rendering/stack.dart
@@ -38,7 +38,7 @@
addAll(children);
}
- void setParentData(RenderBox child) {
+ void setupParentData(RenderBox child) {
if (child.parentData is! StackParentData)
child.parentData = new StackParentData();
}