Error when deleting a table

I deleted a table while in preview mode. The designer tab went completely grey and this error message popped up:

After I clicked “okay” Designer tab comes back, but table is not deleted.

Stacktrace:

Cannot invoke "org.mozilla.interfaces.nsIEditor.getSelection()" because the return value of "com.objectiflune.application.designer.editors.HtmlEditor.getInternalEditor()" is null.
  java.lang.NullPointerException: Cannot invoke "org.mozilla.interfaces.nsIEditor.getSelection()" because the return value of "com.objectiflune.application.designer.editors.HtmlEditor.getInternalEditor()" is null
  	at com.objectiflune.application.designer.internal.handlers.g.run(g.java)
  	at com.objectiflune.application.designer.editors.internal.SourceEditor.withoutUndo(SourceEditor.java)
  	at com.objectiflune.application.designer.editors.HtmlEditor.lambda$22(HtmlEditor.java)
  	at com.objectiflune.application.designer.editors.v.run(v.java)
  	at com.objectiflune.application.designer.editors.bh.run(bh.java)
  	at com.objectiflune.application.designer.shared.d.run(d.java)
  	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
  	at com.objectiflune.application.designer.editors.bi.run(bi.java)
  	at com.objectiflune.application.designer.shared.d.run(d.java)
  	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
  	at com.objectiflune.application.designer.editors.HtmlEditor.withoutRedraw(HtmlEditor.java)
  	at com.objectiflune.application.designer.editors.HtmlEditor.runUnmerged(HtmlEditor.java)
  	at com.objectiflune.application.designer.editors.HtmlEditor.runUnmerged(HtmlEditor.java)
  	at com.objectiflune.application.designer.editors.TemplateEditor.runUnmerged(TemplateEditor.java)
  	at com.objectiflune.application.designer.editors.HtmlEditor.a(HtmlEditor.java)
  	at com.objectiflune.application.designer.editors.HtmlEditor.commitChanges(HtmlEditor.java)
  	at com.objectiflune.application.designer.editors.HtmlEditor.commitUndoableChanges(HtmlEditor.java)
  	at com.objectiflune.application.designer.internal.handlers.DeleteTableHandler.execute(DeleteTableHandler.java)
  	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
  	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
  	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
  	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
  	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
  	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
  	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
  	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
  	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
  	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
  	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
  	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
  	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
  	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
  	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
  	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
  	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4054)
  	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3642)
  	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
  	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
  	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
  	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
  	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:643)
  	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
  	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
  	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
  	at com.objectiflune.application.Application.start(Application.java)
  	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
  	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
  	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
  	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
  	at org.eclipse.equinox.launcher.Main.main(Main.java:1440)

I have had some odd errors over the years when deleting objects within the design browser. Could be that I was in the preview pane but not sure.

I sometimes just delete it from the source code or from the outline and I can’t recall having a problem using this method.

Yeah, I know what you mean. I was told that in the latest version those problems in the preview pane are solved. Obviously not.

Deleting scripted content like a scripted or dynamic table in preview mode may not have any effect (depending on exactly what you are doing) since that type of content is for the most part not persistent. It should not produce errors though. We are not aware of any open issues that can cause errors when editing in preview mode, but that doesn’t mean there are none.

Unfortunately I’m not able to reproduce what you’re describing. Was it a dynamic table? Was it created by a script? Was it split across pages? If so, did you delete only the first instance or multiple instances at the same time? How did you delete the table exactly? Right-click > Table > Delete? Edit > Delete Browser Element (Ctrl+K)? Selecting it (somehow) followed by Delete? Through the Outline view?

If there is a way to reproduce it consistently I would be happy to create a ticket.

  • It was a dynamic table generated by Table Wizard
  • it was over two pages
  • I selected the table in the element breadcrumb and then
  • I deleted the table by rightclick → table → delete

Sorry, I still don’t get an error.

Note: If a table is split across pages there are multiple table instances, one for each page. If you select a table in the breadcrumb bar you only select one of the instances. For a dynamic table most of the content is not persistent (i.e. only exists in preview mode) so even if we ignore the error, deleting one of the instances in preview mode would likely have no effect.