Open a properties Dialog from a custom widget [message #1806912] |
Fri, 17 May 2019 09:45  |
Eclipse User |
|
|
|
Hello, in my .odesign I found a way to show a properties dialog when I double click on an element of a list in a properties widget.
I have a custom widget table based on the example on the documentation.
I would like to get the same comportment with my custom widget as the one I have with the reference widget.
I guess I should define an advance custom widget and also define a custom operation.
Thanks
[Updated on: Fri, 17 May 2019 09:47] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Open a properties Dialog from a custom widget [message #1807967 is a reply to message #1807924] |
Thu, 13 June 2019 08:23   |
Eclipse User |
|
|
|
Hi,
The code you used is meant to handle only simple click.
I updated a working sample based on what we do for List widget (EEFListLifecycleManager, EEFListController ).
The modifications I have done are :
- added in TableLifecycleManager#aboutToBeShown():
this.tableSelectionListener = new EEFTableSelectionListener(this.controller);
this.tableViewer.getTable().addSelectionListener(tableSelectionListener);
- aboutToBeHidden():
if (this.tableViewer != null && this.tableViewer.getTable() != null && !this.tableViewer.getTable().isDisposed()) {
this.tableViewer.getTable().removeSelectionListener(this.tableSelectionListener);
}
- added in TableController:
@Override
public void onClick(Object element, String onClickEventKind) {
this.editingContextAdapter.performModelChange(() -> {
Map<String, Object> variables = new HashMap<String, Object>();
variables.putAll(this.variableManager.getVariables());
variables.put(EEFExpressionUtils.EEFList.SELECTION, element);
variables.put(EEFExpressionUtils.EEFList.ON_CLICK_EVENT_KIND, onClickEventKind);
EvalFactory.of(this.interpreter, variables).call(this.getCustomExpression(ON_CLICK_EXPRESSION_ID).get());
});
}
- Also add interface IEEFOnClickController
public class TableController extends AbstractEEFCustomWidgetController implements IEEFOnClickController{
Regards,
[Updated on: Thu, 13 June 2019 08:32] by Moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07888 seconds