Community
Participate
Working Groups
On a diagram editor with a custom tabbar that contributed the "Copy format" tabbar action, activating it causes the following NPE: java.lang.NullPointerException at org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.getDiagramCommandStack(DiagramAction.java:151) at org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.execute(DiagramAction.java:141) at org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.doRun(DiagramAction.java:104) at org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler.run(AbstractActionHandler.java:360) at org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run(ActionManager.java:226) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:71) at org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(ActionManager.java:224) at org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler.runWithEvent(AbstractActionHandler.java:378) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565) at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:436) ... Steps to reproduce: - import DATA_0020 (from the acceptance test examples or from the attached zip) - this will import the project sample.tabbar.contributor.extension in your workspace - in this project open the class TabbarContributorSample, in the method "getDiagramElementContributionItem" add "diagramElementContributionItems.add(createCopyFormatContribution(part)); " to the list - launch a runtime - open a diagram - select an element and click on the tabbar action with the tooltip "Copy the format of the selected diagram elements" -> It should not open a popup with just a message "null" and throw the NPE.
Created attachment 283538 [details] Data_0020
In the attached sample, I have already added the missing code line "diagramElementContributionItems.add(createCopyFormatContribution(part));" that is not in the sample imported for the acceptance test example.