https://github.com/heapstats/sampleplugin
Sample plugin for HeapStatsFXAnalyzer to use as template project.
https://github.com/heapstats/sampleplugin
Last synced: about 1 year ago
JSON representation
Sample plugin for HeapStatsFXAnalyzer to use as template project.
- Host: GitHub
- URL: https://github.com/heapstats/sampleplugin
- Owner: HeapStats
- License: gpl-2.0
- Created: 2015-09-16T00:51:14.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-11-11T01:11:34.000Z (over 6 years ago)
- Last Synced: 2025-02-22T23:12:52.024Z (over 1 year ago)
- Language: Java
- Size: 17.6 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**If you want to create plugin for HeapStats Analyzer v2.1 or earlier, please see [for2.2](https://github.com/HeapStats/SamplePlugin/tree/for2.2) branch.**
# SamplePlugin
Sample plugin for HeapStats Analyzer to use as template project.
## Build
```
$ mvn package
```
## How to use
1. Move sample plugin jar to `lib` in HeapStats Analyzer
```
$ mv target/heapstats-analyzer-plugin-sample.jar /path/to/HeapStatsAnalyzer/lib/
$ vim /path/to/HeapStatsAnalyzer/heapstats.properties
```
2. Set plugin FQCN to `plugin` entry as below:
```
plugins=jp.co.ntt.oss.heapstats.plugin.sample
```
3. run HeapStats Analyzer

# How to create your plugin
HeapStats Analyzer provides a tab window per controllers (plugins) as below.

You can create your plugin by the below steps.
1. Create a Controller class which is extended `jp.co.ntt.oss.heapstats.plugin.PluginController` like [SampleMainController.java](https://github.com/HeapStats/SamplePlugin/blob/master/src/main/java/jp/co/ntt/oss/heapstats/plugin/sample/SampleMainController.java).
2. Create FXML and CSS file to design your view.
* Example: [src/main/resources/../sample](https://github.com/HeapStats/SamplePlugin/tree/master/src/main/resources/jp/co/ntt/oss/heapstats/plugin/sample)
## Tips: Run your plugin as standalone
If you want to run your plugin as standalone, you need
* a main class to launch your plugin.
* For example, sample plugin includes main class ([SamplePlugin.java](https://github.com/HeapStats/SamplePlugin/blob/master/src/main/java/jp/co/ntt/oss/heapstats/plugin/sample/SamplePlugin.java))
* to set `heapstats-analyzer.jar` in the classpath
* `java -cp .:/path/to/heapstats-analyzer.jar:/path/to/yourplugin.jar `
## Tips: Separate Controller
If you want to separate your big controller and FXML file, you can separate the nested FXML file like sample plugin.

* [MainController](https://github.com/HeapStats/SamplePlugin/tree/master/src/main/java/jp/co/ntt/oss/heapstats/plugin/sample)
* [TabController](https://github.com/HeapStats/SamplePlugin/tree/master/src/main/java/jp/co/ntt/oss/heapstats/plugin/sample/tabs)
See also [Oracle's documentation](https://docs.oracle.com/javase/8/javafx/api/javafx/fxml/doc-files/introduction_to_fxml.html#nested_controllers).
# How to enable your plugin
You can enable your plugin by below steps.
1. Set your plugin ( `*.jar` ) to `lib` directory of HeapStats Analyzer.
2. Edit `plugins` properties in `heapstats.properties` to add a package of your Controller.