Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Loading an FXML file and inject its controller into an E4 Part automatically(What's the smartest way to load an FXMl file and inject its controller into an E4 Part)
Loading an FXML file and inject its controller into an E4 Part automatically [message #1384994] Tue, 03 June 2014 14:01 Go to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi,

in my E4 application, every E4 Part has a corresponding FXMl file + controller:

XYZPart.java
XYZ.fxml
XYZController.java

I would like to load the FXML file and inject the controller instance into the Part whenever the Part instance is being created:

public class XYZPart {

    @Inject
    public void init(BorderPane pane, XYZController controller) {
        pane.setCenter(controller.getRootNode());
        // further calls on the controller instance
    }
}

This wiring should happen automatically by an external instance, as I don't want the Part to bother with the details of the FXML loading process.

Could this be achieved using an add-on in the application model? I may look something like this:

public class PartRendererAddon {

    private EventHandler eventHandler;

    @PostConstruct
    public void execute(final IEventBroker eventBroker, @ContextValue(contextKey="controller") ContextBoundValue<XYZController> value) {
        eventHandler = new EventHandler() {
            @Override
            public void handleEvent(final Event event) {
                // not sure if this is the correct property
                Object part = event.getProperty(UIEvents.EventTags.ELEMENT);
                if (part instanceof MPart) {
                    renderPart((MPart) part, value);
                }
            }
        };
 
        // not sure if this is the correct event
        eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, eventHandler);
    }

    private void renderPart(MPart part, ContextBoundValue<XYZController> value) {
            String controllerPath = getControllerPath(part);
            Object controller = loadFXML(controllerPath);
            // add to the context
            value.publish(controller);
        }
    }

    private Object loadFXML(final String path) {
        FXMLLoaderFactory fxmlLoaderFactory = getFXMLLoaderFactory();
        // load FXML and return controller instance
    }

    private FXMLLoaderFactory getFXMLLoaderFactory() {
        //
    }

    private String getPath(final MPart part) {
        // calculate path to FXML based on part's name
    }
}


As I see it, there are at least two open questions in this approach:

1. how do we get the correct FXMLLoaderFactory instance for the part?
2. will the controller instance be destroyed when the part and its context is being destroyed?

And are there any smarter or more elegant solutions than using an add-on?

Thanks,
Uwe

[Updated on: Tue, 03 June 2014 14:02]

Report message to a moderator

Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385393 is a reply to message #1384994] Fri, 06 June 2014 06:43 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
It took some time to respond by we already talked about this in our
company a few weeks back. I need to talk to one of my co-workers but one
of my ideas was that the Part could simple be the controller not?

This would give you XYZPart.java & XYZ.fxml we could Convention over
Configuration and teach our PartRenderer the concept of this. Then you
only have to tag the MPart e.g. as FXML and you are ready to go. Another
route would be to introduce a new MPart subclass but I'd prefer to use
Convention over Configuration.

Tom

On 03.06.14 16:01, Uwe San wrote:
> Hi,
>
> in my E4 application, every E4 Part has a corresponding FXMl file +
> controller:
>
> XYZPart.java
> XYZ.fxml
> XYZController.java
>
> I would like to load the FXML file and inject the controller instance
> into the Part whenever the Part instance is being created:
>
>
> public class XYZPart {
>
> @Inject
> public void init(BorderPane pane, XYZController controller) {
> pane.setCenter(controller.getRootNode());
> // further calls on the controller instance
> }
> }
>
> This wiring should happen automatically by an external instance, as I
> don't want the Part to bother with the details of the FXML loading process.
>
> Could this be achieved using an add-on in the application model? I may
> look something like this:
>
>
> public class PartRendererAddon {
>
> private EventHandler eventHandler;
>
> @PostConstruct
> public void execute(final IEventBroker eventBroker,
> @ContextValue(contextKey="controller")
> ContextBoundValue<XYZController> value) {
> eventHandler = new EventHandler() {
> @Override
> public void handleEvent(final Event event) {
> // not sure if this is the correct property
> Object part = event.getProperty(UIEvents.EventTags.ELEMENT);
> if (part instanceof MPart) {
> renderPart((MPart) part, value);
> }
> }
> };
>
> // not sure if this is the correct event
> eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET,
> eventHandler);
> }
>
> private void renderPart(MPart part, ContextBoundValue<XYZController>
> value) {
> String controllerPath = getControllerPath(part);
> Object controller = loadFXML(controllerPath);
> // add to the context
> value.publish(controller);
> }
> }
>
> private Object loadFXML(final String path) {
> FXMLLoaderFactory fxmlLoaderFactory = getFXMLLoaderFactory();
> // load FXML and return controller instance
> }
>
> private FXMLLoaderFactory getFXMLLoaderFactory() {
> //
> }
>
> private String getPath(final MPart part) {
> // calculate path to FXML based on part's name
> }
> }
>
>
> As I see it, there are at least two open questions in this approach:
>
> 1. how do we get the correct FXMLLoaderFactory instance for the part?
> 2. will the controller instance be destroyed when the part and its
> context is being destroyed?
>
> And are there any smarter or more elegant solutions than using an add-on?
>
> Thanks,
> Uwe
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385395 is a reply to message #1385393] Fri, 06 June 2014 06:57 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi Tom,

thank you for your reply.

We discussed the same idea here, but we were wondering about one aspect of this setup: when the part acts as the controller, there can be an initialize() method called by the FXML loader mechanism and there can be a @PostConstruct-annotated method called by E4 after the part was constructed. Is there a well-defined order in which these methods are called? Should one use both mechanisms in one class at all? What's your opinion?

Uwe
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385397 is a reply to message #1385395] Fri, 06 June 2014 07:16 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes the order is fixed as:

- Constructor Injection (Eclipse DI)
- Field Injection (Eclipse DI)
- Method Injection (Eclipse DI)
- @PostConstruct (Eclipse DI)
- @FXML-Field Injection (FXML DI)
- initialize() (FXML DI)

- ....
- Field / Method Injection (Eclipse DI)
- @FXML-Callbacks

- Field / Method Injection (Eclipse DI)
- @FXML-Callbacks
- .....

- @PersistState (Eclipse DI)
- @PreDestroy (Eclipse DI)

which is not 100% perfect.

IMHO in a perfect world we would have:

- Constructor Injection (Eclipse DI)
- @FXML-Field Injection (FXML DI)
- Field Injection (Eclipse DI)
- Method Injection (Eclipse DI)
- @PostConstruct (Eclipse DI)
*- (NOT NEEDED)initialize() (FXML DI)*

- ....
- Field / Method Injection (Eclipse DI)
- @FXML-Callbacks

- Field / Method Injection (Eclipse DI)
- @FXML-Callbacks
- .....

- @PersistState (Eclipse DI)
- @PreDestroy (Eclipse DI)

Need to think about that, not sure I have a solution to get us to a
perfect world!

Tom

On 06.06.14 08:57, Uwe San wrote:
> Hi Tom,
>
> thank you for your reply.
>
> We discussed the same idea here, but we were wondering about one aspect
> of this setup: when the part acts as the controller, there can be an
> initialize() method called by the FXML loader mechanism and there can be
> a @PostConstruct-annotated method called by E4 after the part was
> constructed. Is there a well-defined order in which these methods are
> called? Should one use both mechanisms in one class at all? What's your
> opinion?
>
> Uwe
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385401 is a reply to message #1385397] Fri, 06 June 2014 08:18 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
This is a great listing, thank you.

Until e(fx)clipse's PartRenderer knows about this new CoC mechanism, we will have to load the FXML manually in some kind of custom renderer, I assume.

One other question that comes to my mind is who's responsible for creating the part instance in this scenario? Is it E4 because the part is an element of the application model? Or is it the FXML loader because the part is referenced as the controller in the FXML file? Of course, the PartRenderer could make sure that only one instance of the part will be created and connected to E4 and the FXML side.
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385407 is a reply to message #1385401] Fri, 06 June 2014 08:52 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
On second thought, I'm not sure if implementing a custom renderer will be straightforward. When the renderer loads the FXML file using the FXMLLoaderFactory instance, how do we make sure we're loading into the part's context? And what steps need to be taken to properly connect the resulting controller instance as a part to the application model? It looks like these things can be handled, but there might be some pitfalls as it's easy overlook something. So it might be best to wait until this becomes a feature in e(fx)clipse. Wink
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385410 is a reply to message #1385407] Fri, 06 June 2014 09:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
First step is to file a bug/feature-report ;-)

Tom

On 06.06.14 10:52, Uwe San wrote:
> On second thought, I'm not sure if implementing a custom renderer will
> be straightforward. When the renderer loads the FXML file using the
> FXMLLoaderFactory instance, how do we make sure we're loading into the
> part's context? And what steps need to be taken to properly connect the
> resulting controller instance as a part to the application model? It
> looks like these things can be handled, but there might be some pitfalls
> as it's easy overlook something. So it might be best to wait until this
> becomes a feature in e(fx)clipse. ;)
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385411 is a reply to message #1385410] Fri, 06 June 2014 09:16 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=436789

Smile
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385428 is a reply to message #1385411] Fri, 06 June 2014 11:15 Go to previous messageGo to next message
Jacek Bukowski is currently offline Jacek BukowskiFriend
Messages: 15
Registered: May 2014
Junior Member
Regarding the first code example in this thread. Will the part's context be already created at the point when UIEvents.UIElement.TOPIC_WIDGET is handled? Is the way presented (so using Addon) a good way of initializing something (it doesn't necessary be FXMLs) to be available in part's @PostConstruct method?

I also think it is a nice use case to have FXML controller separated from the part code. I am thinking now about more advanced parts, where there is lot's of "application logic code". In that case I would like to keep JavaFX-related code in the controller and "application logic" code in the part class. We could then inject one into another (e.g. by setters). It could still be based on Convention over Configuration. If there are XYZ.fxml and XYZPart.java, then part acts as controller. If there are XYZ.fxml, XYZController.java and XYZPart.java, then controller is separated from part.

Jacek
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385429 is a reply to message #1385428] Fri, 06 June 2014 11:36 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 06.06.14 13:15, Jacek Bukowski wrote:
> Regarding the first code example in this thread. Will the part's context
> be already created at the point when UIEvents.UIElement.TOPIC_WIDGET is
> handled? Is the way presented (so using Addon) a good way of
> initializing something (it doesn't necessary be FXMLs) to be available
> in part's @PostConstruct method?

At the moment the TOPIC_WIDGET is sent the UI has been fully constructed
== the Part-Instance has been created (constructor-injection,
field-injection, method-injection,@PostConstruct-Injection) has been done.

The first thing created for an element who inherits from MContext is to
create the IEclipseContext for it TOPIC_CONTEXT so most likely this is
the better point to initialize the the controller!

Generally speaking I'm not a huge fan of doing stuff that way because it
does not keep all relevant stuff in one place. I'd more like to have all
informations in the e4xmi because this would allow more tooling
possibilities e.g. the e4xmi-editor could show a preview of UI loading
the FXML, show error markers if you controller & fxml don't match.

>
> I also think it is a nice use case to have FXML controller separated
> from the part code. I am thinking now about more advanced parts, where
> there is lot's of "application logic code". In that case I would like to
> keep JavaFX-related code in the controller and "application logic" code
> in the part class. We could then inject one into another (e.g. by
> setters). It could still be based on Convention over Configuration. If
> there are XYZ.fxml and XYZPart.java, then part acts as controller. If
> there are XYZ.fxml, XYZController.java and XYZPart.java, then controller
> is separated from part.
>

I think I need to think about this some more but we should discuss this
on the bug Uwe created.

Tom
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385464 is a reply to message #1385429] Fri, 06 June 2014 15:17 Go to previous messageGo to next message
Jacek Bukowski is currently offline Jacek BukowskiFriend
Messages: 15
Registered: May 2014
Junior Member
Thanks for the reply. I have added comment to the Uwe's issue.

I am trying to use E4 also as general purpose DI framework (so to have in contexts not only objects directly related to E4 model). Consider the very complicated part, that you would like to split into more classes. Because I have DI I don't want create instances in my part's code, I would like them to be injected into my part, but still keep their lifecycle in sync with the part (so basically I would like them to be destroyed when part's context is destroyed). I see three options here:
1. Using @Creatable annotation - this has a drawback that the instance will not be placed into context, so it may lead to having different instances in different injections
2. Provide ContextFunction registered as OSGi service - I am not sure if that will place me objects into part's service as I want. Also it requires additional code (ContextFunction and OSGi service registration) just to create an object.
3. Object supplier - similar to but even more complicated than previous because now I need to create also an annotation.

Any advises?

Jacek
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385514 is a reply to message #1385464] Sun, 08 June 2014 10:47 Go to previous messageGo to next message
Eclipse UserFriend
>
> Any advises?
>
> Jacek
>
I am having the same problem as Jacek.

We are using nested fxml (including of one reusable fxml file in other),
and this complicate situation with controllers because we want them to
be wired on creation time and to be part of DI context.

So far we have working solution with spring DI, but, as Jacek already
mentioned, I would also like to use E4 as general purpose DI framework.
Any ideas how to work it out?
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385565 is a reply to message #1385514] Mon, 09 June 2014 13:50 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 08.06.14 12:47, Boris I. wrote:
>>
>> Any advises?
>>
>> Jacek
>>
> I am having the same problem as Jacek.
>
> We are using nested fxml (including of one reusable fxml file in other),
> and this complicate situation with controllers because we want them to
> be wired on creation time and to be part of DI context.
>
> So far we have working solution with spring DI, but, as Jacek already
> mentioned, I would also like to use E4 as general purpose DI framework.
> Any ideas how to work it out?

If you are using @FXMLLoader & FXMLLoaderFactory controllers are created
via DI and pushed into the IEclipseContext so that subcontrollers can
get them via @Inject.

To see the code search for InjectingFXMLLoader.

Tom
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385676 is a reply to message #1385565] Tue, 10 June 2014 12:53 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Obtaining the controllers works pretty nicely using the FXMLLoaderFactory, but what about other custom objects that you would like to inject into your presenter? These objects are not referenced in FXML, they are just dependencies of your presenter (e.g. sub-presenters or non-E4 services or)? I think this is what Jacek and "Eclipse User" were referring to when they mentioned a general purpose DI framework. The most important aspect here is that the lifecycle of these dependent objects should be the same as the presenter's lifecycle.
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385746 is a reply to message #1385676] Tue, 10 June 2014 21:48 Go to previous messageGo to next message
Eclipse UserFriend
On 10.06.14 14:53, Uwe San wrote:
> Obtaining the controllers works pretty nicely using the
> FXMLLoaderFactory, but what about other custom objects that you would
> like to inject into your presenter? These objects are not referenced in
> FXML, they are just dependencies of your presenter (e.g. sub-presenters
> or non-E4 services or)? I think this is what Jacek and "Eclipse User"
> were referring to when they mentioned a general purpose DI framework.
> The most important aspect here is that the lifecycle of these dependent
> objects should be the same as the presenter's lifecycle.

Hi Uwe, that is precisely our problem.

I would like to have a FX (complex) component (FXML file, includes other
FXML files, up to 3 levels) in a way that man presenter knows its
sub-presenters (auto-wired, on creation), including lifecycle in a way
that Uwe described.

At the moment we have working example with Spring DI (xml configuration)
but I would rather use Eclipse DI (Annotations). Using Spring DI
introduces additional (unnecessary) level of complexity.

Boris
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385748 is a reply to message #1385746] Tue, 10 June 2014 21:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 10.06.14 23:48, Boris I. wrote:
> On 10.06.14 14:53, Uwe San wrote:
>> Obtaining the controllers works pretty nicely using the
>> FXMLLoaderFactory, but what about other custom objects that you would
>> like to inject into your presenter? These objects are not referenced in
>> FXML, they are just dependencies of your presenter (e.g. sub-presenters
>> or non-E4 services or)? I think this is what Jacek and "Eclipse User"
>> were referring to when they mentioned a general purpose DI framework.
>> The most important aspect here is that the lifecycle of these dependent
>> objects should be the same as the presenter's lifecycle.
>
> Hi Uwe, that is precisely our problem.
>
> I would like to have a FX (complex) component (FXML file, includes other
> FXML files, up to 3 levels) in a way that man presenter knows its
> sub-presenters (auto-wired, on creation), including lifecycle in a way
> that Uwe described.

but they do get pushed to the context so if you have

root.fxml (RootController)
+ header.fxml (HeaderController)
+ content.fxml (ContentController)
+ foot.xml (FooterController)

Then you can do in your RootController:

class RootController {
@Inject
@Optional
HeaderController header;

@Inject
@Optional
ContentController content;

@Inject
@Optional
FooterController footer;
}

you need to declare the stuff @Optional because initially they are NULL
or am I missing the point completely. Then please create a sample of
what you have in mind (even if it currently does not run and add that to
the bug)

Tom
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385776 is a reply to message #1385748] Wed, 11 June 2014 07:41 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi Tom,

obtaining the controller instances is not the problem. It works fine as you described. The problem is in the presenters (or any other classes that are not referenced in the FXML file or managed by E4 by default).

Let's take your example and assume there is a presenter class associated with every controller:

RootPresenter
+ HeaderPresenter
+ ContentPresenter
+ FooterPresenter

The RootPresenter class could be an E4 part and look like this:

public class RootPresenter {

    // field declarations...

    @PostConstruct
    public void init(BorderPane pane, @FXMLLoader FXMLLoaderFactory loaderFactory, HeaderPresenter headerPresenter) {

        Data<Node, RootController> data = loadFXML(loaderFactory);
        pane.setCenter(data.getNode());

        RootController rootController = data.getController();
        HeaderController headerController = rootController.getHeaderController();
        headerPresenter.setController(headerController);
        headerPresenter.init();
        // do more meaningful stuff with the sub-presenter or the controllers...

    }
}


Now the question is: what's the best way to put the HeaderPresenter instance into the part's context such that we can conveniently inject it into the init() method? The HeaderPresenter instance should have the same lifecycle as the part.

Jacek mentioned things like context functions, object suppliers, @Creatable, ... and it would be helpful to know what the preferred mechanism is - if there is one.

I hope the problem is clearer now.

Thanks,
Uwe
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385779 is a reply to message #1385776] Wed, 11 June 2014 07:59 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I gets clearer but I'm not 100% sure I can suggest the prefered/nicest
way yet. Would you mind setting up a small sample project with the
information so that I can play around a bit with it and attach it to the
bug report.

I think the ideal thing would be to get away without any manual code -
I'm not sure why you need another class because you already have MVP
although FX calls it controller.

What are the responsibilities of the different classes:
- FXML - View
- Controller
- Presenter

Tom

On 11.06.14 09:41, Uwe San wrote:
> Hi Tom,
>
> obtaining the controller instances is not the problem. It works fine as
> you described. The problem is in the presenters (or any other classes
> that are not referenced in the FXML file or managed by E4 by default).
>
> Let's take your example and assume there is a presenter class associated
> with every controller:
>
> RootPresenter
> + HeaderPresenter
> + ContentPresenter
> + FooterPresenter
>
> The RootPresenter class could be an E4 part and look like this:
>
>
> public class RootPresenter {
>
> // field declarations...
>
> @PostConstruct
> public void init(BorderPane pane, @FXMLLoader FXMLLoaderFactory
> loaderFactory, HeaderPresenter headerPresenter) {
>
> Data<Node, RootController> data = loadFXML(loaderFactory);
> pane.setCenter(data.getNode());
>
> RootController rootController = data.getController();
> HeaderController headerController =
> rootController.getHeaderController();
> headerPresenter.setController(headerController);
> headerPresenter.init();
> // do more meaningful stuff with the sub-presenter or the
> controllers...
>
> }
> }
>
>
> Now the question is: what's the best way to put the HeaderPresenter
> instance into the part's context such that we can conveniently inject it
> into the init() method? The HeaderPresenter instance should have the
> same lifecycle as the part.
>
> Jacek mentioned things like context functions, object suppliers,
> @Creatable, ... and it would be helpful to know what the preferred
> mechanism is - if there is one.
>
> I hope the problem is clearer now.
>
> Thanks,
> Uwe
Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385789 is a reply to message #1385779] Wed, 11 June 2014 08:36 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Thomas Schindl wrote on Wed, 11 June 2014 03:59
I think the ideal thing would be to get away without any manual code -
I'm not sure why you need another class because you already have MVP
although FX calls it controller.

What are the responsibilities of the different classes:
- FXML - View
- Controller
- Presenter


We would like to keep the presenter free of any JavaFX UI dependencies if possible (JavaFX beans are allowed Wink), so in our case the view consists of the FXML and the (rather dumb/passive) controller. The controller handles simple UI logic, but no domain logic, which is delegated to the presenter.

The more I think about the DI/context question from my previous posts, the more I realise that this question is not directly related to JavaFX and E4, but to E4 alone. The general problem is to find a good way for putting custom objects into a part's context, regardless of any FXML structures.

I'll prepare a small sample project for you to play with.

Uwe

[Updated on: Wed, 11 June 2014 08:37]

Report message to a moderator

Re: Loading an FXML file and inject its controller into an E4 Part automatically [message #1385830 is a reply to message #1385789] Wed, 11 June 2014 13:10 Go to previous message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Here's a sample E4 project which contains one E4 part and one Service class of which an instance should be injected into the part's init() method.

In order to make the sample work, I annotated the Service class with @Creatable, but that does not put the instance into the part's context.

I look forward to your feedback.

Thanks,
Uwe
  • Attachment: Example.zip
    (Size: 19.57KB, Downloaded 188 times)

[Updated on: Wed, 11 June 2014 13:10]

Report message to a moderator

Previous Topic:Breaking change in nightly builds
Next Topic:Tooling to create JavaFX Beans?
Goto Forum:
  


Current Time: Thu Apr 18 07:48:04 GMT 2024

Powered by FUDForum. Page generated in 0.02919 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top