Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Display options for CrossTables
Display options for CrossTables [message #1721269] Tue, 26 January 2016 08:53 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 371
Registered: December 2015
Senior Member
Hi,

I have a semantic model that looks somehow like this:

a : A
|
|-b1 : B
| |
| |-c1 : C
| |-c2 : C
|-b2 : B
|-b3 : B

Basically there's an A, which contains Bs which themselves contain Cs.
Exciting stuff :P. I have a line mapping for A, one for B and one for C.
I would now like to have an easy option for the user to be able to
deactivate the mapping for C, so that only As and Bs are visible. My
current approach would be to have a semantic candidates expression for C
which reads some preference to find out if Cs should be shown or not,
but maybe there is a more direct way by disabling the mapping for C
programatically?

Also, If I would like to add some widgets to the top of the table, say a
combobox, or some checkboxes, how would I approach that?

Felix
Re: Display options for CrossTables [message #1721314 is a reply to message #1721269] Tue, 26 January 2016 14:29 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 267
Registered: July 2009
Senior Member
Le 26/01/2016 09:53, Felix Dorner a écrit :
> Hi,
>
Hi,

> I have a semantic model that looks somehow like this:
>
> a : A
> |
> |-b1 : B
> | |
> | |-c1 : C
> | |-c2 : C
> |-b2 : B
> |-b3 : B
>
> Basically there's an A, which contains Bs which themselves contain Cs.
> Exciting stuff :P. I have a line mapping for A, one for B and one for C.
> I would now like to have an easy option for the user to be able to
> deactivate the mapping for C, so that only As and Bs are visible. My
> current approach would be to have a semantic candidates expression for C
> which reads some preference to find out if Cs should be shown or not,
> but maybe there is a more direct way by disabling the mapping for C
> programatically?

You can manually Hide/Show Column (or Line) by using contextual menu
"Show/Hide > Hide/Sjow columns..." ("Show/Hide > Hide/Sjow lines...").
You can probably make a specific tool to Hide all C lines, by reusing
column/line visibility:
* org.eclipse.sirius.table.metamodel.table.DColumn.setVisible(boolean)
* org.eclipse.sirius.table.metamodel.table.DLine.setVisible(boolean)
*
org.eclipse.sirius.table.ui.tools.internal.editor.action.AbstractHideRevealAction<T>
>
> Also, If I would like to add some widgets to the top of the table, say a
> combobox, or some checkboxes, how would I approach that?
>

If you want to replace the "direct edit" cell (CellEditor), there is
currently no way to do that. It is automatically done by
org.eclipse.sirius.table.ui.tools.internal.editor.provider.DFeatureColumnEditingSupport.getBestCellEditor(EObject,
boolean).

> Felix

Regards,

--
Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Display options for CrossTables [message #1721423 is a reply to message #1721314] Wed, 27 January 2016 11:31 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 371
Registered: December 2015
Senior Member
Salut Laurent,

On 26-Jan-16 15:29, Laurent Redor wrote:

>
> You can manually Hide/Show Column (or Line) by using contextual menu
> "Show/Hide > Hide/Sjow columns..." ("Show/Hide > Hide/Sjow lines...").

I ended up to filter inside the semantic candidates expression. It looks
as it is the simplest solution: If C's should be shown, the candidate
expression service method checks the toggle state of my filter and
either returns the elements or not.

A different approach that I tried was to update the table description
model dynamically, i.e. When the user enables/disables the filter button
I actually remove/re-add the corresponding LineMapping from the model.
But I gave up when it came to handle crossreferences (when the
LineMapping is reused somewhere else..) It should be possible but the
first approach was a *snip* in comparison to this...

Felix
Previous Topic:Layer usage in Sirius introduction video
Next Topic:Containment Reference as Edge
Goto Forum:
  


Current Time: Thu Jan 21 11:39:30 GMT 2021

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

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

Back to the top