Pivot
  1. Pivot
  2. PIVOT-795

Add access in TerraFileBrowserSheetSkin to allow additional fields in the dialog

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.1
    • Component/s: wtk-terra
    • Labels:
    • Environment:
      Windows XP SP3, JDK 1.6.0_16

      Description

      I would like to be able to (for instance) add a ListButton field to the Open File dialog to specify a character set encoding. In order to do this, I think the minimal support would be making the main TablePane of the dialog available as a protected field so a subclass of TerraFileBrowserSheetSkin could access it to add additional fields.

      1. filebrowserskin2.patch
        1 kB
        Roger Whitcomb
      2. FileBrowserWithCharsetTest.java
        5 kB
        Sandro Martini

        Activity

        Hide
        Roger Whitcomb added a comment -

        I think this patch will do the trick.

        Show
        Roger Whitcomb added a comment - I think this patch will do the trick.
        Hide
        Roger Whitcomb added a comment -

        After thrashing around a lot (mostly due to my lack of understanding of how to subclass an existing skin) I have this patch (filebrowserskin2.patch) working now in my application.

        What does everyone think? Basically I added an "addComponent" method so that the internals of the skin wouldn't have to be exposed. It can be used this way (see attached FileBrowserWithCharset.java).

        Show
        Roger Whitcomb added a comment - After thrashing around a lot (mostly due to my lack of understanding of how to subclass an existing skin) I have this patch (filebrowserskin2.patch) working now in my application. What does everyone think? Basically I added an "addComponent" method so that the internals of the skin wouldn't have to be exposed. It can be used this way (see attached FileBrowserWithCharset.java).
        Hide
        Sandro Martini added a comment -

        Hi Roger,
        to me the patch seem good, so if gthere aren't objections (until tomorrow) I'd say you can apply it.
        Only one thing, I see that the other file in attach is not granted for inclusion (it has your domain, I understand), but I think it would be good to create a sample Test minimal application (under tests/src/org.apache.pivot.tests) to show it, right ? Tell me.

        Bye

        Show
        Sandro Martini added a comment - Hi Roger, to me the patch seem good, so if gthere aren't objections (until tomorrow) I'd say you can apply it. Only one thing, I see that the other file in attach is not granted for inclusion (it has your domain, I understand), but I think it would be good to create a sample Test minimal application (under tests/src/org.apache.pivot.tests) to show it, right ? Tell me. Bye
        Hide
        Sandro Martini added a comment -

        Roger, this is a modified version of your test class (but now it's even a minimal test application for this feature).
        Let me know if it's good for you to be included with your patch, and if you want commit it, or tell me.

        Bye

        Show
        Sandro Martini added a comment - Roger, this is a modified version of your test class (but now it's even a minimal test application for this feature). Let me know if it's good for you to be included with your patch, and if you want commit it, or tell me. Bye
        Hide
        Roger Whitcomb added a comment -

        Committed both the code change and the test case code: 1181083 and 1181089.

        Show
        Roger Whitcomb added a comment - Committed both the code change and the test case code: 1181083 and 1181089.
        Hide
        Roger Whitcomb added a comment -

        Committed 1183126 as a refinement – moved the additional components up to be above the OK/Cancel buttons so it looks more like a part of the dialog.

        Show
        Roger Whitcomb added a comment - Committed 1183126 as a refinement – moved the additional components up to be above the OK/Cancel buttons so it looks more like a part of the dialog.

          People

          • Assignee:
            Roger Whitcomb
            Reporter:
            Roger Whitcomb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development