|
| 1 | +package io.github.gleidsonmt.dashboardfx.presentation.util; |
| 2 | + |
| 3 | +import io.github.gleidsonmt.dashboardfx.presentation.CustomizablePresentation; |
| 4 | +import io.github.gleidsonmt.dashboardfx.presentation.internal.Tutorial; |
| 5 | + |
| 6 | +public class TipsPres extends CustomizablePresentation { |
| 7 | + |
| 8 | + public TipsPres() { |
| 9 | + super("Tips"); |
| 10 | + } |
| 11 | + |
| 12 | + @Override |
| 13 | + public Tutorial create() { |
| 14 | + return new Tutorial() |
| 15 | + .h3("Tips") |
| 16 | + .text("Practical tips for developing and contributing to DashboardFx.") |
| 17 | + .h4("Use the Gradle Wrapper", "Tips") |
| 18 | + .text(""" |
| 19 | + Use the wrapper included in the repository instead of a system Gradle installation. |
| 20 | + It runs the project with the Gradle version expected by the build. |
| 21 | + """) |
| 22 | + .code(".\\gradlew build\n.\\gradlew run", "bash") |
| 23 | + .h4("Install the theme first", "Tips") |
| 24 | + .text(""" |
| 25 | + Install the required theme styles on the Scene before using their style classes. |
| 26 | + This ensures that controls are styled correctly when they are displayed. |
| 27 | + """) |
| 28 | + .code("ThemeProvider.install(scene, Css.ALL, Font.INSTAGRAM);", "java") |
| 29 | + .h4("Clone with submodules", "Tips") |
| 30 | + .text(""" |
| 31 | + Clone the repository with its submodules so that the glad, presentation, |
| 32 | + and blockcode projects are available locally. |
| 33 | + """) |
| 34 | + .code("git clone --recursive https://github.com/gleidsonmt/DashboardFx.git", "bash") |
| 35 | + .h4("Synchronize submodules", "Tips") |
| 36 | + .text(""" |
| 37 | + After switching branches or pulling changes, update the submodules to the commits |
| 38 | + recorded by the current DashboardFx branch. |
| 39 | + """) |
| 40 | + .code("git submodule update --init --recursive", "bash") |
| 41 | + .h4("Debug the running application", "Tips") |
| 42 | + .text(""" |
| 43 | + Start the application with JVM debugging enabled, then attach the debugger from your IDE. |
| 44 | + This is useful for inspecting event handlers, bindings, and runtime state. |
| 45 | + """) |
| 46 | + .code(".\\gradlew run --debug-jvm", "bash") |
| 47 | + .h4("Use development tools carefully", "Tips") |
| 48 | + .text(""" |
| 49 | + ScenicView and CSSFX can inspect the scene graph and reload CSS during development. |
| 50 | + Enable LibrariesTools only while debugging and keep these tools out of packaged builds. |
| 51 | + """) |
| 52 | + .code("LibrariesTools.addTools(stage.getScene());", "java") |
| 53 | + .h4("Keep CSS in the correct layer", "Tips") |
| 54 | + .text(""" |
| 55 | + Use ThemeProvider and Css values for shared glad styles. |
| 56 | + Use Assets.getCss for DashboardFx resources such as master.css and project-specific overrides. |
| 57 | + """) |
| 58 | + .code(""" |
| 59 | + ThemeProvider.install(scene, Css.ALL); |
| 60 | + scene.getStylesheets().add(Assets.getCss("master.css")); |
| 61 | + """, "java") |
| 62 | + .h4("Keep pull requests focused", "Tips") |
| 63 | + .text(""" |
| 64 | + Keep each pull request focused on one task. |
| 65 | + Avoid unrelated formatting, generated files, IDE settings, or accidental submodule changes. |
| 66 | + """) |
| 67 | + .h4("Use the Css enum", "Tips") |
| 68 | + .text(""" |
| 69 | + Prefer Css enum values instead of hard-coded stylesheet paths. |
| 70 | + This makes theme dependencies easier to understand and maintain. |
| 71 | + """) |
| 72 | + .code("ThemeProvider.install(scene, Css.BUTTON, Css.COLORS);", "java"); |
| 73 | + } |
| 74 | +} |
0 commit comments