Display options for CrossTables [message #1721269] |
Tue, 26 January 2016 03:53  |
Eclipse User |
|
|
|
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 09:29   |
Eclipse User |
|
|
|
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
|
|
|
Re: Display options for CrossTables [message #1721423 is a reply to message #1721314] |
Wed, 27 January 2016 06:31  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03547 seconds