├── .github └── FUNDING.yml ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE.txt ├── README.md ├── drombler-fx-core-action ├── pom.xml └── src │ └── main │ └── java │ ├── module-info.java │ └── org │ └── drombler │ └── fx │ └── core │ └── action │ ├── FXContextMenuMenuItemContainer.java │ ├── FXMenuBarMenuContainer.java │ ├── FXTextMenuItemSortingStrategy.java │ ├── ToolBarContainerPane.java │ ├── impl │ ├── FXActionFactory.java │ ├── FXActionUtils.java │ ├── FXMenuFactory.java │ ├── FXMenuItemFactory.java │ ├── FXMenuMenuItemContainer.java │ ├── FXMenuMenuItemContainerFactory.java │ ├── FXSeparatorMenuItemFactory.java │ ├── FXToggleActionFactory.java │ ├── FXToggleMenuItemFactory.java │ ├── FXToolBarButtonFactory.java │ ├── FXToolBarFactory.java │ ├── FXToolBarToggleButtonFactory.java │ └── ToggleGroupManager.java │ └── package-info.java ├── drombler-fx-core-application ├── pom.xml └── src │ └── main │ └── java │ ├── module-info.java │ └── org │ └── drombler │ └── fx │ └── core │ └── application │ ├── ApplicationContentProvider.java │ ├── MainSceneRootProvider.java │ ├── OnExitRequestHandlerProvider.java │ ├── impl │ ├── AdditionalArgumentsProviderHandler.java │ ├── FXApplicationThreadExecutorProvider.java │ ├── MainSceneRootHandler.java │ ├── MainWindowOnCloseRequestHandler.java │ └── package-info.java │ └── package-info.java ├── drombler-fx-core-commons └── pom.xml ├── drombler-fx-core-data-l10n-de ├── pom.xml └── src │ └── main │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── data │ └── impl │ └── FXFileChooserProvider_de.properties ├── drombler-fx-core-data ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── drombler │ │ └── fx │ │ └── core │ │ └── data │ │ └── impl │ │ ├── FXDirectoryChooserProvider.java │ │ ├── FXFileChooserProvider.java │ │ └── package-info.java │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── data │ └── impl │ └── FXFileChooserProvider.properties ├── drombler-fx-core-docking-l10n-de ├── pom.xml └── src │ └── main │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── docking │ ├── FXDockableDataUtils_de.properties │ └── impl │ └── DockingPaneProvider_de.properties ├── drombler-fx-core-docking ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── drombler │ │ └── fx │ │ └── core │ │ └── docking │ │ ├── FXDockableDataUtils.java │ │ ├── impl │ │ ├── DockingPaneProvider.java │ │ ├── OnExitRequestHandlerProviderImpl.java │ │ └── package-info.java │ │ └── package-info.java │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── docking │ ├── FXDockableDataUtils.properties │ └── impl │ └── DockingPaneProvider.properties ├── drombler-fx-core-standard-action-l10n-de ├── pom.xml └── src │ └── main │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── standard │ └── action │ └── impl │ └── Bundle_de.properties ├── drombler-fx-core-standard-action ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── drombler │ │ └── fx │ │ └── core │ │ └── standard │ │ └── action │ │ └── impl │ │ └── ExitAction.java │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── standard │ └── action │ └── impl │ └── ExitAction.properties ├── drombler-fx-core-standard-desktop-classic ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── drombler │ │ └── fx │ │ └── core │ │ └── standard │ │ └── desktop │ │ └── classic │ │ └── impl │ │ ├── ClassicDesktopApplicationPane.java │ │ ├── ClassicDesktopRootNodeProvider.java │ │ ├── ContentHandler.java │ │ └── ContentPaneProvider.java │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── standard │ └── desktop │ └── classic │ └── impl │ └── ClassicDesktopApplicationPane.fxml ├── drombler-fx-core-standard-status ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── drombler │ │ └── fx │ │ └── core │ │ └── standard │ │ └── status │ │ └── impl │ │ └── ProgressMonitorStatusBarElement.java │ └── resources │ └── org │ └── drombler │ └── fx │ └── core │ └── standard │ └── status │ └── impl │ └── ProgressMonitorStatusBarElement.fxml ├── drombler-fx-core-status ├── pom.xml └── src │ └── main │ └── java │ ├── module-info.java │ └── org │ └── drombler │ └── fx │ └── core │ └── status │ ├── FXStatusBarElementContainer.java │ └── package-info.java ├── drombler-fx-docs ├── nbactions.xml ├── pom.xml └── src │ └── main │ ├── asciidoc │ ├── gh-pages │ │ ├── docs │ │ │ └── index.adoc │ │ └── index.adoc │ └── tutorial │ │ ├── actions-menus-toolbars.adoc │ │ ├── application-layout.adoc │ │ ├── context-framework.adoc │ │ ├── data-framework.adoc │ │ ├── docking-framework.adoc │ │ ├── extensions.adoc │ │ ├── getting-started.adoc │ │ ├── ide.adoc │ │ ├── index.adoc │ │ ├── localization.adoc │ │ ├── logging.adoc │ │ ├── progress-monitor.adoc │ │ ├── single-instance-application.adoc │ │ └── status-bar.adoc │ ├── bash │ └── tutorial │ │ └── getting-started │ │ ├── build-sample.sh │ │ ├── generate-sample.sh │ │ ├── run1-sample.sh │ │ └── run2-sample.sh │ ├── images-raw │ └── tutorial │ │ ├── docking │ │ ├── docking-areas-tutorial-raw.fxml │ │ ├── docking-areas-tutorial-raw.png │ │ ├── docking-areas-tutorial-raw.xcf │ │ └── docking-areas-tutorial.odg │ │ ├── layout │ │ └── standard-desktop-classic-layout.xcf │ │ └── progressmonitor │ │ ├── progress-monitor.odg │ │ └── progress-monitor.png │ ├── images │ └── tutorial │ │ ├── docking │ │ └── docking-areas-tutorial.png │ │ ├── getting-started │ │ ├── drombler-sample-application.png │ │ └── unsaved-editors-on-closing-window.png │ │ ├── layout │ │ └── standard-desktop-classic-layout.png │ │ └── progressmonitor │ │ └── progress-monitor.png │ ├── java │ ├── module-info.java │ └── tutorial │ │ ├── action │ │ ├── AnnotatedAction.java │ │ ├── AnnotatedMenuEntry.java │ │ ├── AnnotatedToolBarEntry.java │ │ ├── Test1Action.java │ │ ├── Test1ToggleAction.java │ │ ├── Test2Action.java │ │ ├── Test2ToggleAction.java │ │ ├── Test3Action.java │ │ ├── menu │ │ │ └── package-info.java │ │ ├── sample │ │ │ ├── MyCommand.java │ │ │ └── impl │ │ │ │ ├── MyAction1.java │ │ │ │ ├── MyAction2.java │ │ │ │ ├── MyAction3.java │ │ │ │ └── MyToggleAction.java │ │ └── toolbar │ │ │ └── package-info.java │ │ ├── data │ │ ├── Bar.java │ │ ├── BarHandler.java │ │ ├── FooHandler.java │ │ └── package-info.java │ │ ├── docking │ │ ├── DockableEditor.java │ │ ├── DockableView.java │ │ ├── Foo.java │ │ ├── FooHandler.java │ │ ├── MyViewPane.java │ │ └── package-info.java │ │ ├── extension │ │ ├── foo │ │ │ ├── Foo.java │ │ │ ├── FooDescriptor.java │ │ │ ├── ProgrammaticFooRegistrar.java │ │ │ ├── impl │ │ │ │ ├── FooAnnotationProcessor.java │ │ │ │ ├── FooComponent1.java │ │ │ │ ├── FooComponent2.java │ │ │ │ ├── FooExtensionPoint.java │ │ │ │ └── FooHandler.java │ │ │ ├── jaxb │ │ │ │ ├── FooType.java │ │ │ │ └── FoosType.java │ │ │ └── package-info.java │ │ ├── other │ │ │ ├── SomeOtherAnnotation.java │ │ │ ├── impl │ │ │ │ ├── SomeOtherAnnotationProcessor.java │ │ │ │ └── SomeOtherComponent.java │ │ │ ├── package1 │ │ │ │ └── Bar1.java │ │ │ └── package2 │ │ │ │ └── Bar2.java │ │ └── some │ │ │ ├── Sample.java │ │ │ ├── SomeAnnotation.java │ │ │ └── impl │ │ │ ├── SomeAnnotationProcessor.java │ │ │ └── SomeComponent.java │ │ ├── progressmonitor │ │ ├── Foo.java │ │ └── WorkerProvider.java │ │ └── statusbar │ │ └── SampleStatusBarElement.java │ └── resources │ ├── META-INF │ ├── drombler │ │ ├── application.xml │ │ └── foos.xml │ └── services │ │ └── javax.annotation.processing.Processor │ └── tutorial │ └── docking │ └── MyViewPane.fxml ├── drombler-fx-l10n-all └── pom.xml ├── drombler-fx-l10n-de └── pom.xml ├── drombler-fx-maven-archetype-application ├── pom.xml └── src │ └── main │ ├── icons │ ├── blue-circle16.xcf │ ├── blue-circle24.xcf │ ├── blue-rectangle16.xcf │ ├── blue-rectangle24.xcf │ ├── bottom-test-pane.svg │ ├── foo.svg │ ├── left-test-pane.svg │ ├── red-circle16.xcf │ ├── red-circle24.xcf │ ├── red-rectangle16.xcf │ ├── red-rectangle24.xcf │ ├── right-test-pane.svg │ ├── sample.svg │ ├── top-test-pane.svg │ ├── yellow-circle16.xcf │ ├── yellow-circle24.xcf │ ├── yellow-rectangle16.xcf │ └── yellow-rectangle24.xcf │ └── resources │ ├── META-INF │ └── maven │ │ └── archetype-metadata.xml │ └── archetype-resources │ ├── __rootArtifactId__-application │ ├── nb-configuration.xml │ ├── nbactions.xml │ ├── pom.xml │ └── src │ │ └── main │ │ └── app │ │ ├── bin │ │ └── __brandingId__.sh │ │ └── conf │ │ ├── config.properties │ │ ├── logging.properties │ │ └── system.properties │ ├── __rootArtifactId__-foo │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── foo │ │ │ └── impl │ │ │ ├── FooEditorPane.java │ │ │ ├── FooHandler.java │ │ │ ├── FooUtils.java │ │ │ ├── NewAction.java │ │ │ └── package-info.java │ │ ├── resources-bin │ │ └── foo │ │ │ └── impl │ │ │ └── foo16.png │ │ └── resources │ │ └── foo │ │ └── impl │ │ ├── Bundle.properties │ │ ├── FooEditorPane.fxml │ │ ├── FooEditorPane.properties │ │ ├── NewAction.properties │ │ └── fooTemplate.txt │ ├── __rootArtifactId__-parent │ └── pom.xml │ ├── __rootArtifactId__-sample │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── sample │ │ │ ├── ColoredCircle.java │ │ │ ├── ColoredCircleManager.java │ │ │ ├── ColoredRectangle.java │ │ │ ├── ColoredRectangleManager.java │ │ │ ├── Sample.java │ │ │ ├── SampleHandler.java │ │ │ └── impl │ │ │ ├── AbstractColoredCircleAction.java │ │ │ ├── AbstractColoredRectangleAction.java │ │ │ ├── BlueCircleAction.java │ │ │ ├── BlueRectangleAction.java │ │ │ ├── BottomTestPane.java │ │ │ ├── LeftTestPane.java │ │ │ ├── RedCircleAction.java │ │ │ ├── RedRectangleAction.java │ │ │ ├── RightTestPane.java │ │ │ ├── SampleEditorPane.java │ │ │ ├── SampleServiceClient.java │ │ │ ├── Test1.java │ │ │ ├── Test2.java │ │ │ ├── Test3.java │ │ │ ├── TopTestPane.java │ │ │ ├── YellowCircleAction.java │ │ │ ├── YellowRectangleAction.java │ │ │ └── package-info.java │ │ ├── resources-bin │ │ └── sample │ │ │ └── impl │ │ │ ├── blue-circle16.png │ │ │ ├── blue-circle24.png │ │ │ ├── blue-rectangle16.png │ │ │ ├── blue-rectangle24.png │ │ │ ├── bottom-test-pane16.png │ │ │ ├── left-test-pane16.png │ │ │ ├── red-circle16.png │ │ │ ├── red-circle24.png │ │ │ ├── red-rectangle16.png │ │ │ ├── red-rectangle24.png │ │ │ ├── right-test-pane16.png │ │ │ ├── sample16.png │ │ │ ├── top-test-pane16.png │ │ │ ├── yellow-circle16.png │ │ │ ├── yellow-circle24.png │ │ │ ├── yellow-rectangle16.png │ │ │ └── yellow-rectangle24.png │ │ └── resources │ │ └── sample │ │ └── impl │ │ ├── BlueCircleAction.properties │ │ ├── BlueRectangleAction.properties │ │ ├── BottomTestPane.fxml │ │ ├── BottomTestPane.properties │ │ ├── Bundle.properties │ │ ├── LeftTestPane.fxml │ │ ├── LeftTestPane.properties │ │ ├── RedCircleAction.properties │ │ ├── RedRectangleAction.properties │ │ ├── RightTestPane.fxml │ │ ├── SampleEditorPane.fxml │ │ ├── TopTestPane.fxml │ │ ├── TopTestPane.properties │ │ ├── YellowCircleAction.properties │ │ └── YellowRectangleAction.properties │ └── pom.xml ├── drombler-fx-maven-plugin ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── drombler │ │ │ └── fx │ │ │ └── maven │ │ │ └── plugin │ │ │ ├── AbstractDromblerMojo.java │ │ │ ├── CopyStandaloneAppResourcesMojo.java │ │ │ ├── CopyStandaloneBundlesMojo.java │ │ │ ├── CopyStandaloneStartupLibsMojo.java │ │ │ ├── CreateApplicationZipMojo.java │ │ │ ├── CreateStandaloneDirMojo.java │ │ │ ├── CreateStandaloneJarMojo.java │ │ │ ├── EnsureStandaloneConfigMojo.java │ │ │ ├── GenerateApplicationResourcesMojo.java │ │ │ ├── SetMavenProperties.java │ │ │ └── util │ │ │ ├── JAPMavenPluginUtils.java │ │ │ ├── JavaFXMavenPluginUtils.java │ │ │ ├── ModuleNameUtils.java │ │ │ ├── PathUtils.java │ │ │ ├── PluginCoordinates.java │ │ │ └── PluginProperty.java │ └── resources │ │ ├── META-INF │ │ └── plexus │ │ │ └── components.xml │ │ └── conf │ │ ├── config.properties │ │ └── system.properties │ └── test │ └── java │ └── org │ └── drombler │ └── fx │ └── maven │ └── plugin │ └── util │ └── ModuleNameUtilsTest.java ├── drombler-fx-parent └── pom.xml ├── drombler-fx-startup-main ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── drombler │ │ └── fx │ │ └── startup │ │ └── main │ │ ├── DromblerFXApplication.java │ │ ├── DromblerFXConfiguration.java │ │ ├── impl │ │ └── DefaultRootPane.java │ │ └── package-info.java │ └── resources │ └── org │ └── drombler │ └── fx │ └── startup │ └── main │ └── config.properties ├── javafx-11 ├── pom.xml └── src │ └── main │ └── java │ └── newpackage │ └── NewClass.java ├── javafx-8 ├── pom.xml └── src │ └── main │ └── java │ └── newpackage │ └── NewClass.java ├── nbactions.xml ├── pom.xml └── src └── main ├── blog ├── drombler-sample-application-editor-icon-java.png ├── drombler-sample-application-editor-icon.png ├── drombler-sample-application-icons-small.png ├── drombler-sample-application-icons.png ├── drombler-sample-application-java.png ├── progress-monitor.png └── unsaved-editors-on-closing-window.png ├── gh-pages-raw ├── drombler16.png └── drombler32.png ├── gh-pages └── favicon.ico └── wiki ├── drombler-icon-420.png └── drombler-icon.svg /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [Drombler] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | ### STS ### 14 | .apt_generated 15 | .classpath 16 | .factorypath 17 | .project 18 | .settings 19 | .springBeans 20 | .sts4-cache 21 | 22 | # Package Files # 23 | *.jar 24 | *.war 25 | *.nar 26 | *.ear 27 | *.zip 28 | *.tar.gz 29 | *.rar 30 | 31 | ### IntelliJ IDEA ### 32 | .idea 33 | *.iws 34 | *.iml 35 | *.ipr 36 | 37 | ### NetBeans ### 38 | /nbproject/private/ 39 | /build/ 40 | /nbbuild/ 41 | /dist/ 42 | /nbdist/ 43 | /.nb-gradle/ 44 | 45 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 46 | hs_err_pid* 47 | 48 | /target/ 49 | /drombler-fx-docs/target/ 50 | /drombler-fx-parent/target/ 51 | /drombler-fx-startup-main/target/ 52 | /drombler-fx-core-action/target/ 53 | /drombler-fx-core-docking/target/ 54 | /drombler-fx-l10n-de/target/ 55 | /drombler-fx-core-application/target/ 56 | /drombler-fx-l10n-all/target/ 57 | /drombler-fx-maven-plugin/target/ 58 | /drombler-fx-maven-archetype-application/target/ 59 | /drombler-fx-core-standard-desktop-classic/target/ 60 | /drombler-fx-core-data/target/ 61 | /drombler-fx-core-data-l10n-de/target/ 62 | /drombler-fx-core-docking-l10n-de/target/ 63 | /drombler-fx-core-status/target/ 64 | /drombler-fx-core-standard-status/target/ 65 | /drombler-fx-core-standard-action/target/ 66 | /drombler-fx-core-standard-action-l10n-de/target/ 67 | /javafx-11/target/ 68 | /javafx-8/target/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | 5 | sudo: false 6 | addons: 7 | apt: 8 | packages: 9 | - oracle-java8-installer 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | Please have a look at the Drombler [how to contribute page](http://www.drombler.org/contribute) for more information. 4 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | @Library('softsmithy-oss-jenkinsfilelib') _ 2 | 3 | javalib(ProjectType.JAVA_LIB, 'Apache Maven 3.6', 'Java SE 11') 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Drombler FX 2 | =========== 3 | 4 | The modular application framework for *JavaFX* based on: 5 | 6 | - **OSGi**: *OSGi* is the de facto standard for writing modular software in *Java*. 7 | 8 | - **Maven (POM-first)**: *Drombler FX* applications can be build with *Maven*. The build follows the standard POM-first approach (the OSGi meta data will be generated for you). A custom Maven Plugin will help you to easily create *JavaFX* applications with Maven. A custom Maven Archetype will help you to get started. 9 | 10 | - **Declarative programming model**: Annotations can be used at many places to register elements such as menus, toolbars and GUI components. 11 | 12 | - **Drombler ACP**: *Drombler FX* is a *JavaFX* specific extension for *Drombler ACP* providing *JavaFX*-based implementations for the abstract definitions. Read more about *Drombler ACP* here: [Drombler ACP](../drombler-acp) 13 | 14 | - **Drombler Commons**: *Drombler Commons* is a collection of reusable libraries and frameworks. They ship with *OSGi* meta data but don’t require an *OSGi* environment. Read more about *Drombler Commons* here: [Drombler Commons](../drombler-commons) 15 | 16 | *Drombler FX* uses [Apache Felix](http://felix.apache.org) as its OSGi container by default. 17 | 18 | As an application framework it makes sure *JavaFX* and *OSGi* will get started properly and it provides the main window. 19 | 20 | See the [documentation](https://www.drombler.org/drombler-fx) for a tutorial, the Javadoc and information about the provided Maven modules (available from Maven Central). 21 | 22 | ## Build the project from sources 23 | ```bash 24 | mvn clean install 25 | ``` 26 | Please note that the develop branch (SNAPSHOT version) of the project might depend on SNAPSHOT versions of other projects. 27 | 28 | If you don't want to build the dependent projects as well, please make sure to define a proxy in your [Maven Repository Manager](https://maven.apache.org/repository-management.html) to the following Maven Repository: https://oss.sonatype.org/content/repositories/snapshots/ and include it in your [single group](https://help.sonatype.com/repomanager3/formats/maven-repositories#MavenRepositories-ConfiguringApacheMaven). 29 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.action { 2 | exports org.drombler.fx.core.action; 3 | 4 | requires org.drombler.acp.core.action; 5 | requires org.drombler.acp.core.action.spi; 6 | requires org.drombler.commons.action.fx; 7 | requires org.drombler.commons.fx.graphics; 8 | requires org.drombler.commons.fx.controls; 9 | requires org.apache.commons.lang3; 10 | requires osgi.cmpn; 11 | } -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/FXTextMenuItemSortingStrategy.java: -------------------------------------------------------------------------------- 1 | package org.drombler.fx.core.action; 2 | 3 | import java.text.Collator; 4 | import javafx.scene.control.MenuItem; 5 | import org.drombler.acp.core.action.MenuItemSortingStrategy; 6 | import org.drombler.acp.core.action.TextMenuItemSortingStrategy; 7 | 8 | /** 9 | * A JavaFX specific extension of {@link TextMenuItemSortingStrategy}. This {@link MenuItemSortingStrategy} sorts the menu items depending on their text using a locale-sensitive comparison. This 10 | * sorting strategy does not add any separators. 11 | * 12 | * @author puce 13 | */ 14 | public class FXTextMenuItemSortingStrategy extends TextMenuItemSortingStrategy { 15 | 16 | /** 17 | * Creates a new instance of this class. 18 | */ 19 | public FXTextMenuItemSortingStrategy() { 20 | super(MenuItem::getText); 21 | } 22 | 23 | /** 24 | * Creates a new instance of this class. 25 | * 26 | * @param collator the {@link Collator} to use for the locale-sensitive text comparison 27 | */ 28 | public FXTextMenuItemSortingStrategy(Collator collator) { 29 | super(MenuItem::getText, collator); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXActionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.event.ActionEvent; 18 | import javafx.event.EventHandler; 19 | import org.drombler.acp.core.action.spi.ActionDescriptor; 20 | import org.drombler.acp.core.action.spi.ActionFactory; 21 | import org.drombler.commons.action.ActionListener; 22 | import org.drombler.commons.action.fx.ActionEventHandlerAdapter; 23 | import org.drombler.commons.action.fx.ActionListenerAdapter; 24 | import org.drombler.commons.action.fx.FXAction; 25 | import org.osgi.service.component.annotations.Component; 26 | 27 | /** 28 | * 29 | * @author puce 30 | */ 31 | @Component 32 | public class FXActionFactory implements ActionFactory { 33 | 34 | @Override 35 | @SuppressWarnings("unchecked") 36 | public FXAction createAction(ActionDescriptor actionDescriptor) { 37 | Object listener = actionDescriptor.getListener(); 38 | FXAction fxAction = null; 39 | if (listener instanceof FXAction) { 40 | fxAction = (FXAction) listener; 41 | } else { 42 | if (listener instanceof EventHandler) { 43 | fxAction = new ActionEventHandlerAdapter((EventHandler) listener); 44 | } else if (listener instanceof ActionListener) { 45 | fxAction = new ActionListenerAdapter((ActionListener) listener); 46 | } 47 | } 48 | if (fxAction != null) { 49 | FXActionUtils.configureAction(fxAction, actionDescriptor); 50 | } 51 | return fxAction; 52 | } 53 | 54 | @Override 55 | public Class getActionClass() { 56 | return FXAction.class; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXActionUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.scene.input.KeyCombination; 18 | import org.apache.commons.lang3.StringUtils; 19 | import org.drombler.acp.core.action.spi.ActionDescriptor; 20 | import org.drombler.commons.action.fx.FXAction; 21 | import org.drombler.commons.fx.scene.image.IconFactory; 22 | 23 | /** 24 | * 25 | * @author puce 26 | */ 27 | public final class FXActionUtils { 28 | 29 | private FXActionUtils() { 30 | } 31 | 32 | public static void configureAction(FXAction fxAction, ActionDescriptor actionDescriptor) { 33 | fxAction.setDisplayName(actionDescriptor.getDisplayName()); 34 | if (StringUtils.isNotBlank(actionDescriptor.getAccelerator())) { 35 | fxAction.setAccelerator(KeyCombination.keyCombination(actionDescriptor.getAccelerator())); 36 | } 37 | if (StringUtils.isNotBlank(actionDescriptor.getIcon())) { 38 | IconFactory iconFactory = new IconFactory(actionDescriptor.getIcon(), actionDescriptor.getResourceLoader(), false); 39 | fxAction.setGraphicFactory(iconFactory); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXMenuFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.scene.control.Menu; 18 | import org.drombler.acp.core.action.spi.MenuDescriptor; 19 | import org.drombler.acp.core.action.spi.MenuFactory; 20 | import org.osgi.service.component.annotations.Component; 21 | 22 | /** 23 | * 24 | * @author puce 25 | */ 26 | @Component 27 | public class FXMenuFactory implements MenuFactory { 28 | 29 | @Override 30 | public Menu createMenu(MenuDescriptor menuDescriptor) { 31 | Menu menu = new Menu(menuDescriptor.getDisplayName()); 32 | menu.setMnemonicParsing(true); 33 | return menu; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXMenuItemFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.scene.control.MenuItem; 18 | import org.drombler.acp.core.action.spi.MenuItemFactory; 19 | import org.drombler.commons.action.fx.FXAction; 20 | import org.drombler.commons.action.fx.MenuItemUtils; 21 | import org.osgi.service.component.annotations.Component; 22 | 23 | /** 24 | * 25 | * @author puce 26 | */ 27 | @Component 28 | public class FXMenuItemFactory implements MenuItemFactory { 29 | 30 | @Override 31 | public MenuItem createMenuItem(FXAction action, int iconSize) { 32 | MenuItem menuItem = new MenuItem(); 33 | MenuItemUtils.configureMenuItem(menuItem, action, iconSize); 34 | return menuItem; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXMenuMenuItemContainerFactory.java: -------------------------------------------------------------------------------- 1 | package org.drombler.fx.core.action.impl; 2 | 3 | import javafx.scene.control.Menu; 4 | import javafx.scene.control.MenuItem; 5 | import org.drombler.acp.core.action.MenuItemSortingStrategy; 6 | import org.drombler.acp.core.action.MenuItemSupplierFactory; 7 | import org.drombler.acp.core.action.spi.AbstractMenuItemRootContainer; 8 | import org.drombler.acp.core.action.spi.MenuItemContainer; 9 | import org.drombler.acp.core.action.spi.MenuMenuItemContainerFactory; 10 | import org.drombler.acp.core.action.spi.SeparatorMenuItemFactory; 11 | import org.osgi.service.component.annotations.Component; 12 | 13 | /** 14 | * 15 | * @author puce 16 | */ 17 | @Component 18 | public class FXMenuMenuItemContainerFactory implements MenuMenuItemContainerFactory { 19 | 20 | @Override 21 | public > MenuItemContainer createMenuMenuItemContainer(String id, Menu menu, 22 | MenuItemContainer parentContainer, 23 | AbstractMenuItemRootContainer rootContainer, 24 | MenuItemSortingStrategy menuItemSortingStrategy, 25 | MenuMenuItemContainerFactory menuMenuItemContainerFactory, 26 | SeparatorMenuItemFactory separatorMenuItemFactory) { 27 | return new FXMenuMenuItemContainer<>(id, menu, parentContainer, rootContainer, menuItemSortingStrategy, menuMenuItemContainerFactory, separatorMenuItemFactory); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXSeparatorMenuItemFactory.java: -------------------------------------------------------------------------------- 1 | package org.drombler.fx.core.action.impl; 2 | 3 | import javafx.scene.control.SeparatorMenuItem; 4 | import org.drombler.acp.core.action.spi.SeparatorMenuItemFactory; 5 | import org.osgi.service.component.annotations.Component; 6 | 7 | /** 8 | * 9 | * @author puce 10 | */ 11 | @Component 12 | public class FXSeparatorMenuItemFactory implements SeparatorMenuItemFactory { 13 | 14 | @Override 15 | public SeparatorMenuItem createSeparatorMenuItem() { 16 | return new SeparatorMenuItem(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXToggleActionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import org.drombler.acp.core.action.spi.ToggleActionDescriptor; 18 | import org.drombler.acp.core.action.spi.ToggleActionFactory; 19 | import org.drombler.commons.action.ToggleActionListener; 20 | import org.drombler.commons.action.fx.FXToggleAction; 21 | import org.drombler.commons.action.fx.ToggleActionListenerAdapter; 22 | import org.osgi.service.component.annotations.Component; 23 | 24 | /** 25 | * 26 | * @author puce 27 | */ 28 | @Component 29 | public class FXToggleActionFactory implements ToggleActionFactory { 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public FXToggleAction createToggleAction(ToggleActionDescriptor actionDescriptor) { 34 | Object listener = actionDescriptor.getListener(); 35 | FXToggleAction fxToggleAction = null; 36 | if (listener instanceof FXToggleAction) { 37 | fxToggleAction = (FXToggleAction) listener; 38 | } else { 39 | if (listener instanceof ToggleActionListener) { 40 | fxToggleAction = new ToggleActionListenerAdapter((ToggleActionListener) listener); 41 | } 42 | } 43 | if (fxToggleAction != null) { 44 | FXActionUtils.configureAction(fxToggleAction, actionDescriptor); 45 | } 46 | return fxToggleAction; 47 | } 48 | 49 | @Override 50 | public Class getToggleActionClass() { 51 | return FXToggleAction.class; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXToggleMenuItemFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.scene.control.CheckMenuItem; 18 | import javafx.scene.control.MenuItem; 19 | import javafx.scene.control.RadioMenuItem; 20 | import org.apache.commons.lang3.StringUtils; 21 | import org.drombler.acp.core.action.spi.ToggleMenuEntryDescriptor; 22 | import org.drombler.acp.core.action.spi.ToggleMenuItemFactory; 23 | import org.drombler.commons.action.fx.FXToggleAction; 24 | import org.drombler.commons.action.fx.MenuItemUtils; 25 | import org.osgi.service.component.annotations.Component; 26 | 27 | /** 28 | * 29 | * @author puce 30 | */ 31 | @Component 32 | public class FXToggleMenuItemFactory implements ToggleMenuItemFactory { 33 | 34 | private final ToggleGroupManager toggleGroupManager = new ToggleGroupManager(); 35 | 36 | @Override 37 | public MenuItem createToggleMenuItem(ToggleMenuEntryDescriptor toggleMenuEntryDescriptor, FXToggleAction toggleAction, int iconSize) { 38 | if (StringUtils.isNotEmpty(toggleMenuEntryDescriptor.getToggleGroupId())) { 39 | RadioMenuItem menuItem = new RadioMenuItem(); 40 | MenuItemUtils.configureRadioMenuItem(menuItem, toggleAction, iconSize); 41 | toggleGroupManager.configureToggle(menuItem, toggleMenuEntryDescriptor.getToggleGroupId()); 42 | return menuItem; 43 | } else { 44 | CheckMenuItem menuItem = new CheckMenuItem(); 45 | MenuItemUtils.configureCheckMenuItem(menuItem, toggleAction, iconSize); 46 | return menuItem; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXToolBarButtonFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.scene.control.Button; 18 | import org.drombler.acp.core.action.spi.ToolBarButtonFactory; 19 | import org.drombler.commons.action.fx.ButtonUtils; 20 | import org.drombler.commons.action.fx.FXAction; 21 | import org.osgi.service.component.annotations.Component; 22 | 23 | /** 24 | * 25 | * @author puce 26 | */ 27 | @Component 28 | public class FXToolBarButtonFactory implements ToolBarButtonFactory { 29 | 30 | @Override 31 | public Button createToolBarButton(FXAction action, int iconSize) { 32 | Button button = new Button(); 33 | ButtonUtils.configureToolbarButton(button, action, iconSize); 34 | return button; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXToolBarFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.scene.control.ToolBar; 18 | import org.drombler.acp.core.action.spi.ToolBarDescriptor; 19 | import org.drombler.acp.core.action.spi.ToolBarFactory; 20 | import org.osgi.service.component.annotations.Component; 21 | 22 | /** 23 | * 24 | * @author puce 25 | */ 26 | @Component 27 | public class FXToolBarFactory implements ToolBarFactory { 28 | 29 | @Override 30 | public ToolBar createToolBar(ToolBarDescriptor toolBarDescriptor) { 31 | ToolBar toolBar = new ToolBar(); 32 | toolBar.setVisible(toolBarDescriptor.isVisible()); 33 | return toolBar; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/FXToolBarToggleButtonFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import javafx.scene.control.ToggleButton; 18 | import org.drombler.acp.core.action.spi.ToolBarToggleButtonFactory; 19 | import org.drombler.acp.core.action.spi.ToolBarToggleEntryDescriptor; 20 | import org.drombler.commons.action.fx.ButtonUtils; 21 | import org.drombler.commons.action.fx.FXToggleAction; 22 | import org.drombler.commons.fx.scene.control.XToggleButton; 23 | import org.osgi.service.component.annotations.Component; 24 | 25 | /** 26 | * 27 | * @author puce 28 | */ 29 | @Component 30 | public class FXToolBarToggleButtonFactory implements ToolBarToggleButtonFactory { 31 | 32 | private final ToggleGroupManager toggleGroupManager = new ToggleGroupManager(); 33 | 34 | @Override 35 | public ToggleButton createToolBarToggleButton(ToolBarToggleEntryDescriptor toolBarToggleEntryDescriptor, FXToggleAction action, int iconSize) { 36 | XToggleButton toggleButton = new XToggleButton(); 37 | ButtonUtils.configureToolbarToggleButton(toggleButton, action, iconSize); 38 | toggleGroupManager.configureToggle(toggleButton, toolBarToggleEntryDescriptor.getToggleGroupId()); 39 | return toggleButton; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/impl/ToggleGroupManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.action.impl; 16 | 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | import javafx.scene.control.Toggle; 20 | import javafx.scene.control.ToggleGroup; 21 | import org.apache.commons.lang3.StringUtils; 22 | 23 | /** 24 | * 25 | * @author puce 26 | */ 27 | class ToggleGroupManager { 28 | 29 | private final Map toggleGroups = new HashMap<>(); 30 | 31 | public void configureToggle(Toggle toggle, String toggleGroupId) { 32 | if (StringUtils.isNotEmpty(toggleGroupId)) { 33 | toggle.setToggleGroup(getToggleGroup(toggleGroupId)); 34 | } 35 | } 36 | 37 | private ToggleGroup getToggleGroup(String toggleGroupId) { 38 | if (!toggleGroups.containsKey(toggleGroupId)) { 39 | ToggleGroup toggleGroup = new ToggleGroup(); 40 | toggleGroups.put(toggleGroupId, toggleGroup); 41 | } 42 | return toggleGroups.get(toggleGroupId); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /drombler-fx-core-action/src/main/java/org/drombler/fx/core/action/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2014 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | /** 16 | * A JavaFX-based extension of the Drombler ACP Action Framework. 17 | */ 18 | package org.drombler.fx.core.action; 19 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.application { 2 | exports org.drombler.fx.core.application; 3 | 4 | requires javafx.graphics; 5 | requires org.drombler.acp.core.commons; 6 | requires org.drombler.acp.startup.main; 7 | requires transitive org.drombler.commons.fx.graphics; 8 | requires osgi.cmpn; 9 | requires org.slf4j; 10 | } -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/ApplicationContentProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.application; 16 | 17 | import javafx.scene.Node; 18 | 19 | /** 20 | * The ApplicationContentProvider service interface provides the application content node. An ApplicationContentProvider can be used by several {@link MainSceneRootProvider} service implementations. 21 | */ 22 | public interface ApplicationContentProvider { 23 | 24 | /** 25 | * Gets the application content node. 26 | * 27 | * @return the application content node 28 | */ 29 | Node getContentPane(); 30 | } 31 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/MainSceneRootProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2018 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.application; 16 | 17 | import javafx.scene.Parent; 18 | 19 | /** 20 | * The MainSceneRootProvider service interface provides the root parent node of the main scene.
21 | *
22 | * This root parent node can define the basic application layout. 23 | *
24 | * To make such an application layout more reusable it's recommended to get the main application content from an {@link ApplicationContentProvider}. 25 | */ 26 | public interface MainSceneRootProvider { 27 | 28 | /** 29 | * Gets the root parent node of the main scene. 30 | * 31 | * @return the root parent node of the main scene 32 | */ 33 | Parent getRoot(); 34 | } 35 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/OnExitRequestHandlerProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2018 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.application; 16 | 17 | import org.drombler.commons.fx.stage.OnExitRequestHandler; 18 | 19 | /** 20 | * A service interface for {@link OnExitRequestHandler} providers. 21 | */ 22 | public interface OnExitRequestHandlerProvider { 23 | 24 | /** 25 | * Gets an {@link OnExitRequestHandler}. 26 | * 27 | * @return an {@link OnExitRequestHandler} 28 | */ 29 | OnExitRequestHandler getOnExitRequestHandler(); 30 | } 31 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/impl/AdditionalArgumentsProviderHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.application.impl; 16 | 17 | import javafx.stage.Stage; 18 | import org.drombler.acp.core.commons.util.concurrent.ApplicationThreadExecutorProvider; 19 | import org.drombler.acp.startup.main.MainWindowProvider; 20 | import org.drombler.commons.client.startup.main.AdditionalArgumentsProvider; 21 | import org.osgi.service.component.annotations.Component; 22 | import org.osgi.service.component.annotations.Reference; 23 | import org.osgi.service.component.annotations.ReferenceCardinality; 24 | import org.osgi.service.component.annotations.ReferencePolicy; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | /** 29 | * 30 | * @author puce 31 | */ 32 | @Component(immediate = true) 33 | public class AdditionalArgumentsProviderHandler { 34 | 35 | private static final Logger LOG = LoggerFactory.getLogger(AdditionalArgumentsProviderHandler.class); 36 | 37 | @Reference 38 | private MainWindowProvider mainWindowProvider; 39 | 40 | @Reference 41 | private ApplicationThreadExecutorProvider applicationThreadExecutorProvider; 42 | 43 | @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) 44 | public void bindAdditionalArgumentsProvider(AdditionalArgumentsProvider additionalArgumentsProvider) { 45 | mainWindowToFront(); 46 | } 47 | 48 | public void unbindAdditionalArgumentsProvider(AdditionalArgumentsProvider additionalArgumentsProvider) { 49 | // TODO 50 | } 51 | 52 | private boolean isInitialized() { 53 | return mainWindowProvider != null && applicationThreadExecutorProvider != null; 54 | } 55 | 56 | private void mainWindowToFront() { 57 | if (isInitialized()) { 58 | applicationThreadExecutorProvider.getApplicationThreadExecutor().execute(() -> { 59 | mainWindowProvider.getMainWindow().toFront(); 60 | LOG.debug("Called mainWindow.toFront()!"); 61 | }); 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/impl/FXApplicationThreadExecutorProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.application.impl; 16 | 17 | import java.util.concurrent.Executor; 18 | import org.drombler.acp.core.commons.util.concurrent.ApplicationThreadExecutorProvider; 19 | import org.drombler.commons.fx.concurrent.FXApplicationThreadExecutor; 20 | import org.osgi.service.component.annotations.Component; 21 | 22 | /** 23 | * 24 | * @author puce 25 | */ 26 | @Component 27 | public class FXApplicationThreadExecutorProvider implements ApplicationThreadExecutorProvider { 28 | 29 | private final Executor executor = new FXApplicationThreadExecutor(); 30 | 31 | @Override 32 | public Executor getApplicationThreadExecutor() { 33 | return executor; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/impl/MainWindowOnCloseRequestHandler.java: -------------------------------------------------------------------------------- 1 | package org.drombler.fx.core.application.impl; 2 | 3 | import javafx.event.EventHandler; 4 | import javafx.stage.Stage; 5 | import javafx.stage.WindowEvent; 6 | import org.drombler.acp.startup.main.MainWindowProvider; 7 | import org.drombler.commons.fx.stage.OnExitRequestHandler; 8 | import org.drombler.fx.core.application.OnExitRequestHandlerProvider; 9 | import org.osgi.service.component.ComponentContext; 10 | import org.osgi.service.component.annotations.Activate; 11 | import org.osgi.service.component.annotations.Component; 12 | import org.osgi.service.component.annotations.Deactivate; 13 | import org.osgi.service.component.annotations.Reference; 14 | 15 | /** 16 | * 17 | * @author puce 18 | */ 19 | @Component(immediate = true) 20 | public class MainWindowOnCloseRequestHandler { 21 | 22 | @Reference 23 | private MainWindowProvider mainWindowProvider; 24 | 25 | @Reference 26 | private OnExitRequestHandlerProvider onExitRequestHandlerProvider; 27 | 28 | private EventHandler onCloseRequestEventHandler; 29 | 30 | @Activate 31 | protected void activate(ComponentContext context) { 32 | this.onCloseRequestEventHandler = OnExitRequestHandler.createOnWindowCloseRequestEventHandler(onExitRequestHandlerProvider.getOnExitRequestHandler()); 33 | mainWindowProvider.getMainWindow().setOnCloseRequest(onCloseRequestEventHandler); 34 | } 35 | 36 | @Deactivate 37 | protected void deactivate(ComponentContext context) { 38 | mainWindowProvider.getMainWindow().setOnCloseRequest(null); 39 | this.onCloseRequestEventHandler = null; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | 16 | package org.drombler.fx.core.application.impl; 17 | -------------------------------------------------------------------------------- /drombler-fx-core-application/src/main/java/org/drombler/fx/core/application/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | /** 16 | * Core Drombler FX Application classes. 17 | */ 18 | package org.drombler.fx.core.application; 19 | -------------------------------------------------------------------------------- /drombler-fx-core-commons/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 4.0.0 18 | 19 | 20 | org.drombler.fx 21 | drombler-fx-parent 22 | 0.2.1-SNAPSHOT 23 | ../drombler-fx-parent 24 | 25 | drombler-fx-core-commons 26 | bundle 27 | 28 | 29 | Drombler FX - Core - Commons 30 | 2012 31 | 32 | 33 | ${scm.connection} 34 | ${scm.developerConnection} 35 | ${scm.url} 36 | HEAD 37 | 38 | 39 | 40 | ${scm.parent.connection} 41 | ${scm.parent.developerConnection} 42 | ${scm.parent.url} 43 | 44 | 45 | 46 | 47 | ${maven.version} 48 | 49 | 50 | 51 | 52 | 53 | org.apache.felix 54 | maven-bundle-plugin 55 | true 56 | 57 | 58 | 59 | 60 | 61 | org.drombler.acp 62 | drombler-acp-core-commons 63 | 64 | 65 | org.softsmithy.lib 66 | softsmithy-lib-core 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /drombler-fx-core-data-l10n-de/src/main/resources/org/drombler/fx/core/data/impl/FXFileChooserProvider_de.properties: -------------------------------------------------------------------------------- 1 | fileChooser.open.title=\u00d6ffnen 2 | fileChooser.saveAs.title=Speichern unter 3 | fileChooser.extensionFilters.allFiles=Alle Dateien 4 | fileChooser.extensionFilter.format={0} {1} -------------------------------------------------------------------------------- /drombler-fx-core-data/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.data { 2 | requires javafx.graphics; 3 | requires org.drombler.acp.startup.main; 4 | requires org.drombler.acp.core.data.spi; 5 | requires org.drombler.commons.client.core; 6 | requires org.drombler.commons.data.core; 7 | requires org.softsmithy.lib.core; 8 | requires org.apache.commons.lang3; 9 | requires osgi.cmpn; 10 | } -------------------------------------------------------------------------------- /drombler-fx-core-data/src/main/java/org/drombler/fx/core/data/impl/FXDirectoryChooserProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2018 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.data.impl; 16 | 17 | import javafx.stage.DirectoryChooser; 18 | import javafx.stage.Stage; 19 | import org.apache.commons.lang3.SystemUtils; 20 | import org.drombler.acp.startup.main.MainWindowProvider; 21 | import org.drombler.commons.client.dialog.DirectoryChooserProvider; 22 | import org.osgi.service.component.annotations.Component; 23 | import org.osgi.service.component.annotations.Reference; 24 | 25 | import java.io.File; 26 | import java.nio.file.Path; 27 | 28 | /** 29 | * 30 | * @author puce 31 | */ 32 | @Component 33 | public class FXDirectoryChooserProvider implements DirectoryChooserProvider { 34 | 35 | @Reference 36 | private MainWindowProvider mainWindowProvider; 37 | 38 | private final DirectoryChooser directoryChooser = new DirectoryChooser(); 39 | 40 | 41 | public FXDirectoryChooserProvider() { 42 | // TODO: synchronize initialDirectory with FXFileChooserProvider? 43 | this.directoryChooser.setInitialDirectory(SystemUtils.getUserHome()); 44 | } 45 | 46 | @Override 47 | public Path showDialog() { 48 | File directory = directoryChooser.showDialog(mainWindowProvider.getMainWindow()); 49 | if (directory != null) { 50 | directoryChooser.setInitialDirectory(directory); 51 | return directory.toPath(); 52 | } else { 53 | return null; 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /drombler-fx-core-data/src/main/java/org/drombler/fx/core/data/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | 16 | package org.drombler.fx.core.data.impl; 17 | -------------------------------------------------------------------------------- /drombler-fx-core-data/src/main/resources/org/drombler/fx/core/data/impl/FXFileChooserProvider.properties: -------------------------------------------------------------------------------- 1 | fileChooser.open.title=Open 2 | fileChooser.saveAs.title=Save As 3 | fileChooser.extensionFilters.allFiles=All Files 4 | fileChooser.extensionFilter.format={0} {1} -------------------------------------------------------------------------------- /drombler-fx-core-docking-l10n-de/src/main/resources/org/drombler/fx/core/docking/FXDockableDataUtils_de.properties: -------------------------------------------------------------------------------- 1 | errorAlert.contentText=Die Datei konnte nicht gespeichert werden!\nWeitere Informationen finden Sie im Log. -------------------------------------------------------------------------------- /drombler-fx-core-docking-l10n-de/src/main/resources/org/drombler/fx/core/docking/impl/DockingPaneProvider_de.properties: -------------------------------------------------------------------------------- 1 | saveButtonType.text=Speichern 2 | discardButtonType.text=Verwerfen 3 | cancelButtonType.text=Abbrechen 4 | alert.contentTextFormat={0} wurde modifiziert. Speichern? -------------------------------------------------------------------------------- /drombler-fx-core-docking/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.docking { 2 | exports org.drombler.fx.core.docking; 3 | 4 | requires org.drombler.fx.core.application; 5 | requires transitive org.drombler.acp.core.data; 6 | requires org.drombler.acp.core.docking.spi; 7 | requires org.drombler.acp.core.context; 8 | requires transitive org.drombler.commons.action.command; 9 | requires org.drombler.commons.client.core; 10 | requires transitive org.drombler.commons.docking.fx; 11 | requires org.drombler.commons.docking.context; 12 | requires org.drombler.commons.docking.fx.context; 13 | requires org.slf4j; 14 | requires osgi.core; 15 | requires osgi.cmpn; 16 | } -------------------------------------------------------------------------------- /drombler-fx-core-docking/src/main/java/org/drombler/fx/core/docking/impl/OnExitRequestHandlerProviderImpl.java: -------------------------------------------------------------------------------- 1 | package org.drombler.fx.core.docking.impl; 2 | 3 | import javafx.scene.Node; 4 | import org.drombler.acp.core.docking.spi.DockingAreaContainerProvider; 5 | import org.drombler.commons.docking.fx.FXDockableData; 6 | import org.drombler.commons.docking.fx.FXDockableEntry; 7 | import org.drombler.commons.docking.fx.context.DockingOnExitRequestHandler; 8 | import org.drombler.commons.fx.stage.OnExitRequestHandler; 9 | import org.drombler.fx.core.application.OnExitRequestHandlerProvider; 10 | import org.osgi.service.component.ComponentContext; 11 | import org.osgi.service.component.annotations.Activate; 12 | import org.osgi.service.component.annotations.Component; 13 | import org.osgi.service.component.annotations.Deactivate; 14 | import org.osgi.service.component.annotations.Reference; 15 | 16 | /** 17 | * 18 | * @author puce 19 | */ 20 | @Component 21 | public class OnExitRequestHandlerProviderImpl implements OnExitRequestHandlerProvider { 22 | 23 | private DockingOnExitRequestHandler windowOnCloseRequestHandler; 24 | 25 | @Reference 26 | private DockingAreaContainerProvider dockingAreaContainerProvider; 27 | 28 | 29 | @Activate 30 | protected void activate(ComponentContext context) { 31 | windowOnCloseRequestHandler = new DockingOnExitRequestHandler(dockingAreaContainerProvider.getDockingAreaContainer()); 32 | } 33 | 34 | @Deactivate 35 | protected void deactivate(ComponentContext context) { 36 | windowOnCloseRequestHandler = null; 37 | } 38 | 39 | @Override 40 | public OnExitRequestHandler getOnExitRequestHandler() { 41 | return windowOnCloseRequestHandler; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /drombler-fx-core-docking/src/main/java/org/drombler/fx/core/docking/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | 16 | package org.drombler.fx.core.docking.impl; 17 | -------------------------------------------------------------------------------- /drombler-fx-core-docking/src/main/java/org/drombler/fx/core/docking/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | /** 16 | * A JavaFX-based extension of the Drombler ACP Docking Framework. 17 | */ 18 | package org.drombler.fx.core.docking; 19 | -------------------------------------------------------------------------------- /drombler-fx-core-docking/src/main/resources/org/drombler/fx/core/docking/FXDockableDataUtils.properties: -------------------------------------------------------------------------------- 1 | errorAlert.contentText=Could not save the file!\nPlease see the log for more information. -------------------------------------------------------------------------------- /drombler-fx-core-docking/src/main/resources/org/drombler/fx/core/docking/impl/DockingPaneProvider.properties: -------------------------------------------------------------------------------- 1 | saveButtonType.text=Save 2 | discardButtonType.text=Discard 3 | cancelButtonType.text=Cancel 4 | alert.contentTextFormat=Save modified {0}? -------------------------------------------------------------------------------- /drombler-fx-core-standard-action-l10n-de/src/main/resources/org/drombler/fx/core/standard/action/impl/Bundle_de.properties: -------------------------------------------------------------------------------- 1 | # COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 2 | # 3 | # The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 4 | # Version 1.0 (the "License"); you may not use this file except in 5 | # compliance with the License. A copy of the License is available at 6 | # http://www.opensource.org/licenses/cddl1.txt 7 | # 8 | # The Original Code is Drombler.org. The Initial Developer of the 9 | # Original Code is Florian Brunner (Sourceforge.net user: puce). 10 | # Copyright 2012 Drombler.org. All Rights Reserved. 11 | # 12 | # Contributor(s): . 13 | exit.displayName=Be_enden -------------------------------------------------------------------------------- /drombler-fx-core-standard-action/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.standard.action { 2 | requires javafx.graphics; 3 | requires org.drombler.fx.core.application; 4 | requires org.drombler.acp.core.action; 5 | requires org.drombler.acp.core.commons; 6 | requires osgi.core; 7 | } -------------------------------------------------------------------------------- /drombler-fx-core-standard-action/src/main/java/org/drombler/fx/core/standard/action/impl/ExitAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.standard.action.impl; 16 | 17 | import javafx.application.Platform; 18 | import javafx.event.ActionEvent; 19 | import javafx.event.EventHandler; 20 | import org.drombler.acp.core.action.Action; 21 | import org.drombler.acp.core.action.MenuEntry; 22 | import org.drombler.acp.core.commons.util.SimpleServiceTrackerCustomizer; 23 | import org.drombler.fx.core.application.OnExitRequestHandlerProvider; 24 | import org.osgi.util.tracker.ServiceTracker; 25 | 26 | /** 27 | * 28 | * @author puce 29 | */ 30 | @Action(id = "platform.exit", category = "core", displayName = "%displayName", 31 | accelerator = "Shortcut+Q") 32 | @MenuEntry(path = "File", position = 9900) 33 | public class ExitAction implements EventHandler, AutoCloseable { 34 | 35 | private final ServiceTracker onExitRequestHandlerProviderServiceTracker; 36 | private OnExitRequestHandlerProvider onExitRequestHandlerProvider; 37 | 38 | public ExitAction() { 39 | this.onExitRequestHandlerProviderServiceTracker = SimpleServiceTrackerCustomizer.createServiceTracker(OnExitRequestHandlerProvider.class, this::setOnExitRequestHandlerProvider); 40 | this.onExitRequestHandlerProviderServiceTracker.open(true); 41 | } 42 | 43 | @Override 44 | public void handle(ActionEvent t) { 45 | if (onExitRequestHandlerProvider != null) { 46 | if (onExitRequestHandlerProvider.getOnExitRequestHandler().handleExitRequest()) { 47 | Platform.exit(); 48 | } 49 | } else { 50 | Platform.exit(); 51 | } 52 | } 53 | 54 | private void setOnExitRequestHandlerProvider(OnExitRequestHandlerProvider onExitRequestHandlerProvider) { 55 | this.onExitRequestHandlerProvider = onExitRequestHandlerProvider; 56 | } 57 | 58 | @Override 59 | public void close() { 60 | onExitRequestHandlerProviderServiceTracker.close(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /drombler-fx-core-standard-action/src/main/resources/org/drombler/fx/core/standard/action/impl/ExitAction.properties: -------------------------------------------------------------------------------- 1 | # COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 2 | # 3 | # The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 4 | # Version 1.0 (the "License"); you may not use this file except in 5 | # compliance with the License. A copy of the License is available at 6 | # http://www.opensource.org/licenses/cddl1.txt 7 | # 8 | # The Original Code is Drombler.org. The Initial Developer of the 9 | # Original Code is Florian Brunner (GitHub user: puce77). 10 | # Copyright 2019 Drombler.org. All Rights Reserved. 11 | # 12 | # Contributor(s): . 13 | displayName=E_xit -------------------------------------------------------------------------------- /drombler-fx-core-standard-desktop-classic/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.standard.desktop.classic { 2 | requires org.drombler.fx.core.application; 3 | requires org.drombler.fx.core.action; 4 | requires org.drombler.fx.core.status; 5 | requires org.drombler.acp.core.action.spi; 6 | requires org.drombler.acp.core.status.spi; 7 | requires org.drombler.acp.core.commons; 8 | requires org.drombler.commons.fx.fxml; 9 | requires org.drombler.commons.fx.controls; 10 | requires org.slf4j; 11 | requires osgi.core; 12 | requires osgi.cmpn; 13 | } -------------------------------------------------------------------------------- /drombler-fx-core-standard-desktop-classic/src/main/java/org/drombler/fx/core/standard/desktop/classic/impl/ContentHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.standard.desktop.classic.impl; 16 | 17 | import org.drombler.acp.core.commons.util.concurrent.ApplicationThreadExecutorProvider; 18 | import org.drombler.fx.core.application.ApplicationContentProvider; 19 | import org.osgi.service.component.ComponentContext; 20 | import org.osgi.service.component.annotations.Activate; 21 | import org.osgi.service.component.annotations.Component; 22 | import org.osgi.service.component.annotations.Deactivate; 23 | import org.osgi.service.component.annotations.Reference; 24 | 25 | /** 26 | * This handler is looking for a content pane for the application pane. 27 | * 28 | * @author puce 29 | */ 30 | @Component(immediate = true) 31 | public class ContentHandler { 32 | 33 | @Reference 34 | private ContentPaneProvider contentPaneProvider; 35 | @Reference 36 | private ApplicationContentProvider applicationContentProvider; 37 | @Reference 38 | private ApplicationThreadExecutorProvider applicationThreadExecutorProvider; 39 | 40 | @Activate 41 | protected void activate(ComponentContext context) { 42 | applicationThreadExecutorProvider.getApplicationThreadExecutor().execute(() 43 | -> contentPaneProvider.getContentPane().setCenter(applicationContentProvider.getContentPane())); 44 | } 45 | 46 | @Deactivate 47 | protected void deactivate(ComponentContext context) { 48 | applicationThreadExecutorProvider.getApplicationThreadExecutor().execute(() -> { 49 | contentPaneProvider.getContentPane().setCenter(null); 50 | contentPaneProvider = null; 51 | }); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /drombler-fx-core-standard-desktop-classic/src/main/java/org/drombler/fx/core/standard/desktop/classic/impl/ContentPaneProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2012 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package org.drombler.fx.core.standard.desktop.classic.impl; 16 | 17 | import javafx.scene.layout.BorderPane; 18 | 19 | /** 20 | * 21 | * @author puce 22 | */ 23 | public interface ContentPaneProvider { 24 | // TODO: replace BorderPane with a custom layout pane similar to DockablePane 25 | 26 | BorderPane getContentPane(); 27 | } 28 | -------------------------------------------------------------------------------- /drombler-fx-core-standard-desktop-classic/src/main/resources/org/drombler/fx/core/standard/desktop/classic/impl/ClassicDesktopApplicationPane.fxml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /drombler-fx-core-standard-status/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.standard.status { 2 | requires org.drombler.commons.fx.controls; 3 | requires org.drombler.commons.fx.fxml; 4 | requires org.drombler.commons.fx.graphics; 5 | requires org.drombler.commons.context; 6 | requires org.drombler.acp.core.status; 7 | } -------------------------------------------------------------------------------- /drombler-fx-core-standard-status/src/main/resources/org/drombler/fx/core/standard/status/impl/ProgressMonitorStatusBarElement.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /drombler-fx-core-status/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.core.status { 2 | exports org.drombler.fx.core.status; 3 | 4 | requires org.drombler.acp.core.status.spi; 5 | requires org.drombler.commons.fx.controls; 6 | requires org.softsmithy.lib.core; 7 | } -------------------------------------------------------------------------------- /drombler-fx-core-status/src/main/java/org/drombler/fx/core/status/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2017 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | /** 16 | * A JavaFX-based extension of the Drombler ACP Status Bar Framework. 17 | */ 18 | package org.drombler.fx.core.status; 19 | -------------------------------------------------------------------------------- /drombler-fx-docs/nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CUSTOM-site 5 | site 6 | 7 | site 8 | 9 | 10 | release-profile 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/asciidoc/gh-pages/docs/index.adoc: -------------------------------------------------------------------------------- 1 | = Drombler FX 2 | 3 | * <> 4 | * link:site/apidocs[Javadoc] 5 | * link:site[Maven Site] -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/asciidoc/gh-pages/index.adoc: -------------------------------------------------------------------------------- 1 | = Drombler FX 2 | :description: The modular application framework for JavaFX. 3 | :keywords: Application Framework, Drombler FX, Java, JavaFX, Maven, OSGi, RCP 4 | 5 | * link:docs[Documentation] 6 | * link:docs/site/modules.html[Maven Coordinates & Download Links] -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/asciidoc/tutorial/ide.adoc: -------------------------------------------------------------------------------- 1 | [[ide]] 2 | = IDEs 3 | :toc: 4 | :numbered: 5 | 6 | == NetBeans 7 | The sample application (see <>) provides a _nbactions.xml_ file for 8 | the _drombler-fx-application_ project, which supports _run_ and _debug_ out-of-the-box. 9 | 10 | == IntelliJ 11 | To *run* the application: 12 | 13 | * Create a Maven run configuration 14 | * *Working directory*: the _drombler-fx-application_ project 15 | * *Command line*: _exec:exec_ 16 | 17 | To *debug* the application: 18 | 19 | TBD 20 | 21 | https://youtrack.jetbrains.com/issue/IDEA-189973 22 | 23 | https://stackoverflow.com/q/30518420/506855 24 | 25 | https://stackoverflow.com/a/22367089/664577 26 | 27 | == Eclipse 28 | To *run* the application: 29 | 30 | TBD 31 | 32 | To *debug* the application: 33 | 34 | TBD 35 | 36 | https://stackoverflow.com/q/30518420/506855 -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/asciidoc/tutorial/index.adoc: -------------------------------------------------------------------------------- 1 | [[tutorial]] 2 | = Drombler FX 3 | Florian Brunner 4 | :description: The modular application framework for JavaFX. 5 | :keywords: Application Framework, Drombler FX, Java, JavaFX, Maven, OSGi, RCP 6 | :revnumber: {project-version} 7 | :toc: 8 | 9 | The modular application framework for _JavaFX_ based on: 10 | 11 | * *OSGi*: _OSGi_ is the de facto standard for writing modular software in _Java_. 12 | * *Maven (POM-first)*: _Drombler FX_ applications can be build with _Maven_. 13 | The build follows the standard POM-first approach (the OSGi meta data will be generated for you). 14 | A custom Maven Plugin will help you to easily create _JavaFX_ applications with Maven. 15 | A custom Maven Archetype will help you to get started. 16 | * *Declarative programming model*: Annotations can be used at many places to register elements such as menus, toolbars and GUI components. 17 | * *Drombler ACP*: _Drombler FX_ is a _JavaFX_ specific extension for _Drombler ACP_ providing 18 | _JavaFX_-based implementations for the abstract definitions. 19 | Read more about _Drombler ACP_ here: https://www.drombler.org/drombler-acp[Drombler ACP] 20 | * *Drombler Commons*: _Drombler Commons_ is a collection of reusable libraries and frameworks. 21 | They ship with _OSGi_ meta data but don't require an _OSGi_ environment. Read more about _Drombler Commons_ here: https://www.drombler.org/drombler-commons[Drombler Commons] 22 | 23 | _Drombler FX_ uses https://felix.apache.org[Apache Felix] as its OSGi container by default. 24 | 25 | As an application framework it makes sure _JavaFX_ and _OSGi_ will get started properly and it provides the main window. 26 | 27 | == Where to go from here 28 | 29 | * <> 30 | * <> 31 | * <> 32 | * <> 33 | * <> 34 | * <> 35 | * <> 36 | * <> 37 | * <> 38 | * <> 39 | * <> 40 | * <> 41 | * <> 42 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/asciidoc/tutorial/localization.adoc: -------------------------------------------------------------------------------- 1 | [[localization]] 2 | = Localization 3 | :toc: 4 | :numbered: 5 | 6 | The recommended way to localize your application is to use standard OSGi bundle fragments. 7 | 8 | Fragments need to specifiy their fragment host. You can use the 9 | https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html[Maven Bundle Plugin] 10 | to create a fragment. 11 | 12 | [source,xml] 13 | ---- 14 | bundle 15 | 16 | [...] 17 | 18 | 19 | org.apache.felix 20 | maven-bundle-plugin 21 | true 22 | 23 | 24 | com.mycompany.myapp.myapp-mymodule;bundle-version=${myapp.osgi.version.clean} 25 | 26 | 27 | ${project.version} 28 | 29 | 30 | 31 | 32 | generate-sources 33 | 34 | cleanVersions 35 | 36 | 37 | 38 | 39 | ---- 40 | 41 | Replace _com.mycompany.myapp.myapp-mymodule_ with the _Bundle-SymbolicName_ of the fragment host. 42 | Make sure you use the OSGi version, not the Maven version (see the https://felix.apache.org/components/bundle-plugin/cleanVersions-mojo.html[cleanVersions] goal). 43 | 44 | == Currently Supported Locales 45 | 46 | * _en_ (English; default) 47 | * _de_ (German) -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/bash/tutorial/getting-started/build-sample.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd test 3 | mvn clean install 4 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/bash/tutorial/getting-started/generate-sample.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mvn archetype:generate -DarchetypeGroupId=org.drombler.fx -DarchetypeArtifactId=drombler-fx-maven-archetype-application -DarchetypeVersion=${project.version} -DgroupId=com.mycompany.test -DartifactId=test -Dversion=0.1.0-SNAPSHOT -DbrandingId=my-application 3 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/bash/tutorial/getting-started/run1-sample.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd test-application 3 | java -Duser.language=en -Duser.country=US -Djavafx.verbose=true -Dbinary.css=false -Djava.util.logging.config.file=target/deployment/standalone/conf/logging.properties -jar target/deployment/standalone/bin/my-application.jar --userdir target/userdir 4 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/bash/tutorial/getting-started/run2-sample.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd test-application 3 | mvn exec:exec -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images-raw/tutorial/docking/docking-areas-tutorial-raw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images-raw/tutorial/docking/docking-areas-tutorial-raw.png -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images-raw/tutorial/docking/docking-areas-tutorial-raw.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images-raw/tutorial/docking/docking-areas-tutorial-raw.xcf -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images-raw/tutorial/docking/docking-areas-tutorial.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images-raw/tutorial/docking/docking-areas-tutorial.odg -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images-raw/tutorial/layout/standard-desktop-classic-layout.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images-raw/tutorial/layout/standard-desktop-classic-layout.xcf -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images-raw/tutorial/progressmonitor/progress-monitor.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images-raw/tutorial/progressmonitor/progress-monitor.odg -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images-raw/tutorial/progressmonitor/progress-monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images-raw/tutorial/progressmonitor/progress-monitor.png -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images/tutorial/docking/docking-areas-tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images/tutorial/docking/docking-areas-tutorial.png -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images/tutorial/getting-started/drombler-sample-application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images/tutorial/getting-started/drombler-sample-application.png -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images/tutorial/getting-started/unsaved-editors-on-closing-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images/tutorial/getting-started/unsaved-editors-on-closing-window.png -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images/tutorial/layout/standard-desktop-classic-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images/tutorial/layout/standard-desktop-classic-layout.png -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/images/tutorial/progressmonitor/progress-monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drombler/drombler-fx/f50039daf140b7c798c0b5d32a4d77041e0b6431/drombler-fx-docs/src/main/images/tutorial/progressmonitor/progress-monitor.png -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module org.drombler.fx.docs { 2 | requires java.compiler; 3 | requires javafx.fxml; 4 | requires javafx.base; 5 | requires org.drombler.acp.core.application; 6 | requires org.drombler.acp.core.action; 7 | requires org.drombler.acp.core.data; 8 | requires org.drombler.acp.core.docking; 9 | requires org.drombler.acp.core.status; 10 | requires org.drombler.acp.core.context; 11 | requires org.drombler.acp.core.commons; 12 | requires org.drombler.commons.action.core; 13 | requires org.drombler.commons.action.fx; 14 | requires org.drombler.commons.docking.core; 15 | requires org.drombler.commons.context; 16 | requires org.drombler.commons.fx.fxml; 17 | requires org.drombler.commons.fx.graphics; 18 | requires org.softsmithy.lib.compiler; 19 | requires osgi.cmpn; 20 | requires osgi.core; 21 | requires org.slf4j; 22 | } -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/AnnotatedAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import org.drombler.acp.core.action.Action; 18 | 19 | @Action(id = "test1", category = "test", displayName = "%test1.displayName", 20 | accelerator = "Shortcut+T", icon = "test1.png") 21 | public class AnnotatedAction { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/AnnotatedMenuEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import org.drombler.acp.core.action.MenuEntry; 18 | 19 | @MenuEntry(actionId = "test1", path = "File", position = 20) 20 | public class AnnotatedMenuEntry { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/AnnotatedToolBarEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import org.drombler.acp.core.action.ToolBarEntry; 18 | 19 | @ToolBarEntry(actionId = "test1", toolBarId = "file", position = 30) 20 | public class AnnotatedToolBarEntry { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/Test1Action.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import org.drombler.commons.action.AbstractActionListener; 18 | 19 | public class Test1Action extends AbstractActionListener { 20 | 21 | @Override 22 | public void onAction(Object event) { 23 | System.out.println("Test1 Action!"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/Test1ToggleAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import org.drombler.commons.action.AbstractToggleActionListener; 18 | 19 | public class Test1ToggleAction extends AbstractToggleActionListener { 20 | 21 | @Override 22 | public void onSelectionChanged(boolean oldValue, boolean newValue) { 23 | System.out.println("Test1 Toggle Action selection changed: " + newValue); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/Test2Action.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import javafx.event.ActionEvent; 18 | import javafx.event.EventHandler; 19 | 20 | public class Test2Action implements EventHandler { 21 | 22 | @Override 23 | public void handle(ActionEvent t) { 24 | System.out.println("Test2 Action!"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/Test2ToggleAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import javafx.beans.property.BooleanProperty; 18 | import javafx.beans.property.SimpleBooleanProperty; 19 | import javafx.event.ActionEvent; 20 | import org.drombler.commons.action.fx.AbstractFXAction; 21 | import org.drombler.commons.action.fx.FXToggleAction; 22 | 23 | public class Test2ToggleAction extends AbstractFXAction implements FXToggleAction { 24 | 25 | private final BooleanProperty selected = new SimpleBooleanProperty(this, "selected"); 26 | 27 | public Test2ToggleAction() { 28 | selected.addListener((ov, oldValue, newValue) 29 | -> System.out.println("Test1 Toggle Action selection changed: " + newValue)); 30 | } 31 | 32 | @Override 33 | public BooleanProperty selectedProperty() { 34 | return selected; 35 | } 36 | 37 | @Override 38 | public final boolean isSelected() { 39 | return selectedProperty().get(); 40 | } 41 | 42 | @Override 43 | public final void setSelected(boolean selected) { 44 | selectedProperty().set(selected); 45 | } 46 | 47 | @Override 48 | public void handle(ActionEvent t) { 49 | // do nothing 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/Test3Action.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action; 16 | 17 | import javafx.event.ActionEvent; 18 | import org.drombler.commons.action.fx.AbstractFXAction; 19 | 20 | public class Test3Action extends AbstractFXAction { 21 | 22 | @Override 23 | public void handle(ActionEvent t) { 24 | System.out.println("Test3 Action!"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/menu/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | @Menu(id = "Custom", displayName = "%customMenu.displayName", position = 110) 16 | @Menu(id = "Sub", displayName = "%subMenu.displayName", path = "Custom", position = 30) 17 | package tutorial.action.menu; 18 | 19 | import org.drombler.acp.core.action.Menu; 20 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/sample/MyCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action.sample; 16 | 17 | public interface MyCommand { 18 | 19 | public void doSomething(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/sample/impl/MyAction1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action.sample.impl; 16 | 17 | import org.drombler.acp.core.action.Action; 18 | import org.drombler.acp.core.action.MenuEntry; 19 | import org.drombler.acp.core.action.ToolBarEntry; 20 | import org.drombler.commons.action.AbstractActionListener; 21 | 22 | @Action(id = "test1", category = "test", displayName = "%test1.displayName", 23 | accelerator = "Shortcut+T", icon = "test1.png") 24 | @MenuEntry(path = "File", position = 20) 25 | @ToolBarEntry(toolBarId = "file", position = 30) 26 | public class MyAction1 extends AbstractActionListener { 27 | 28 | @Override 29 | public void onAction(Object event) { 30 | System.out.println("Test1 Action!"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/sample/impl/MyAction2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action.sample.impl; 16 | 17 | import tutorial.action.sample.MyCommand; 18 | import org.drombler.acp.core.action.Action; 19 | import org.drombler.acp.core.action.MenuEntry; 20 | import org.drombler.acp.core.action.ToolBarEntry; 21 | import org.drombler.commons.action.AbstractActionListener; 22 | import org.drombler.commons.context.ActiveContextSensitive; 23 | import org.drombler.commons.context.Context; 24 | 25 | @Action(id = "myaction", category = "mycategory", displayName = "%myaction.displayName", 26 | accelerator = "Shortcut+M", icon = "myaction.gif") 27 | @MenuEntry(path = "File", position = 3200) 28 | @ToolBarEntry(toolBarId = "file", position = 42) 29 | public class MyAction2 extends AbstractActionListener implements ActiveContextSensitive { 30 | 31 | private MyCommand myCommand; 32 | private Context activeContext; 33 | 34 | public MyAction2() { 35 | setEnabled(false); 36 | } 37 | 38 | @Override 39 | public void onAction(Object event) { 40 | myCommand.doSomething(); 41 | } 42 | 43 | @Override 44 | public void setActiveContext(Context activeContext) { 45 | this.activeContext = activeContext; 46 | this.activeContext.addContextListener(MyCommand.class, event -> contextChanged()); 47 | contextChanged(); 48 | } 49 | 50 | private void contextChanged() { 51 | myCommand = activeContext.find(MyCommand.class); 52 | setEnabled(myCommand != null); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/sample/impl/MyAction3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action.sample.impl; 16 | 17 | import tutorial.action.sample.MyCommand; 18 | import java.util.ArrayList; 19 | import java.util.Collection; 20 | import java.util.Collections; 21 | import java.util.List; 22 | import org.drombler.acp.core.action.Action; 23 | import org.drombler.acp.core.action.MenuEntry; 24 | import org.drombler.acp.core.action.ToolBarEntry; 25 | import org.drombler.commons.action.AbstractActionListener; 26 | import org.drombler.commons.context.ApplicationContextSensitive; 27 | import org.drombler.commons.context.Context; 28 | 29 | @Action(id = "myaction", category = "mycategory", displayName = "%myaction.displayName", 30 | accelerator = "Shortcut+Shift+M", icon = "myaction.png") 31 | @MenuEntry(path = "File", position = 3210) 32 | @ToolBarEntry(toolBarId = "file", position = 72) 33 | public class MyAction3 extends AbstractActionListener implements ApplicationContextSensitive { 34 | 35 | private Collection myCommands = Collections.emptyList(); 36 | private Context applicationContext; 37 | 38 | public MyAction3() { 39 | setEnabled(false); 40 | } 41 | 42 | @Override 43 | public void onAction(Object event) { 44 | // protect against modification during iteration TODO: needed? 45 | List currentMyCommands = new ArrayList<>(myCommands); 46 | currentMyCommands.forEach(myCommand -> myCommand.doSomething()); 47 | } 48 | 49 | @Override 50 | public void setApplicationContext(Context applicationContext) { 51 | this.applicationContext = applicationContext; 52 | this.applicationContext.addContextListener(MyCommand.class, 53 | event -> contextChanged()); 54 | contextChanged(); 55 | } 56 | 57 | private void contextChanged() { 58 | myCommands = applicationContext.findAll(MyCommand.class); 59 | setEnabled(!myCommands.isEmpty()); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/sample/impl/MyToggleAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.action.sample.impl; 16 | 17 | import org.drombler.acp.core.action.ToggleAction; 18 | import org.drombler.acp.core.action.ToggleMenuEntry; 19 | import org.drombler.acp.core.action.ToolBarToggleEntry; 20 | import org.drombler.commons.action.AbstractToggleActionListener; 21 | 22 | @ToggleAction(id = "test1", category = "test", displayName = "%test1.displayName", 23 | accelerator = "Shortcut+T", icon = "test1.png") 24 | @ToggleMenuEntry(path = "Custom/Sub", position = 30, toggleGroupId = "test") 25 | @ToolBarToggleEntry(toolBarId = "test", position = 30, toggleGroupId = "test") 26 | public class MyToggleAction extends AbstractToggleActionListener { 27 | 28 | @Override 29 | public void onSelectionChanged(boolean oldValue, boolean newValue) { 30 | System.out.println("Test1 Toggle Action selection changed: " + newValue); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/action/toolbar/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | @ToolBar(id = "myToolbar1", displayName = "%myToolbar1.displayName", position = 50) 16 | @ToolBar(id = "myToolbar2", displayName = "%myToolbar2.displayName", position = 100, 17 | visible = false) 18 | package tutorial.action.toolbar; 19 | 20 | import org.drombler.acp.core.action.ToolBar; 21 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/data/Bar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.data; 16 | 17 | /** 18 | * 19 | * @author puce 20 | */ 21 | 22 | 23 | public class Bar { 24 | 25 | String getId() { 26 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/data/BarHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.data; 16 | 17 | import org.drombler.acp.core.data.AbstractDataHandler; 18 | import org.drombler.acp.core.data.BusinessObjectHandler; 19 | 20 | /** 21 | * 22 | * @author puce 23 | */ 24 | @BusinessObjectHandler(icon = "bar.png") 25 | public class BarHandler extends AbstractDataHandler { 26 | 27 | private final Bar bar; 28 | 29 | public BarHandler(Bar bar) { 30 | this.bar = bar; 31 | } 32 | 33 | @Override 34 | public String getTitle() { 35 | return bar.getId(); 36 | } 37 | 38 | @Override 39 | public String getTooltipText() { 40 | return bar.getId(); 41 | } 42 | 43 | @Override 44 | public String getUniqueKey() { 45 | return bar.getId(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/data/FooHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.data; 16 | 17 | import java.io.IOException; 18 | import java.nio.file.Path; 19 | import org.drombler.acp.core.data.AbstractDocumentHandler; 20 | import org.drombler.acp.core.data.DocumentHandler; 21 | 22 | /** 23 | * 24 | * @author puce 25 | */ 26 | @DocumentHandler(mimeType = "text/foo", icon = "foo.png") 27 | public class FooHandler extends AbstractDocumentHandler { 28 | 29 | private static final String FILE_EXTENSION = "foo"; 30 | 31 | public FooHandler() { 32 | super(FILE_EXTENSION); 33 | } 34 | 35 | public FooHandler(Path path) { 36 | super(FILE_EXTENSION, path); 37 | } 38 | 39 | @Override 40 | protected void writeContent() throws IOException { 41 | // Files.write(getPath(), ...); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/data/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | @FileExtension(displayName = "%fooFileExtension.displayName", mimeType = "text/foo", fileExtensions = "foo", position = 10) 16 | package tutorial.data; 17 | 18 | import org.drombler.acp.core.data.FileExtension; 19 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/docking/DockableEditor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.docking; 16 | 17 | import javafx.scene.layout.GridPane; 18 | import org.drombler.acp.core.docking.EditorDocking; 19 | 20 | @EditorDocking(contentType = FooHandler.class) 21 | public class DockableEditor extends GridPane { 22 | 23 | private final FooHandler fooHandler; 24 | 25 | public DockableEditor(FooHandler fooHandler) { 26 | this.fooHandler = fooHandler; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/docking/DockableView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.docking; 16 | 17 | import javafx.scene.layout.GridPane; 18 | import org.drombler.acp.core.docking.DockingState; 19 | import org.drombler.acp.core.docking.ViewDocking; 20 | import org.drombler.acp.core.docking.WindowMenuEntry; 21 | 22 | @ViewDocking(areaId = "left", position = 50, displayName = "%MyViewPane.displayName", 23 | accelerator = "Shortcut+4", icon = "myViewPane.png", state = DockingState.DOCKED, 24 | menuEntry = @WindowMenuEntry(path = "", position = 30)) 25 | public class DockableView extends GridPane { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/docking/Foo.java: -------------------------------------------------------------------------------- 1 | package tutorial.docking; 2 | 3 | /** 4 | * 5 | * @author puce 6 | */ 7 | 8 | 9 | public class Foo { 10 | 11 | private final String id; 12 | 13 | public Foo(String id) { 14 | this.id = id; 15 | } 16 | 17 | public String getId() { 18 | return id; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/docking/FooHandler.java: -------------------------------------------------------------------------------- 1 | package tutorial.docking; 2 | 3 | import org.softsmithy.lib.util.UniqueKeyProvider; 4 | 5 | /** 6 | * 7 | * @author puce 8 | */ 9 | 10 | 11 | public class FooHandler implements UniqueKeyProvider { 12 | 13 | private final Foo foo; 14 | 15 | public FooHandler(Foo foo) { 16 | this.foo = foo; 17 | } 18 | 19 | @Override 20 | public String getUniqueKey() { 21 | return foo.getId(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/docking/MyViewPane.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.docking; 16 | 17 | import java.io.IOException; 18 | import javafx.event.ActionEvent; 19 | import javafx.fxml.FXML; 20 | import javafx.scene.image.ImageView; 21 | import javafx.scene.layout.GridPane; 22 | import org.drombler.acp.core.docking.ViewDocking; 23 | import org.drombler.acp.core.docking.WindowMenuEntry; 24 | import org.drombler.commons.fx.fxml.FXMLLoaders; 25 | 26 | @ViewDocking(areaId = "left", position = 50, displayName = "%MyViewPane.displayName", 27 | menuEntry = @WindowMenuEntry(path = "", position = 30)) 28 | public class MyViewPane extends GridPane { 29 | 30 | @FXML 31 | private ImageView someImageView; 32 | 33 | public MyViewPane() throws IOException { 34 | load(); 35 | } 36 | 37 | private void load() throws IOException { 38 | FXMLLoaders.loadRoot(this); 39 | } 40 | 41 | @FXML 42 | private void onSomeAction(ActionEvent event) throws IOException { 43 | // do something 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/docking/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (Sourceforge.net user: puce). 11 | * Copyright 2015 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | @DockingArea(id = "myEditorArea", kind = DockingAreaKind.EDITOR, position = 25, 16 | path = {20, 40, 50}, permanent = true) 17 | @DockingArea(id = "myUpperViewArea", kind = DockingAreaKind.VIEW, position = 40, 18 | path = {20, 40, 20}, layoutConstraints = @LayoutConstraints(prefHeight = 50)) 19 | @DockingArea(id = "myLeftViewArea", kind = DockingAreaKind.VIEW, position = 10, 20 | path = {20, 20}, layoutConstraints = @LayoutConstraints(prefWidth = 200)) 21 | package tutorial.docking; 22 | 23 | import org.drombler.acp.core.docking.DockingArea; 24 | import org.drombler.acp.core.docking.LayoutConstraints; 25 | import org.drombler.commons.docking.DockingAreaKind; 26 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/Foo.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Documented 10 | @Retention(RetentionPolicy.SOURCE) 11 | @Target(ElementType.TYPE) 12 | public @interface Foo { 13 | 14 | String bar(); 15 | 16 | int position(); 17 | } 18 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/FooDescriptor.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo; 2 | 3 | import org.drombler.acp.core.commons.util.BundleUtils; 4 | import org.osgi.framework.Bundle; 5 | import tutorial.extension.foo.jaxb.FooType; 6 | 7 | public class FooDescriptor { 8 | 9 | private final Class fooClass; 10 | private final String bar; 11 | private final int position; 12 | 13 | public FooDescriptor(Class fooClass, String bar, int position) { 14 | this.fooClass = fooClass; 15 | this.bar = bar; 16 | this.position = position; 17 | } 18 | 19 | public Class getFooClass() { 20 | return fooClass; 21 | } 22 | 23 | public String getBar() { 24 | return bar; 25 | } 26 | 27 | public int getPosition() { 28 | return position; 29 | } 30 | 31 | /** 32 | * Creates an instance of a {@link FooDescriptor} from a {@link FooType} unmarshalled from the application.xml. 33 | * 34 | * @param foo the unmarshalled foo 35 | * @param bundle the bundle of the application.xml 36 | * @return a FooDescriptor 37 | * @throws java.lang.ClassNotFoundException 38 | */ 39 | public static FooDescriptor createFooDescriptor(FooType foo, Bundle bundle) 40 | throws ClassNotFoundException { 41 | Class fooClass = BundleUtils.loadClass(bundle, foo.getFooClass()); 42 | return createFooDescriptor(foo, fooClass); 43 | } 44 | 45 | private static FooDescriptor createFooDescriptor(FooType foo, 46 | Class fooClass) { 47 | return new FooDescriptor<>(fooClass, foo.getBar(), foo.getPosition()); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/ProgrammaticFooRegistrar.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo; 2 | 3 | import org.osgi.framework.BundleContext; 4 | import tutorial.extension.foo.impl.FooComponent1; 5 | import tutorial.extension.foo.jaxb.FooType; 6 | import tutorial.extension.foo.jaxb.FoosType; 7 | 8 | public class ProgrammaticFooRegistrar { 9 | 10 | private void registerFoos(final BundleContext bundleContext) { 11 | FoosType foos = createFoos(); 12 | 13 | bundleContext.registerService(FoosType.class, foos, null); 14 | } 15 | 16 | private FoosType createFoos() { 17 | FoosType foos = new FoosType(); 18 | foos.getFoo().add(createFoo1()); 19 | return foos; 20 | } 21 | 22 | private FooType createFoo1() { 23 | FooType foo = new FooType(); 24 | foo.setBar("a"); 25 | foo.setPosition(10); 26 | foo.setFooClass(FooComponent1.class.getName()); 27 | return foo; 28 | } 29 | 30 | private void registerFooDescriptor(final BundleContext bundleContext) { 31 | FooDescriptor fooDescriptor 32 | = new FooDescriptor<>(FooComponent1.class, "a", 10); 33 | bundleContext.registerService(FooDescriptor.class, fooDescriptor, null); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/impl/FooAnnotationProcessor.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo.impl; 2 | 3 | import org.drombler.acp.core.application.processing.AbstractApplicationAnnotationProcessor; 4 | import tutorial.extension.foo.Foo; 5 | import tutorial.extension.foo.jaxb.FooType; 6 | import tutorial.extension.foo.jaxb.FoosType; 7 | 8 | import javax.annotation.processing.RoundEnvironment; 9 | import javax.annotation.processing.SupportedAnnotationTypes; 10 | import javax.annotation.processing.SupportedSourceVersion; 11 | import javax.lang.model.SourceVersion; 12 | import javax.lang.model.element.Element; 13 | import javax.lang.model.element.TypeElement; 14 | import java.util.Set; 15 | 16 | @SupportedAnnotationTypes({"tutorial.extension.Foo"}) 17 | @SupportedSourceVersion(SourceVersion.RELEASE_11) 18 | public class FooAnnotationProcessor extends AbstractApplicationAnnotationProcessor { 19 | 20 | private FoosType foos; 21 | 22 | @Override 23 | protected boolean handleProcess(Set annotations, 24 | RoundEnvironment roundEnv) { 25 | roundEnv.getElementsAnnotatedWith(Foo.class).forEach(element -> { 26 | Foo fooAnnotation = element.getAnnotation(Foo.class); 27 | if (fooAnnotation != null) { 28 | registerFoo(fooAnnotation, element); 29 | } 30 | }); 31 | return false; 32 | } 33 | 34 | private void registerFoo(Foo fooAnnotation, Element element) { 35 | init(element); 36 | 37 | FooType foo = new FooType(); 38 | foo.setBar(fooAnnotation.bar()); 39 | foo.setPosition(fooAnnotation.position()); 40 | foo.setFooClass(element.asType().toString()); 41 | foos.getFoo().add(foo); 42 | } 43 | 44 | private void init(Element element) { 45 | if (foos == null) { 46 | foos = new FoosType(); 47 | addExtensionConfiguration(foos); 48 | addJAXBRootClass(FoosType.class); 49 | } 50 | addOriginatingElements(element); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/impl/FooComponent1.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo.impl; 2 | 3 | import tutorial.extension.foo.Foo; 4 | 5 | @Foo(bar = "a", position = 10) 6 | public class FooComponent1 { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/impl/FooComponent2.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo.impl; 2 | 3 | public class FooComponent2 { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/impl/FooExtensionPoint.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo.impl; 2 | 3 | import tutorial.extension.foo.jaxb.FoosType; 4 | import org.drombler.acp.core.application.ExtensionPoint; 5 | import org.osgi.service.component.annotations.Component; 6 | 7 | @Component 8 | public class FooExtensionPoint implements ExtensionPoint { 9 | 10 | @Override 11 | public Class getJAXBRootClass() { 12 | return FoosType.class; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/jaxb/FooType.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo.jaxb; 2 | 3 | import javax.xml.bind.annotation.XmlAccessType; 4 | import javax.xml.bind.annotation.XmlAccessorType; 5 | import javax.xml.bind.annotation.XmlElement; 6 | import javax.xml.bind.annotation.XmlType; 7 | 8 | @XmlAccessorType(XmlAccessType.FIELD) 9 | @XmlType(name = "FooType", propOrder = { 10 | "bar", 11 | "position", 12 | "fooClass" 13 | }) 14 | public class FooType { 15 | 16 | @XmlElement(required = true) 17 | private String bar; 18 | private int position; 19 | @XmlElement(required = true) 20 | private String fooClass; 21 | 22 | public String getBar() { 23 | return bar; 24 | } 25 | 26 | public void setBar(String value) { 27 | this.bar = value; 28 | } 29 | 30 | public int getPosition() { 31 | return position; 32 | } 33 | 34 | public void setPosition(int value) { 35 | this.position = value; 36 | } 37 | 38 | public String getFooClass() { 39 | return fooClass; 40 | } 41 | 42 | public void setFooClass(String value) { 43 | this.fooClass = value; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/jaxb/FoosType.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.foo.jaxb; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import javax.xml.bind.annotation.XmlAccessType; 6 | import javax.xml.bind.annotation.XmlAccessorType; 7 | import javax.xml.bind.annotation.XmlRootElement; 8 | import javax.xml.bind.annotation.XmlType; 9 | 10 | 11 | @XmlAccessorType(XmlAccessType.FIELD) 12 | @XmlType(name = "", propOrder = { 13 | "foo" 14 | }) 15 | @XmlRootElement(name = "foos", namespace = "http://www.mycompany.com/schema/myapp/foos") 16 | public class FoosType { 17 | 18 | private List foo; 19 | 20 | public List getFoo() { 21 | if (foo == null) { 22 | foo = new ArrayList<>(); 23 | } 24 | return this.foo; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/foo/package-info.java: -------------------------------------------------------------------------------- 1 | @Extension(extensionFile = "META-INF/drombler/foos.xml", 2 | extensionJAXBRootClass = FoosType.class) 3 | package tutorial.extension.foo; 4 | 5 | import org.drombler.acp.core.application.Extension; 6 | import tutorial.extension.foo.jaxb.FoosType; 7 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/other/SomeOtherAnnotation.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.other; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Documented 10 | @Retention(RetentionPolicy.SOURCE) 11 | @Target(ElementType.TYPE) 12 | public @interface SomeOtherAnnotation { 13 | 14 | Class[] barClasses(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/other/impl/SomeOtherAnnotationProcessor.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.other.impl; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | import java.util.stream.Collectors; 6 | import javax.annotation.processing.RoundEnvironment; 7 | import javax.annotation.processing.SupportedAnnotationTypes; 8 | import javax.annotation.processing.SupportedSourceVersion; 9 | import javax.lang.model.SourceVersion; 10 | import javax.lang.model.element.AnnotationMirror; 11 | import javax.lang.model.element.TypeElement; 12 | import javax.lang.model.type.TypeMirror; 13 | import org.drombler.acp.core.application.processing.AbstractApplicationAnnotationProcessor; 14 | import org.softsmithy.lib.lang.model.type.ModelTypeUtils; 15 | import tutorial.extension.other.SomeOtherAnnotation; 16 | 17 | @SupportedAnnotationTypes({"tutorial.extension.SomeOtherAnnotation"}) 18 | @SupportedSourceVersion(SourceVersion.RELEASE_8) 19 | public class SomeOtherAnnotationProcessor extends AbstractApplicationAnnotationProcessor { 20 | 21 | @Override 22 | protected boolean handleProcess(Set annotations, 23 | RoundEnvironment roundEnv) { 24 | roundEnv.getElementsAnnotatedWith(SomeOtherAnnotation.class).forEach(element -> { 25 | List annotationMirrors 26 | = element.getAnnotationMirrors(); 27 | List classNames 28 | = ModelTypeUtils.getTypeMirrorsOfClassArrayAnnotationValue( 29 | annotationMirrors, 30 | SomeOtherAnnotation.class, 31 | "barClasses").stream() 32 | .map(TypeMirror::toString) 33 | .collect(Collectors.toList()); 34 | 35 | //... 36 | }); 37 | return false; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/other/impl/SomeOtherComponent.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.other.impl; 2 | 3 | import tutorial.extension.other.SomeOtherAnnotation; 4 | import tutorial.extension.other.package1.Bar1; 5 | import tutorial.extension.other.package2.Bar2; 6 | 7 | @SomeOtherAnnotation(barClasses = {Bar1.class, Bar2.class}) 8 | public class SomeOtherComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/other/package1/Bar1.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.other.package1; 2 | 3 | public class Bar1 { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/other/package2/Bar2.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.other.package2; 2 | 3 | public class Bar2 { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/some/Sample.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.some; 2 | 3 | public class Sample { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/some/SomeAnnotation.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.some; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Documented 10 | @Retention(RetentionPolicy.SOURCE) 11 | @Target(ElementType.TYPE) 12 | public @interface SomeAnnotation { 13 | 14 | Class someType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/some/impl/SomeAnnotationProcessor.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.some.impl; 2 | 3 | import org.drombler.acp.core.application.processing.AbstractApplicationAnnotationProcessor; 4 | import org.softsmithy.lib.lang.model.type.ModelTypeUtils; 5 | import tutorial.extension.some.SomeAnnotation; 6 | 7 | import javax.annotation.processing.RoundEnvironment; 8 | import javax.annotation.processing.SupportedAnnotationTypes; 9 | import javax.annotation.processing.SupportedSourceVersion; 10 | import javax.lang.model.SourceVersion; 11 | import javax.lang.model.element.TypeElement; 12 | import javax.lang.model.type.TypeMirror; 13 | import java.util.Set; 14 | 15 | @SupportedAnnotationTypes({"tutorial.extension.SomeAnnotation"}) 16 | @SupportedSourceVersion(SourceVersion.RELEASE_11) 17 | public class SomeAnnotationProcessor extends AbstractApplicationAnnotationProcessor { 18 | 19 | @Override 20 | protected boolean handleProcess(Set annotations, 21 | RoundEnvironment roundEnv) { 22 | roundEnv.getElementsAnnotatedWith(SomeAnnotation.class).forEach(element -> { 23 | SomeAnnotation someAnnotation = element.getAnnotation(SomeAnnotation.class); 24 | if (someAnnotation != null) { 25 | TypeMirror typeMirror 26 | = ModelTypeUtils.getTypeMirror(someAnnotation::someType); 27 | 28 | //... 29 | } 30 | }); 31 | return false; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/extension/some/impl/SomeComponent.java: -------------------------------------------------------------------------------- 1 | package tutorial.extension.some.impl; 2 | 3 | import tutorial.extension.some.Sample; 4 | import tutorial.extension.some.SomeAnnotation; 5 | 6 | @SomeAnnotation(someType = Sample.class) 7 | public class SomeComponent { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/progressmonitor/Foo.java: -------------------------------------------------------------------------------- 1 | package tutorial.progressmonitor; 2 | 3 | public class Foo { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/java/tutorial/statusbar/SampleStatusBarElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Notice 3 | * 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 5 | * Version 1.0 (the "License"); you may not use this file except in 6 | * compliance with the License. A copy of the License is available at 7 | * http://www.opensource.org/licenses/cddl1.txt 8 | * 9 | * The Original Code is Drombler.org. The Initial Developer of the 10 | * Original Code is Florian Brunner (GitHub user: puce77). 11 | * Copyright 2016 Drombler.org. All Rights Reserved. 12 | * 13 | * Contributor(s): . 14 | */ 15 | package tutorial.statusbar; 16 | 17 | import javafx.scene.layout.BorderPane; 18 | import org.drombler.acp.core.status.StatusBarElement; 19 | import org.drombler.commons.client.geometry.HorizontalAlignment; 20 | 21 | @StatusBarElement(horizontalAlignment = HorizontalAlignment.CENTER, position = 20) 22 | public class SampleStatusBarElement extends BorderPane { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/resources/META-INF/drombler/application.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | a 9 | 10 10 | tutorial.extension.foo.impl.FooComponent2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/resources/META-INF/drombler/foos.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | a 6 | 10 7 | tutorial.extension.foo.impl.FooComponent2 8 | 9 | 10 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/resources/META-INF/services/javax.annotation.processing.Processor: -------------------------------------------------------------------------------- 1 | tutorial.extension.foo.impl.FooAnnotationProcessor 2 | 3 | -------------------------------------------------------------------------------- /drombler-fx-docs/src/main/resources/tutorial/docking/MyViewPane.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |