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.
@fredkiefer
fredkiefer removed their request for review September 6, 2026 15:41
@gcasa
gcasa requested review from fredkiefer, rfm and rmottola September 7, 2026 19:48
Comment thread Source/NSRuleEditor.m

Author: Fred Kiefer <fredkiefer@gmx.de>
Date: January 2020
Created by Fabian Spillner on 03.12.07.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This attribution is a bit strange, where does it come from?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back to mySTEP to check whether I copied this file over, as I did with the headers, but this file is still empty there, so this seems unlikely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may have been a copy and paste issue on my part.

@fredkiefer

Copy link
Copy Markdown
Member

@gcasa actually I am waiting here and with most of the other PRs by Todd on your decision whether we want to include that code.

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.

2 participants