Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » view selection event
view selection event [message #1602209] Thu, 05 February 2015 11:44 Go to next message
Sebastian Lehmann is currently offline Sebastian LehmannFriend
Messages: 8
Registered: January 2014
Junior Member
Hello,

I just try to migrate a small private e4 with SWT / JFace app to efxclipse and just have a problem with the communication between parts.

The code was fine with e4 with JFace / SWT.

Part A (sender) is now slightly different:
@Inject
private ESelectionService selectionService;

private TreeView<Person> treeView;
...

@PostConstruct
void init(BorderPane pane) {
..
treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<Person>>() {
@Override
public void changed(ObservableValue<? extends TreeItem<Person>> observable,
TreeItem<Person> oldValue, TreeItem<Person> newValue) {
selectionService.setSelection(newValue);
System.out.println("set: " + newValue); // OK
}
});

Part B (receiver):
@Inject
void setSelection(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Person selectedPerson) {
System.out.println("readSelection: " + selectedPerson);
if (selectedPerson != null) {
// TODO
}
}

The result is:
readSelection: null
set: TreeItem [ value: PersonXYZ ]

Part B does not receive the selection and strangely the method in Part B is called before this one from Part A.

Does someone has an idea?

Thank You
Sebastian
Re: view selection event [message #1602215 is a reply to message #1602209] Thu, 05 February 2015 11:49 Go to previous message
Sebastian Lehmann is currently offline Sebastian LehmannFriend
Messages: 8
Registered: January 2014
Junior Member
Ok; i found the problem:
selectionService.setSelection(newValue.getValue());
Wink
Previous Topic:Is it possible to use the MessageRegistry with Choiceboxes?
Next Topic:[Announcement] e(fx)clipse 2.0.0 informations
Goto Forum:
  


Current Time: Sat Apr 27 00:51:08 GMT 2024

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

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

Back to the top