Skip to content

A @mention system for JavaFX; uses the lovely Tribute written in JavaScript.

License

Notifications You must be signed in to change notification settings

TurekBot/TributeFX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TributeFX

A @mention engine for JavaFX.

Motivation

I looked high and low for a JavaFX @mention engine—no luck.

I welcome the day that there is one, but until then, here's a wrapper for the JavaScript, Native @mention engine, Tribute.js.

Getting Started

  • Coming Soon: Maven Central

Or

  • Clone the repo from here
    • In the root of the project run mvn clean install
    • Either:
      • Add the resulting jar (according to your IDE's instructions) as a dependency
      • Include TributeFX as a dependency in your maven project
<dependency>
    <groupId>tech.ugma.customcomponents.tributefx</groupId>
    <artifactId>TributeFX</artifactId>
    <version>0.3.0</version>
</dependency>

Demo

Hunger Games Demo

Quickstart Example

To just try it out, make a WebView and do:

TributeFX.tributifyWebView(webView);
TributeFX.addMentionables(TributeFX.createSampleMentionableList(), webView.getEngine());

See the DemoWithDefaults for such a working example.

Adding Mentionables

If you're keeping it simple, use, SimpleMentionable

ArrayList<SimpleMentionable> mentionables = new ArrayList<>();
mentionables.add(new SimpleMentionable("key", "value"));
mentionables.add(new SimpleMentionable("John Sample", "jjSwample22"));

TributeFX.addMentionables(webView, mentionables);

To pass in more attributes, like an email, see Mentionable's Documentation.

Once you've cut your teeth on the basics, you can whip out some JavaScript and get custom with it:

InputStream customConfig = DemoWithCustomConfig.class.getResourceAsStream("customTributeConfiguration.js");

TributeFX.tributifyWebView(webView, customConfig);

WebEngine webEngine = webView.getEngine();
ArrayList<TributeFX.SimpleMentionable> mentionables = TributeFX.createSampleMentionableList();

TributeFX.addMentionables(mentionables, webEngine);

See DemoWithCustomConfig to really get jiggy with it.

Possible Use Cases

  • Mentioning people
  • Hashtags
  • Category tags

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository

Authors

  • Zurb - JavaScript @mention Engine - Tribute
  • Bradley Turek - Initial Wrapping of Tribute

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A @mention system for JavaFX; uses the lovely Tribute written in JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published