Skip to main content



      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 07:55 Go to next message
Eclipse UserFriend
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 03:35 Go to previous messageGo to next message
Eclipse UserFriend
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.

Re: How to set table cell values programmatically? [message #1841833 is a reply to message #1841818] Mon, 31 May 2021 13:53 Go to previous message
Eclipse UserFriend
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: Tue Jul 15 03:10:49 EDT 2025

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

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

Back to the top