Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Master Detail pattern using default controls
[EMF Forms] Master Detail pattern using default controls [message #1407496] Tue, 12 August 2014 19:22 Go to next message
Marco Descher is currently offline Marco DescherFriend
Messages: 197
Registered: October 2010
Location: Austria
Senior Member
I realize that there exists a view model element Tree Master Detail Views for realizing the master detail with a tree, is there however a way to realize this with the default renderer?

I imagine something like this which is not supported, harnessing the e4 way to do it

// NOT WORKING CODE
ECPFXView view;
	
	@Inject
	public ContactDetailsViewForms(BorderPane parent, final MApplication application) {
		ECPFXView view = ECPFXViewRenderer.INSTANCE.render((Contact) null);
		parent.setCenter(view.getFXNode());
	}

	@Inject
	public void setSelection(@Optional Contact selectedItem) {
		view.setEObject(selectedItem);
	}
Re: [EMF Forms] Master Detail pattern using default controls [message #1407681 is a reply to message #1407496] Wed, 13 August 2014 07:49 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

the JavaFX renderer currently does not support the tree master detail
view model element, meaning there is a renderer for SWT, but currently
not for JavaFX. Sponsoring or contributions are welcome! :-)

Best regards

Jonas

Am 12.08.2014 21:22, schrieb Marco Descher:
> I realize that there exists a view model element
> http://eclipsesource.com/blogs/tutorials/emf-forms-view-model-elements/
> for realizing the master detail with a tree, is there however a way to
> realize this with the default renderer?
>
> I imagine something like this which is not supported, harnessing the e4
> way to do it
>
>
> // NOT WORKING CODE
> ECPFXView view;
>
> @Inject
> public ContactDetailsViewForms(BorderPane parent, final MApplication
> application) {
> ECPFXView view = ECPFXViewRenderer.INSTANCE.render((Contact) null);
> parent.setCenter(view.getFXNode());
> }
>
> @Inject
> public void setSelection(@Optional Contact selectedItem) {
> view.setEObject(selectedItem);
> }
>
Re: [EMF Forms] Master Detail pattern using default controls [message #1407703 is a reply to message #1407681] Wed, 13 August 2014 08:58 Go to previous messageGo to next message
Marco Descher is currently offline Marco DescherFriend
Messages: 197
Registered: October 2010
Location: Austria
Senior Member
Hy Jonas,

thanks for the Feedback. So the Tree master detail is not available for JavaFX thats okay, but does there exist a view model that supports master detail pattern, without using the Tree master detail view model element - as described above?

thank you very much!!
Re: [EMF Forms] Master Detail pattern using default controls [message #1408174 is a reply to message #1407703] Thu, 14 August 2014 12:34 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hy,

no, otherwise we would not have created the tree master details view
model element ;).

> Hy Jonas,
>
> thanks for the Feedback. So the Tree master detail is not available for
> JavaFX thats okay, but does there exist a view model that supports
> master detail pattern, without using the Tree master detail view model
> element - as described above?
>
> thank you very much!!


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Re: [EMF Forms] Master Detail pattern using default controls [message #1408385 is a reply to message #1408174] Thu, 14 August 2014 23:53 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 63
Registered: March 2012
Member
Hi,
first of all I must say, that there is a TreeMasterDetail Renderer for JavaFX. It still would need polishing but it works.
Secondly, as far as I understand, you want to have a view on the left hand side and by selecting some element there and setting it to the selectionservice you want to update the right hand side?
Take a look at http://git.eclipse.org/c/emfclient/org.eclipse.emf.ecp.core.git/tree/bundles/javafx/org.eclipse.emf.ecp.application.e4.fx . It opens a new Editor for each element, but the code of the editor would still be more or less the same:
//no guarantee for completness
@Inject BorderPane parent;

@Inject
public ContactDetailsViewForms(
}

@Inject
public void setSelection(@Optional Contact selectedItem) {
if(selectedItem!=null){
ECPFXView view = ECPFXViewRenderer.INSTANCE.render(selectedItem);
parent.setCenter(view.getFXNode());
}
}

--
Eugen Neufeld

Get Professional Eclipse Support: http://eclipsesource.com/munich
Re: [EMF Forms] Master Detail pattern using default controls [message #1412869 is a reply to message #1408385] Wed, 27 August 2014 09:01 Go to previous message
Marco Descher is currently offline Marco DescherFriend
Messages: 197
Registered: October 2010
Location: Austria
Senior Member
Hy Eugen, thank you for your feedback, thats exactly the scenario I am looking for!
Previous Topic:[EMF FORMS] Validation & Rules.
Next Topic:[EMF Forms] Rule Based (dynamic) Enable/Disable of Controls
Goto Forum:
  


Current Time: Thu Apr 25 09:38:59 GMT 2024

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

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

Back to the top