An open API service indexing awesome lists of open source software.

https://github.com/gesundkrank/fzf4j

Fzf implementation in Java
https://github.com/gesundkrank/fzf4j

fzf java

Last synced: 6 months ago
JSON representation

Fzf implementation in Java

Awesome Lists containing this project

README

          

= FZF4J

image:https://github.com/gesundkrank/fzf4j/workflows/Release/badge.svg[Release]
image:https://img.shields.io/maven-central/v/de.gesundkrank.fzf4j/fzf4j.svg[link=https://search.maven.org/search?q=g:de.gesundkrank.fzf4j%20AND%20a:fzf4j]

Fzf Java implementation to use in Java CLI applications.
Based on https://github.com/junegunn/fzf.

== Usage

FZF4J is intended to use in Java command-line applications.
In case you want use it directly from the console just the original FZF.

=== Add the dependency to your build file

.Maven
[source,xml]
----

de.gesundkrank.fzf4j
fzf4j
VERSION

----

.Gradle
[source,groovy]
----
implementation group: 'de.gesundkrank.fzf4j', name: 'fzf4j', version: 'VERSION'
----

=== Example

.Create FZF instance
[source,java]
----
Fzf fzf = Fzf.builder()
.reverse()
.orderBy(OrderBy.SCORE)
.normalize()
.build();
----

.Select single item
[source,java]
----
String selectedItem = fzf.select(list);
----

.Select multiple items
[source,java]
----
List selectedItems = fzf.multiSelect(list);
----

.Limit the number of selectable items
[source,java]
----
List selectedItems = fzf.multiSelect(list, 5);
----