assemblits / eru

The open JavaFX SCADA
GNU General Public License v3.0
14 stars 9 forks source link

Scene Builder embedding :fire: :fire: :fire: #16

Closed marl0rd closed 7 years ago

marl0rd commented 7 years ago

This is a big topic. For now, we create:

The next mileston is create the displays, so the user can create Human Machine Interfaces using the Dynamo library gauges that are already working.

Simple scope: Just one display in fine (no links to other displays).

Proposal Create another main tree item in the project tree called Displays and when someone double click it the App shows the embedded Scene Builder in the mainPane of the Skeleton. Sounds easy...

Steps

Good luck

marl0rd commented 7 years ago

SceneBuilder is an open source project. Binaries for SceneBuilder are now available through Gluon. SceneBuilder was split into two parts:

SceneBuilderKit (a reusable framework) SceneBuilder (the actual SceneBuilder application, built using the framework). SceneBuilder source is currently still hosted as part of the JavaFX source repository (which is also open source). The current development version of SceneBuilder based upon Java 9 development efforts is located at:

http://hg.openjdk.java.net/openjfx/9-dev/rt/file/tip/apps/scenebuilder Work was done on the SceneBuilder application itself so that it is able to be embedded into an IDE directly rather than needing to run as a stand-alone application (though it can also still run as a stand-alone application).

marl0rd commented 7 years ago

Here the repository: https://bitbucket.org/gluon-oss/scenebuilder

marl0rd commented 7 years ago

@gilbertojrequena There is something interesting. In My InteliiJ installation there is a jar file in :

/opt/idea/idea-IU-171.4249.39/plugins/javaFX/lib

Seems like IntelliJ use it to embed Scene Builder... Keep searching...

gilbertojrequena commented 7 years ago

Yes, I just addressed how IntelliJ uses it, I'm still digging into it :)

marl0rd commented 7 years ago

If you look inside the jar, it uses only the kit (as my second comment said). And IJ is not using the GLUON version, is using the oracle instead.

/opt/idea/idea-IU-171.4249.39/plugins/javaFX/lib/SceneBuilderKit-8.2.0.jar:

/com/oracle/javafx/scenebuilder/kit/

gilbertojrequena commented 7 years ago

Actually they are using GLUON. As per https://github.com/JetBrains/intellij-community/blob/0be5219fa7f32612d6dec71845a12599d4940b15/platform/build-scripts/groovy/org/jetbrains/intellij/build/CommunityLibraryLicenses.groovy#L332

marl0rd commented 7 years ago

I am looking how the Scene Builder is open by itself using the kit here: https://bitbucket.org/gluon-oss/scenebuilder/src/6727faef1349b6ad603fe20a772b83d29d3c8c83/src/main/java/com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java?at=default&fileviewer=file-view-default

marl0rd commented 7 years ago

Bassically:

public void performControlAction(ApplicationControlAction a, DocumentWindowController source) {
        switch (a) {
...
            case NEW_FILE:
                final DocumentWindowController newWindow = makeNewWindow();
                newWindow.loadWithDefaultContent();
                newWindow.openWindow();
                break;
...
            case OPEN_FILE:
                performOpenFile(source);
                break;
...
        }
    }
marl0rd commented 7 years ago

@gilbertojrequena : JetBrains/intellij-community is actually the whole IDE in open-source?????

gilbertojrequena commented 7 years ago

Just the community version

gilbertojrequena commented 7 years ago

Implementation finished with https://github.com/eru-scada/eru/commit/4a37b6179675b3b1e3dc645dad5ea3d33792ee28

gilbertojrequena commented 7 years ago

Linking components with tags will be covered with another issue.