Error invoking a jface.Dialog from an ApplicationWindow

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Error invoking a jface.Dialog from an ApplicationWindow

Postby lacou » Tue Jan 20, 2004 9:02 am

I used swt-designer to create my jface dialog and when I invoke it inside an action using this code:

Code: Select all
m_DialogAction = new Action() {
public void run() {
  Dialog1 dialog = new Dialog1(thisWindow.getShell());;

(thisWindow is a variable pointing to my main jface ApplicationWindow since I am invoking from an innerclass inside an Action)

I get this error

Code: Select all

org.eclipse.jface.util.Assert$AssertionFailedException: Assertion failed: ContentViewer must have a content provider when input is set.
   at org.eclipse.jface.util.Assert.isTrue(
   at org.eclipse.jface.viewers.ContentViewer.setInput(
   at org.eclipse.jface.viewers.StructuredViewer.setInput(
   at Dialog1.createDialogArea(
   at org.eclipse.jface.dialogs.Dialog.createContents(
   at org.eclipse.jface.window.Window.create(
   at org.eclipse.jface.dialogs.Dialog.create(
   at AppWindow1$
   at org.eclipse.jface.action.Action.runWithEvent(
   at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(
   at org.eclipse.jface.action.ActionContributionItem.access$2(
   at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(
   at org.eclipse.swt.widgets.EventTable.sendEvent(
   at org.eclipse.swt.widgets.Widget.sendEvent(
   at org.eclipse.swt.widgets.Display.runDeferredEvents(
   at org.eclipse.swt.widgets.Display.readAndDispatch(
   at AppWindow1.main(

Any idea of what I am doing wrong ?
Posts: 15
Joined: Mon Nov 03, 2003 7:33 pm

Postby lacou » Tue Jan 20, 2004 11:20 am

I found my mistake.
My dialog had a TreeViewer without a content provider...

:oops: :?
Posts: 15
Joined: Mon Nov 03, 2003 7:33 pm

Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest