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: 24 days 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-09-06T14:22:50.000Z (3 months ago)
- Last Synced: 2024-09-06T17:02:45.232Z (3 months ago)
- Language: Java
- Size: 459 KB
- Stars: 39
- Watchers: 6
- Forks: 11
- Open Issues: 2
-
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
### Support to buy a coffee?