Community
Participate
Working Groups
The copy layout action throws a NullPointerException with the custom tab-bar from https://www.eclipse.org/sirius/doc/developer/extensions-provide_tabbar_extensions.html#contributeFullTabbar
Hi Axel, Could you provide an example to reproduce problem please? Thanks. Regards,
Julien, The example is in the documentation. Regards,
See also org.eclipse.sirius.tests.swtbot.tabbar.TabbarContributorExtensionTest The tests checks that the contribution is effective but the provided actions are not tested (and the path to update them might be different) For exemple with CopyLayoutAction (CopyFormatAction on master), * Create a plugin project and setup a tabbar contributor following the documentation (use the provided sample) * Launch a runtime * Open any diagram * Select one or several diagram elements. * Clic on the tabbar action > the NPE occurs on CopyLayoutAction(DiagramAction).getDiagramCommandStack because getWorkbenchPart() returns null. Note that during getCommand(), in debug mode the getDiagramCommandStack() returns the command stack without error Note that the error does not occur anymore as soon as we comment the extension and relaunch the runtime. Additional issue: we should also add a sample to rebuild exactly the same tabbar (order, element). The current sample adds the copy layout action for diagram selection and the paste layout action for the diagram element selection, those actions have never been tested in these contexts.
Created attachment 276016 [details] Sample project to reproduce the issue Steps to reproduce: 1. Import the attached project 2. Launch a runtime 3. Create a Sirius diagram 4. Select an element on the diagram: the tabbar contributor should be taken into account and produce a tabbar with a single "Copy Format" action. 5. Click on the action in the tabbar => an error dialog opens indicating an NPE. 6. Set the focus in the Model Explorer view and then back into the diagram 7. Re-click on the action in the tabbar: the error does not occur anymore. The action has no user-visible effect, but in the debugger it's possible to confirm the underlying command is indeed executed.