A @mention
engine for JavaFX.
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.
- 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
- In the root of the project run
<dependency>
<groupId>tech.ugma.customcomponents.tributefx</groupId>
<artifactId>TributeFX</artifactId>
<version>0.3.0</version>
</dependency>
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.
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.
- Mentioning people
- Hashtags
- Category tags
We use SemVer for versioning. For the versions available, see the tags on this repository
- Zurb - JavaScript @mention Engine - Tribute
- Bradley Turek - Initial Wrapping of Tribute
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details