-
Notifications
You must be signed in to change notification settings - Fork 11
File system tree for the Script Editor #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
All the "errors" are very old issues with the documentation of methods in Script Editor classes. |
…pt engine.
Adds a checkbox next to the "Run", "Kill", "Batch" buttons to enable
incremental script interpretation.
The workflows:
A. Execute selected chunks, and persist that execution.
B. Execute a whole script, fails at some point, everything prior to
that error remains evaluted. So script execution can continue from
there by selecting the text (after fixing it!).
when the 'incremental' checkbox is selected.
hasn't been selected yet, and handle properly the printing of the prompt command into the output screen, and manage properly the index of the command when navigating with page up and page down, in addition to properly blanking the prompt when appropriate.
rather than below. Fits better with modern screens which are much wider than higher.
Offers: * adding any numbertop-level directories: button (+) * ability to remove them: when selected, use button (-) * dynamic: inspects files and directories on demand. * double-click a file to open it in the Script Editor * collapsible if not wanted * persistent: list of top-level directories is stored when using "Edit - Save Preferences".
f0f0167 to
2a1bb4d
Compare
|
Thanks for working on this! I will try to go through this PR as well as #27 on Sunday or Monday. |
a help message dialog, and a checkbox to enable using up/down arrows for navigating the command history.
And when arrows are enabled for history navigation, shift+arrow will navigate within the prompt.
|
Thanks @ctrueden . Just pushed a few more edits to make things look nicer and easier. Also: it would be nice to open images in ImageJ/Fiji from the FileSystemTree by double-click. How would you do that without introducing a dependency on ImageJ? I'm happy to enable it via reflection by discovering classes at run time, but perhaps there is a better way. |
so that the screen and prompt can be collapsed away.
|
@acardona wrote:
Maven is a bit misleading here, as all those
I guess you could use SciJava's |
|
I quickly tested this, and it looks really nice! However, the fact that the output pane on the right cannot shrink smaller than the width of the button bar is a bit inhibiting on small(ish) screens: Also a suggestion, how about allowing drag-and-drop to add the path of a file in the tree into the currently open script, at the position where the file is being dropped? |
The file path is inserted wherever the caret is. A nice side consequence is that dragging files from the FileSystemTree onto the ImageJ toolbar will attempt to open them in ImageJ.
|
Hi @ctrueden, any update? I did see you merged master into this branch. |
|
@acardona Working on it today! All I want to do before merging is to add toggles for the new panes to the menus, which are remembered with the preferences. Do you think it makes sense to split out the portion of the Edit menu controlling fonts and such—i.e. the UI preferences—to a new View or Window menu? Or should I just add the pane toggles to Edit also? I am leaning toward a new menu. |
|
Thanks! If I understand you correctly, you are referring to the 4th subsection of the Edit menu. While this is not really part of this PR, indeed, moving it to a "Format" menu would make sense. |
|
Or a "Style" menu. |
They did not really belong in "Edit". And we will add more things to this menu shortly.
This may cause the Script Editor settings to be reset. But only once.
|
I worked on this for a couple of hours. I split out the options-related Edit menu items into a new Options menu, intended to add some toggles for the various UI components. However, after further consideration, I think it is unnecessary to add any new menu items, since all the UI components are nicely one-click collapsable. So now all I have to add is persistence of the split pane states. I have to go AFK now but will try to finish that later tonight or tomorrow. |
|
Thanks. A comment on lambdas: why use them? The old code is explicit about which events are used. The lambdas code isn't. Doesn't seem to add anything in these particular instances other than obfuscation. |
|
Regarding lambdas: it's more about what they remove than what they add: 100 fewer lines of code in classes that are long and bulky. I personally find them easier to read since there is less nesting, and I doubt I am the only one. Sorry you find them more obfuscated. |
And avoid non-ASCII characters, in favor of Unicode sequences.
And dump any exceptions that occur to the debug log.
Soon, that logic will need more UI elements to be defined.
d0667c9 to
fd24b14
Compare
This fixes a bug where resizing the tab's JSplitPane divider to make the output pane taller instead results in the REPL "emerging" while in non-persistent mode. This was happening because the screenAndPromptSplit prioritized keeping its JSplitPane divider at the same integer value, resulting in the output pane height staying constant and the REPL pane's height increasing. By setting the REPL pane to invisible, the resizing logic now instead gives the extra space to the output pane, as desired.
fd24b14 to
49bd653
Compare
|
I fixed some bugs, and added persistence of the split pane dividers. Will merge now. |

Adds a JTree that shows nested folders from the file system; in a collapsible panel.
Top-level folders can be added and removed with the (+) and (-) buttons.
The "Edit - Save preferences" will store which top folders the user had listed.
Double-click on a leaf (a file) will open it in a Tab of the Script Editor.
Builds on top of the other PR #27 that added the incremental evaluation and REPL.