Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: examples, extras
    • Labels:
      None

      Description

      Hi

      I am taking a bit liberty here, but it would be nice if Click had a tree control to display hierarchical data. For example displaying directories and files on the server.

      Features I would like:

      1) Expand/collapse nodes.
      2) Select/deselect nodes.
      3) Listener for expansion and selection events.
      4) Custom icons for parent and leaf nodes.
      5) Custom node renderer much like the Decorator interface is used to customize the Column control.
      6) Client vs server side trees? (Client side behavior would most probably be based on javascript?)

      Feel free to close this issue if a tree control is not seen as widely useful.

      kind regards

      bob

      1. ASF.LICENSE.NOT.GRANTED--checkbox-tree.png
        12 kB
        Bob Schellink
      2. ASF.LICENSE.NOT.GRANTED--clickDivTreeExample.zip
        67 kB
        Bob Schellink
      3. ASF.LICENSE.NOT.GRANTED--clickDivTreeExample2.zip
        68 kB
        Bob Schellink
      4. ASF.LICENSE.NOT.GRANTED--clickTreeExample.zip
        53 kB
        Bob Schellink
      5. ASF.LICENSE.NOT.GRANTED--div-checkbox-tree.png
        11 kB
        Bob Schellink
      6. ASF.LICENSE.NOT.GRANTED--div-tree.png
        11 kB
        Bob Schellink
      7. ASF.LICENSE.NOT.GRANTED--tree.png
        11 kB
        Bob Schellink

        Activity

        Hide
        Malcolm Edgar added a comment -

        Hi Bob,

        this request has come up before. However I am hesitant to write one of these myself, as I haven't had the need yet, so I am not really aware of the needs. Do you want to accept the challenge? If you do I would post to the list, as you might get some useful feedback on where you can acquire some code from.

        regards Malcolm

        Show
        Malcolm Edgar added a comment - Hi Bob, this request has come up before. However I am hesitant to write one of these myself, as I haven't had the need yet, so I am not really aware of the needs. Do you want to accept the challenge? If you do I would post to the list, as you might get some useful feedback on where you can acquire some code from. regards Malcolm
        Hide
        Bob Schellink added a comment -

        Hi Malcolm

        I will try to implement a usable tree control this week.

        Would it be OK to "borrow" some icons from other Apache2 licensed project like Wicket or Myfaces? Specifically folder and file icons. Sorry but I am a bit ignorant of licensing issues, especially with how it applies to artwork.

        kind regards

        Show
        Bob Schellink added a comment - Hi Malcolm I will try to implement a usable tree control this week. Would it be OK to "borrow" some icons from other Apache2 licensed project like Wicket or Myfaces? Specifically folder and file icons. Sorry but I am a bit ignorant of licensing issues, especially with how it applies to artwork. kind regards
        Hide
        Malcolm Edgar added a comment -

        Hi Bob,

        That is great to hear.

        Regarding the licensing, I I think it is OK, so long as you attribute credit to that project. I have borrowed bits and pieces from other open source projects, and have tried to attribute credit to them when I do. We could add some credits in the controls Javadoc.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Hi Bob, That is great to hear. Regarding the licensing, I I think it is OK, so long as you attribute credit to that project. I have borrowed bits and pieces from other open source projects, and have tried to attribute credit to them when I do. We could add some credits in the controls Javadoc. regards Malcolm Edgar
        Hide
        Bob Schellink added a comment -

        Hi

        I have attached the a zip containing the tree implementation and resource files. There are actually two tree implementations, the basic tree and a subclass demonstrating the use of checkboxes and a decorator.

        There are still some TODO's but for a first pass I think this is ok.

        I have not gotten around to implement the client side of things, basically because I do not know javascript. But I will try this week to get that working (basically just swapping the css classes of certain elements), since the client side part is more useful in WAN apps.

        I also attached two screenshots so you can see what it looks like

        Lemme know the things I should add/remove etc...

        kind regards

        bob

        Show
        Bob Schellink added a comment - Hi I have attached the a zip containing the tree implementation and resource files. There are actually two tree implementations, the basic tree and a subclass demonstrating the use of checkboxes and a decorator. There are still some TODO's but for a first pass I think this is ok. I have not gotten around to implement the client side of things, basically because I do not know javascript. But I will try this week to get that working (basically just swapping the css classes of certain elements), since the client side part is more useful in WAN apps. I also attached two screenshots so you can see what it looks like Lemme know the things I should add/remove etc... kind regards bob
        Hide
        Malcolm Edgar added a comment -

        Hi Bob,

        I have had a quick look over the tree control work, and it looks really really good.

        Its very nice to see the source code will full Javadoc. Unfortunately many contributions come in which haven't had any of this effort put it, and it takes me many hours to clean up to get them to the required standard.

        Bob, as I think developing this control will be a work in progress for a little while, I would like to grant you SVN access to get this stuff committed. It will be much easier to collaborate on this control this way. Could you please set up a user account at sourceforge, which I can then grant permissions to.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Hi Bob, I have had a quick look over the tree control work, and it looks really really good. Its very nice to see the source code will full Javadoc. Unfortunately many contributions come in which haven't had any of this effort put it, and it takes me many hours to clean up to get them to the required standard. Bob, as I think developing this control will be a work in progress for a little while, I would like to grant you SVN access to get this stuff committed. It will be much easier to collaborate on this control this way. Could you please set up a user account at sourceforge, which I can then grant permissions to. regards Malcolm Edgar
        Hide
        Bob Schellink added a comment -

        Hi Malcolm

        The Tree control renders as a unordered list and uses css to style it. I thought this was the most straightforward way to implement this. The Wicket framework uses rows of div's, and then indents each row depending on the current level in the tree. Attached is two examples I created using the same approach called DivTree and DivCheckboxTree. However I found the div implementation harder on the css side of things. Anyway this is just different rendering of the same tree. Which approach, unordered lists or stacked div's should I commit?

        Another issue I ran into while building the tree was that there is no AbstractControl. I created a AbstractControl to make it easier to create controls from scratch. All the methods were just copied from Table. From a user perspective AbstractControl is obviously noise, but from someone implementing new control's, this helps remove most of the boilerplate.

        Anyway you think there is a need for AbstractControl at all? If not I will roll the methods back into Tree.

        regards

        bob

        Show
        Bob Schellink added a comment - Hi Malcolm The Tree control renders as a unordered list and uses css to style it. I thought this was the most straightforward way to implement this. The Wicket framework uses rows of div's, and then indents each row depending on the current level in the tree. Attached is two examples I created using the same approach called DivTree and DivCheckboxTree. However I found the div implementation harder on the css side of things. Anyway this is just different rendering of the same tree. Which approach, unordered lists or stacked div's should I commit? Another issue I ran into while building the tree was that there is no AbstractControl. I created a AbstractControl to make it easier to create controls from scratch. All the methods were just copied from Table. From a user perspective AbstractControl is obviously noise, but from someone implementing new control's, this helps remove most of the boilerplate. Anyway you think there is a need for AbstractControl at all? If not I will roll the methods back into Tree. regards bob
        Hide
        Bob Schellink added a comment -

        The attached file clickDivTreeExample.zip will not actually work, since I included the wrong css.

        I attached clickDivTreeExample2.zip which is the correct one.

        Malcolm can you delete the clickDivTreeExample.zip?

        Thanks

        Show
        Bob Schellink added a comment - The attached file clickDivTreeExample.zip will not actually work, since I included the wrong css. I attached clickDivTreeExample2.zip which is the correct one. Malcolm can you delete the clickDivTreeExample.zip? Thanks
        Hide
        Bob Schellink added a comment -

        I have created a new issue to track the javascript functionality here : http://www.avoka.com/jira/browse/CLK-186

        Show
        Bob Schellink added a comment - I have created a new issue to track the javascript functionality here : http://www.avoka.com/jira/browse/CLK-186
        Hide
        Bob Schellink added a comment -

        Tree control implemented and checked into SVN. Will be available in release 1.2

        Show
        Bob Schellink added a comment - Tree control implemented and checked into SVN. Will be available in release 1.2

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development