"Illegal use of nonvirtual function call" - tableViewer

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

"Illegal use of nonvirtual function call" - tableViewer

Postby roalt » Thu Nov 11, 2010 1:18 am

I recently found out about WindowBuilder and it helps me a lot creating GUIs for my application.

However, I have little success in getting the data binding to work. I think the documentation is limited on the google website (http://download.instantiations.com/D2WBDoc/continuous/latest/docs/html/features/swt/data_binding/jface_bindings.html).

I've tried to create a TableView data binding using WindowBuilder. I get the following error when I run the application:

Exception in thread "main" java.lang.VerifyError: (class: org/eclipse/jface/databinding/viewers/ObservableMapLabelProvider, method: dispose signature: ()V) Illegal use of nonvirtual function call
at myapplication.initDataBindings(MyApplication.java:306

this section looks as follows (generated by WindowBuilder):
Code: Select all
protected DataBindingContext initDataBindings() {
      DataBindingContext bindingContext = new DataBindingContext();
      //
      ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
      messagesTableViewer.setContentProvider(listContentProvider);
      //
      IObservableMap[] observeMaps = PojoObservables.observeMaps(listContentProvider.getKnownElements(), Message.class, new String[]{"level", "message", "class"});
      messagesTableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
      //
      WritableList writableList = new WritableList(messagesModel.getMessages(), Message.class);
      messagesTableViewer.setInput(writableList);
      //
      return bindingContext;
   }


The MessagesModel and Message class look as follows:
Code: Select all
public class MessagesModel {
   ArrayList<Message> messages = new ArrayList<Message>();
   
   public MessagesModel() {
   }
   public ArrayList<Message> getMessages() {
      return messages;
   }
}
public class Message {
   String level;
   String message;
   
   public Message(String level, String message) {
      this.level = level;
      this.message = message;
   }
}


What am I missing?
roalt
 
Posts: 2
Joined: Thu Nov 11, 2010 12:02 am

Re: "Illegal use of nonvirtual function call" - tableViewer

Postby Eric Clayberg » Thu Nov 11, 2010 9:22 am

roalt wrote:What am I missing?

WIthout a complete test case, I have no idea.

That exception does not appear to have anything to do with SWT Designer.

It could be a problem with Eclipse installation or the JVM you are using, so you might try a new, clean Eclipse installation and the latest Sun/Oracle JVM.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: "Illegal use of nonvirtual function call" - tableViewer

Postby roalt » Fri Nov 12, 2010 3:06 am

Eric Clayberg wrote:
roalt wrote:What am I missing?

WIthout a complete test case, I have no idea.

That exception does not appear to have anything to do with SWT Designer.

It could be a problem with Eclipse installation or the JVM you are using, so you might try a new, clean Eclipse installation and the latest Sun/Oracle JVM.


Thanks Eric,

I'm running now Eclipse Version: 3.5.2, Build id: M20100211-1343 and Java version=1.6.0_20. I don't think they're too old. But maybe something is wrong and I will try with a new install.

As a 1-week beginner on SWT/WindowBuilder I think it was good first to ask just to make sure I didn't miss something obvious.
roalt
 
Posts: 2
Joined: Thu Nov 11, 2010 12:02 am

Re: "Illegal use of nonvirtual function call" - tableViewer

Postby Eric Clayberg » Fri Nov 12, 2010 5:49 am

The Eclipse and JDK version you are using are both fine...unless either has become corrupted over time.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron