Skip to content

Feature: Implement NSRuleEditor - #856

Open
DTW-Thalion wants to merge 2 commits into
gnustep:masterfrom
DTW-Thalion:feature/rule-editor
Open

Feature: Implement NSRuleEditor#856
DTW-Thalion wants to merge 2 commits into
gnustep:masterfrom
DTW-Thalion:feature/rule-editor

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

Every method of NSRuleEditor was a stub, so an editor had no rows, asked its delegate for nothing and produced no predicate. NSPredicateEditor is built on it and could not work either.

The editor now keeps its rows in a tree. A new row is filled by walking the delegate from the root of its criteria, taking the first child at each step and asking for a display value, until the delegate offers no more. The display values are laid out a row at a time, indented by how deep the row sits. The predicate of a row is assembled from the parts the delegate gives for each of its criteria, and a compound row joins the rows under it with the compound type its own criterion carries. A single editor holds one row, a list joins its rows with or, and the nesting modes that hold rows under a compound row make that row along with the first row it holds.

Choosing another item in a row does not yet rebuild the criteria under it, the formatting dictionary is kept but not applied, and rows are not animated. The class gains instance variables.

Tests/gui/NSRuleEditor/basic.m. 29 assertions fail before the change and pass after.

Refers to #96.

Every method was a stub, so an editor had no rows, asked its delegate for
nothing and produced no predicate.

The editor now keeps its rows in a tree, walks the delegate for the criteria
and display values a row starts out with, lays those out a row at a time,
and builds a predicate from the parts the delegate gives for each criterion.
The row a nesting mode calls for is made along with the first row it holds,
and the rows of a list are joined with or.
@DTW-Thalion
DTW-Thalion requested a review from fredkiefer as a code owner July 29, 2026 14:00
@DTW-Thalion DTW-Thalion changed the title Implement NSRuleEditor Feature: Implement NSRuleEditor Jul 29, 2026
START_SET creates an autorelease pool and END_SET releases it, so the pool
these tests create around the set is redundant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant