You were almost there. You need to write the code to call in a String to be interpreted by EASE on the button pressed event. Also txt* are Java Object references so you need to call the methods in camel case:
Good Morning @YvanLussaud, when I observed closely I found that my program continuously run, I assume that button must be waiting for the input and hence continuously waiting for the press button event, but what if I don’t want to keep it waiting and if I press the Save button once the program should execute and free the engine/interpreter.
The script runs while the View is opened to react to the UI changes. So the idea is to close the view.
To do this we need two things a reference to the view:
part = createView("Create Contact");
This give us a MPart from the e4 API, to close it we need to call EPartService.hidePart(part, True)
Interesting, I didn’t looked at it as I was not concerned with that at that particular moment but glad to see it works, could you also guide me to more information about this, like how do I get to learn about existence of such APIs…
Here we can see that the returned object if a MView. That’s a Java object but to get more information about its class you can run:
print(view.getClass().getCanonicalName())
And now we know it’s part of the E4 GUI. From here I searched on Eclipse forums to find how to close the MPart and we need to have access to an instance of EPartService. But in most examples it was injected using @Inject annotation. And that’s not possible from a Python script so I looked how the injection worked to find the Java code that does the same thing. Then I converted it into Python and calling Java APIs via EASE…
This is the bit extend version of the code where I was trying out closeView() of the UI module of EASE, turns out it works in the same way (turns off the progress bar thing on the buttom right ) as it closes the view that was created, also you may see some commented code in the block.
I create a dedicated button to close the view but uncommenting it and have both the button on and pressing one of them to close the view but don’t get rid of the progress bar…