swingx
  1. swingx
  2. SWINGX-1317

PatternPredicate causes exception with testColumn -1 (ALL)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.6.3
    • Component/s: Renderer
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,317

      Description

      If we use new PatternPredicate(".e.", -1) in a JXTable we get an
      IllegalArgumentException because the test column is not a valid column. We can
      place a fix in PatternPredicate, but I don't believe that's the correct
      location. I believe that ComponentAdapter should handle the -1 as part of its
      contract. We should update ComponentAdapter and TableAdapter (the only
      override) to ensure that we are correctly handling -1.

        Activity

        Hide
        kleopatra added a comment -

        definitely a bug - but on the PatternPredicate side, IMO: ComponentAdapter is documented
        (everywhere?) to only accept valid indices.

        added failing test to HighlighterIssues

        CU
        Jeanette

        Show
        kleopatra added a comment - definitely a bug - but on the PatternPredicate side, IMO: ComponentAdapter is documented (everywhere?) to only accept valid indices. added failing test to HighlighterIssues CU Jeanette
        Hide
        kleopatra added a comment -

        definition of "testColumn == All" is missing/fishy/pending: looks like it doesn't handle
        the case at all

        Cheers
        Jeanette

        Show
        kleopatra added a comment - definition of "testColumn == All" is missing/fishy/pending: looks like it doesn't handle the case at all Cheers Jeanette
        Hide
        Karl Schaefer added a comment -

        Hmm, guess you're right. Just feels like another -1 == ALL will require
        duplicate code. Oh well, that's probably better. Ensures that
        ComponentAdapter is clean.

        Show
        Karl Schaefer added a comment - Hmm, guess you're right. Just feels like another -1 == ALL will require duplicate code. Oh well, that's probably better. Ensures that ComponentAdapter is clean.
        Hide
        kleopatra added a comment -

        clarified contract:

        • both test- and decorateColumn are either a single value or ALL
        • in testColumn the ALL is actually a logic operator of how look for matches in several
          columns - principally that could be AND or OR. Decided for OR to be consistent with RowFilters.GeneralFilter
          which includes rows if any of the columns meet the include criterion
        • in decorateColumn the ALL means ... well ... all
        • implemented the match and highlight logic accordingly
        • added convenience contructors
        • add unit test in HighltPredicateTes
        • added visual test in HighlighterClientVisualCheck
        Show
        kleopatra added a comment - clarified contract: both test- and decorateColumn are either a single value or ALL in testColumn the ALL is actually a logic operator of how look for matches in several columns - principally that could be AND or OR. Decided for OR to be consistent with RowFilters.GeneralFilter which includes rows if any of the columns meet the include criterion in decorateColumn the ALL means ... well ... all implemented the match and highlight logic accordingly added convenience contructors add unit test in HighltPredicateTes added visual test in HighlighterClientVisualCheck
        Hide
        kleopatra added a comment -

        error fixed

        Show
        kleopatra added a comment - error fixed

          People

          • Assignee:
            kleopatra
            Reporter:
            Karl Schaefer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: