262 Commits

Author SHA1 Message Date
Mahmoud Ben Hassine
d909f79d7b Update dependencies 2025-04-24 13:11:22 +02:00
Mahmoud Ben Hassine
8f4e1b78fa Update test dependencies for the latest Spring Boot 3.5 snapshots
Spring Boot 3.5 updated JUnit Jupiter from v5.11 to v5.12.
With this new version, the junit-platform-launcher dependency
must be declared explicitly.
2025-04-22 20:04:09 +02:00
Janne Valkealahti
7165e2d46d Fix inconsistent unknown option parsing
- Fix an issue where unknown option is wrongly
  lexed as an argument if it's later than an known
  valid option.
- Essentially if `arg1` is only valid option
  `--arg1 value1 --arg2 value2` would not complain
  about `arg2`.
- Fixes #1120
2024-08-19 17:40:52 +01:00
Janne Valkealahti
2786b0159e StringInput better unicode handling
- Add unicode handling in flow components in
  AbstractTextComponent which allows StringInput
  to process unicode given from jline.
- This add basic non-english character support
  for input.
- Fixes #1115
2024-08-13 14:26:32 +01:00
Janne Valkealahti
9021238ede Overhaul StatusBar for better text use
- Can change item text
- Can position items by priority(true left, false right)
  and primary(sort for draw attempt)
- Fixes #1112
2024-08-09 07:40:34 +01:00
Janne Valkealahti
02011c898c Screen writer support for AttributedString
- New Screen.Writer has new text method taking
  AttributedString instead of just String
- Fixes #1110
2024-07-28 05:08:27 +01:00
Janne Valkealahti
2eab1a6072 Revisit posix short handling in Lexer
- Posix short style is expected to have only single
  dash and letters so use this style to come up better
  separation between options and arguments.
- Fixes #1077
2024-05-28 10:07:38 +01:00
Janne Valkealahti
2b18de0ffb Fix fg and bg styling
- In ListView and MenuView fix how styling for
  background and foreground are used.
- In Catalog app fix same issue in ScenarioListCell
- Fixes #1063
2024-05-07 08:05:45 +01:00
Janne Valkealahti
419f6a8aa4 Fix DefaultShellApplicationRunner error handling
- Let error from ShellRunner to pass through
  as that's needed for other error handling
  and used by exit code mappings
- Relates #1057
2024-05-03 08:12:31 +01:00
Janne Valkealahti
71960e5415 Use string array in ShellRunner
- In ShellRunner interface replace use of boot's ApplicationArguments
  into plain string array.
- Deprecate old methods with some fallbacks to give
  time for users to do updates.
- NonInteractiveShellRunner contains one breaking change due to its
  public api to set function doing conversion from ApplicationArguments
  which was potentially used via customizer hooks.
- Deprecations planned to get removed in 3.4.x.
- Fixes #1057
2024-05-02 09:44:41 +01:00
Janne Valkealahti
054db7651f GridView fixed size position to top left
- Port changes for tview to not position fixed
  size items into bottom right if item in
  question is last one.
- Fixes #1010
2024-04-15 08:59:15 +01:00
Janne Valkealahti
544601c679 Synchronize display call
- In TerminalUI a display call may be called from
  multiple threads, while only seen to happen on
  windows, should be synchronized.
- Fixes #1039
2024-04-12 17:10:31 +01:00
Janne Valkealahti
831f2cf54b Provide pty info
- Enhance ShellContext for pty info
- Enhance CommandContext to include ShellContext
- Fixes #985
2024-03-10 17:51:38 +00:00
Janne Valkealahti
28459388b6 Polish 2024-02-18 16:51:25 +00:00
Janne Valkealahti
cdb2eb8ca1 Rename Context to ProgressContext
- Relates #995
2024-02-17 14:28:51 +00:00
Janne Valkealahti
d38d0d46e0 Fix wrong ProgressView ctor use
- Fixes a bug so that given items are actually used
- Relates #995
2024-02-16 09:27:00 +00:00
Janne Valkealahti
77a694848c ScriptShellRunner should have correct run detection
- Fix run detection so that @ has to be first character in a first
  argument and it also has additional content, like @path-to-file.
- This fixes issue where `--arg @` would blow up as an normal
  option argument.
- Fixes #996
2024-02-15 10:17:04 +00:00
Janne Valkealahti
afb8bc7104 Revisit ProgressView
- Polish a lot of things
- Do updates/redraw internally with eventloop as it'd be super
  inconvenient asking user to handle this externally
- Rewrite sample to be more unified for various cases
- Set eventloop from ViewComponent
- Relates #995
2024-02-15 09:26:23 +00:00
Janne Valkealahti
27c2717d3b Can attempt message send without subscribers
- Change state assert not to throw if we're in state
  where message would never get consumed. Now
  just returning false.
- Fixes #1002
2024-02-15 09:26:03 +00:00
Janne Valkealahti
7fa953f131 ViewComponent async execution
- Modifies ViewComponent with changed api's so that
  it can be executed with a thread allowing caller
  not to block.
- Add ViewComponentBuilder concept and create is as
  a bean similar to TerminalUIBuilder.
- Relates #997
2024-02-10 15:08:34 +00:00
Janne Valkealahti
abc4ffaaa3 ProgressView spinner theming
- New SpinnerSettings which integrates with ThemeSettings
- Support infra around spinner theming
- Relates #995
2024-02-04 14:57:23 +00:00
Janne Valkealahti
95aaa865c5 ProgressView spinner calculation in item function
- Move spinner frame calculation to item itself so that
- Remove spinnerFrame from state and add
  start/update times
- view don't have hard dependency to it, as we'd
  need its interval
- Change spinner to run only when view is running
- Relates #995
2024-02-04 09:43:56 +00:00
Janne Valkealahti
9446afecb7 Make ViewComponent api better for expected use
- Exposing eventloop if user need to interact with it
- Add api/feature to set used view rect expand to
  full terminal width
- Add plain ProgressView samples
- Relates #995
- Fixes #997
2024-02-02 09:32:07 +00:00
Janne Valkealahti
10d9940299 Initial ProgressView implementation
- Provides a basic feature set for ProgressView.
- Progress can have a set of items which are driven
  by function style factory interface.
- New class TextCell which is a base of progress items.
- Not yet fully working and further changes, samples, docs
  will come in other commits.
- Relates #995
2024-02-02 08:44:28 +00:00
Janne Valkealahti
3d52f174af Don't fail writing text outside screen
- Adding np check not to try using item outside of a screen
- This fix essentially discards text write beyond screen bounds
- Fixes #993
2024-01-29 09:42:57 +00:00
Janne Valkealahti
9830fafe1a Use CommandContext as method parameter
- With annotation(@Command) model it's now possible to just
  add CommandContext and it will get resolved and doesn't
  cause it to appear as an option.
- Fixes #779
2024-01-26 13:49:30 +00:00
Janne Valkealahti
e64e1fbcb5 Polish javadocs 2024-01-18 17:10:47 +00:00
Janne Valkealahti
a37bd6ad5a Fix alias handling with @Command annotation
- Revisit how alias commands are added using
  @Command annotation when using if/or on class
  and/or method level.
- With this change alias handling is more logical
  and there's better tests and docs.
- Fixes #945
2024-01-13 12:20:06 +00:00
Janne Valkealahti
a6d16e8cbb Restore cursor using normal capability
- Looks like some infocmp capabilities for making cursor visible
  using cvvis doesn't always work. So change to use cnorm instead.
- Terminal instruction of making cursor very visible with cvvis
  doesn't mean cursor should be visible, afaik, so i.e. screen
  or tmux didn't work.
- Fixes #970
2024-01-12 15:42:01 +00:00
Janne Valkealahti
463a70414a Split jline dependencies
- From jline to console, reader, style and terminal.
- Fixes #968
2024-01-11 10:21:49 +00:00
Janne Valkealahti
51f49f7567 Fix exception mapping with exit codes
- Migitates changed behaviour in boot how exceptions are
  handled thus caused trouble with exit code mappings
  on a shell side.
- Fixes #961
2023-12-24 08:49:33 +00:00
Janne Valkealahti
cb8f44ff63 Restore old sorting behaviour
- In #946 we added new ways to add items to single selector while still
  keeping Map<String, String>. Order to keep old sorting behaviour
  we try to pass incoming map via new HashMap as that was a way it
  worked. This should limit risks for breaking things in a patch release.
2023-12-23 10:02:06 +00:00
Janne Valkealahti
56dffe0223 Add SelectItem to flow single selector api
- This change makes single/multi same on an api level
  where single selector used key/value map and multi
  selector used list of SelectItem's.
- We still keep use of map on a single select but those
  essentially go directly via SelectItem's.
- Fixes #946
2023-12-18 10:03:36 +00:00
Janne Valkealahti
b1084a62ee Fix wrong parser message
- Parser error message gave wrong lower level arity value
  if option didn't have enough arguments
- Fixes #930
2023-11-27 14:29:29 +00:00
Janne Valkealahti
ead34d69e1 Update modal docs
- Relates #825
2023-11-23 09:08:17 +00:00
Janne Valkealahti
2d29050c34 Make Catalog browsers focusable with shortcuts
- Category and scenario list views can now be focused with
  ctrl+a/ctrl+s.
- Bind all keys with ctrl modifier
- Add "shortcut" concept to views which currently hooks to
  hot keys.
- In a catalog app by using a "shortcut" then takes the key
  event as a hot key, as it consumes resulting behaviour
  is to focus.
- Move view initInternal away from constructor call to
  require user to call init() which is not in a
  View interface
- Relates #826
2023-11-12 16:43:11 +00:00
Janne Valkealahti
ccf6d771d9 Add multiinput scenario
- InputView using viewcommands and has event for text change.
- Experimental way to handle tab navigation in a layout views.
- New viewcommands for tab navigation and moving cursor.
- Mouse click takes focus in AbstractView if no view command
  binding.
- MultiInputViewScenario now shows tab navigation.
- Fixes #917
2023-11-07 08:26:43 +00:00
Janne Valkealahti
bba7a82ab4 Make StatusBarView work with hotkeys
- StatusItem can now define a hotkey which is then
  bound to its action.
- In catalog app replace use of raw key event to
  item's hotkey for status bar visibility.
- Various doc updates.
- Relates #826
2023-10-30 09:31:03 +00:00
Janne Valkealahti
82df453cc0 Autoconfigure TerminalUI
- Add TerminalUIBuilder which can be used to build TerminalUI
- Add TerminalUICustomizer which can customize TerminalUI
- What is autoconfigured is TerminalUIBuilder.
- In TerminalUI add configure for views which now allows
  easier way to set needed stuff in views.
- Various changes in a catalog app
- Fixes #900
2023-10-25 09:10:42 +01:00
Janne Valkealahti
eacd6c3df4 Make DefaultEventLoopTests more reliable
- Temp workaround for letting tests pass
- Relates #898
2023-10-21 09:02:52 +01:00
Janne Valkealahti
4871b19c58 Polish 2023-10-20 09:03:08 +01:00
Janne Valkealahti
92eb7dd2b7 Relocate message package from view
- Relates #813
2023-10-20 08:48:36 +01:00
Janne Valkealahti
433c1f96f0 Relocate geom package from view
- Relates #813
2023-10-20 08:38:01 +01:00
Janne Valkealahti
8de0ef47df Better background handling in themes
- Modify view structures so that we're able to
  control background drawing better
- Remove transparent concept from box view
- Add background styles for dialog, menu/status bars
- Relates #824
2023-10-19 13:12:42 +01:00
Janne Valkealahti
b6d1958949 HotKey can set focus
- Fix AbstractView to return focus info for hotkey handler
- TerminalUI sets focus from returned key handling
  for hotkeys
- Fixes #881
2023-10-08 09:19:47 +01:00
Janne Valkealahti
8716774236 Enhance TerminalUI eventing
- New methods in an eventloop and message builder
- Generic polish to use these methods
- Relates #761
2023-10-07 14:56:54 +01:00
Janne Valkealahti
585125d2e3 TerminalUI can define rootView rect
- Add functions to calculate Rectangle for fullscreen/nonfullscreen modes.
- Fixes for rendering so that nonfullscreen works better with views.
- Add some basic samples
- isEmpty method for Rectangle
- Fixes #872
2023-09-22 09:00:22 +01:00
Janne Valkealahti
d58293e700 Support view commands in view
- Setup facilities in view system to register commands
  with a Runnable to get dispatched into an event loop.
- As first commands, setup ListView with lineDown and
  lineUp.
- Expose needed functions into View itself.
- Relates #867
2023-09-21 09:03:58 +01:00
Janne Valkealahti
51c250608b Overhaul ListView to support checked states
- ListView can be defined to use nocheck, checked or radio
- List can now scroll through up/down
- Actual visual is handled in a DefaultListCell
- Modify/add scenarios and catalog app
- Relates #865
2023-09-09 08:59:37 +03:00
Janne Valkealahti
a679de0067 Add missing ascii keys to KeyEvent
- Relates #823
2023-09-09 08:48:17 +03:00