GithubHelp home page GithubHelp logo

ben12 / infxnity Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 592 KB

JavaFX "to infinity and beyond"

Home Page: https://infxnity.ben12.eu

License: MIT License

Java 100.00%
java java8 java-8 javafx javafx-library maskedtextfield javafx-8 maskedinput maskededittext binding

infxnity's Introduction

infxnity

JavaFX "to infinity and beyond"

GitHub license Build Status Quality Gate

Quality Gate Quality Gate Quality Gate

Features

Example to create a TextField allowing only french phone numbers:

final TextField textField = new TextField();
final MaskCharacter[] mask = MaskBuilder.newBuilder()
	.appendLiteral("+33 ")
	.appendDigit('6')
	.appendLiteral(" ")
	.appendDigit(2)
	.appendLiteral(" ")
	.appendDigit(2)
	.appendLiteral(" ")
	.appendDigit(2)
	.appendLiteral(" ")
	.appendDigit(2)
	.build();
textField.setTextFormatter(new TextFormatter<>(new MaskTextFilter(textField, false, mask)));

Default text will be "+33 6 00 00 00 00".
Caret will be placed in 4th position : "+33 |6 00 00 00 00".
Navigate to the right will do that:
"+33 6 |00 00 00 00"
"+33 6 0|0 00 00 00"
"+33 6 00 |00 00 00"
"+33 6 00 0|0 00 00"
"+33 6 00 00 |00 00"
"+33 6 00 00 0|0 00"
"+33 6 00 00 00 |00"
"+33 6 00 00 00 0|0"
"+33 6 00 00 00 00|"

An ObservableList(s) aggregation.
All events of aggregated ObservableList(s) are forwarded.
The list of aggregated ObservableList(s) can be modified to add, remove or replace one or more of the aggregated ObservableList(s). An appropriate event will be fired.
An instance of ObservableListAggregation is a read only list. Any attempt to modify the list will throw an UnsupportedOperationException.

Example:

final ObservableList<Integer> list1 = FXCollections.observableArrayList(0, 1, 2);
final ObservableList<Integer> list2 = FXCollections.observableArrayList(3, 4);
final ObservableList<Integer> list3 = FXCollections.observableArrayList(5, 6);

final ObservableListAggregation<Integer> aggregation = new ObservableListAggregation<>(list1, list2);
System.out.println(aggregation); // [0, 1, 2, 3, 4]

aggregation.getLists().add(list3);
System.out.println(aggregation); // [0, 1, 2, 3, 4, 5, 6]

list1.add(0, -1);
System.out.println(aggregation); // [-1, 0, 1, 2, 3, 4, 5, 6]

list3.remove(Integer.valueOf(6));
System.out.println(aggregation); // [-1, 0, 1, 2, 3, 4, 5]

aggregation.getLists().remove(list1);
System.out.println(aggregation); // [3, 4, 5]

Used to bind a list to an ObservableList with a type conversion.

Example:

ObservableList<Person> personList = FXCollections.observableArrayList(person -> new Observable[] { person.nameProperty() });
ObservableList<String> personNameList = FXCollections.observableArrayList();

IFXContentBinding.bind(personNameList, personList, Person::getName);

System.out.println(personNameList); // []

personList.add(new Person("Bob"));
System.out.println(personNameList); // [Bob]

personList.addAll(new Person("Fred"), new Person("John"));
System.out.println(personNameList); // [Bob, Fred, John]

personList.get(0).setName("George");
System.out.println(personNameList); // [George, Fred, John]

infxnity's People

Contributors

ben12 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.