iNamik / java_text_tables

Text Table Library in Java
MIT License
57 stars 14 forks source link

Provide a tree text output #3

Closed gastaldi closed 8 years ago

gastaldi commented 8 years ago

It would be nice to have a tree-style output, like the tree command in Linux

iNamik commented 8 years ago

Hi!

I tend to think of a tree layout builder as consumer of this table package, but not a citizen of it.

Feels like it could be done with a nested-tables approach.

Might be fun to try, I'll take a shot at it if I find some time. Maybe create an example class within the package, or maybe a gist.

Also, let me know if you give it a go :) Thanks for participating!

-D

iNamik commented 8 years ago

After further pondering, I have concluded that a table is not suitable for representing a tree like the type generated by the linux tree command.

Let's take a simple example:

+- Directory One
|   +- File Two
|   +- File Three
+- Directory Four

There really aren't any defined column boundaries

Q: How would you propose to render the above example in a GridTable?

As I see it, it would just be a table with 1 long column, which isn't really a table at all.

As such, we should probably close this issue, but I'm interested in hearing your thoughts on the matter.

Thank you for your interest in my project and for taking the time!

-David

gastaldi commented 8 years ago

I guess the idea behind this issue was an output similar to the tree command in Linux, not exactly a GridTable. Maybe it should belong to a separate project. Closing now.