Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to set table cell values programmatically?
How to set table cell values programmatically? [message #1841779] Fri, 28 May 2021 11:55 Go to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 334
Registered: August 2013
Senior Member
Hi

Is it possible to set a cross-table cells and plain table cells programmatically? Is there any API?
Re: How to set table cell values programmatically? [message #1841818 is a reply to message #1841779] Mon, 31 May 2021 07:35 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 644
Registered: July 2009
Senior Member
Hi,

I'm not sure I understand your question.
The values displayed in cells are computed from your EMF semantic model using the rules in your odesign file using the "label expression".
Unless I misunderstand your question, the normal way to change the content of a cell is to modify the underlying semantic EMF model and let Sirius refresh the table's cells accordingly.

If you try to change the text of a cell by modifying Sirius's own data model (i.e. the DCell objects), your modifications will be lost on the next refresh as Sirius will overwrite your change with the result of the label expression.



Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to set table cell values programmatically? [message #1841833 is a reply to message #1841818] Mon, 31 May 2021 17:53 Go to previous message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 334
Registered: August 2013
Senior Member
Hi

Thanks for answer! We can't change a semantic model directly, because we need to implement a generic "CSV to Sirius Table" importer. And the importer doesn't "know" the metamodel.

I'm not sure that it's a right solution. At now we use the following approach:
1) Get a feature for a cell using TableHelper.getEStructuralFeature()
2) Set the cell value using TableCommandFactory.buildSetValue()

It seems to work.
Previous Topic:Delete Edge Tool with bi-directional reference
Next Topic:Using an operation to change the style of elements in my model using an action call/operation
Goto Forum:
  


Current Time: Sun Sep 25 21:55:20 GMT 2022

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

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

Back to the top