Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panemu/tiwulfx-dock
https://github.com/panemu/tiwulfx-dock
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/panemu/tiwulfx-dock
- Owner: panemu
- License: mit
- Created: 2020-10-31T15:14:03.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-16T08:52:13.000Z (9 months ago)
- Last Synced: 2024-06-26T18:56:13.179Z (4 months ago)
- Language: Java
- Size: 441 KB
- Stars: 36
- Watchers: 6
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- aboutfx - TiwulFX Dock - dock?style=social>) | `#controls` | Enhanced `TabPane` that supports tab reordering, detaching and docking | (Community / Libraries)
README
# TiwulFX Dock
[![JFXCentral](https://img.shields.io/badge/Find_me_on-JFXCentral-blue?logo=googlechrome&logoColor=white)](https://www.jfx-central.com/libraries/tiwulfxdock)
TiwulFX-Dock provides enhanced JavaFX TabPane that supports tab reordering, detaching and docking.
![Demo](media/tiwulfx-dock-demo.gif)
## Usage
Check latest release version in [maven repo](https://repo1.maven.org/maven2/com/panemu/tiwulfx-dock/). Maven dependency:
```com.panemu
tiwulfx-dock
${version.tiwulfx-docx}```
Wrap DetachableTabPane inside a SplitPane. Below is an example in FXML file:
```
```
Then if the java class file has a variable holding reference to the DetachableTabPane, then add this
```
myTabPane.setOnClosedPassSibling((sibling) -> myTabPane = sibling);
```## Customization
All of the following customization examples are shown in the demo projects.
When a tab is detached, a stage is created. Set the owner of the stage with this code:
```
myTabPane.setStageOwnerFactory((stage) -> getScene().getWindow());
```To customize how detached stage looks like, use custom scene factor as follow:
```
myTabPane.setSceneFactory((param) -> {
FrmScope1 frm = new FrmScope1();
SplitPane sp = new SplitPane(param);
VBox.setVgrow(sp, Priority.ALWAYS);
frm.getChildren().add(sp);
Scene scene1 = new Scene(frm);
return scene1;
});
```Take a look at styles in [tiwulfx-dock.css](https://github.com/panemu/tiwulfx-dock/blob/main/src/main/resources/com/panemu/tiwulfx/control/dock/tiwulfx-dock.css).
Provide your own version of the styles to override the style of drop guiding path and adjacent drop buttons. For a further customization of the drag-drop indicator, extends [TabDropHint](https://github.com/panemu/tiwulfx-dock/blob/main/src/main/java/com/panemu/tiwulfx/control/dock/TabDropHint.java) class
and supply the instance of it to the tab pane:
```
myTabPane.setDropHint(new CustomDropHint());
```All these customization examples are shown in the demo projects.
## License
MIT