Skip to main content



      Home
Home » Eclipse Projects » NatTable » New thread for updating a glazed lists object within event handler?
New thread for updating a glazed lists object within event handler? [message #1708831] Mon, 21 September 2015 11:16 Go to next message
Eclipse UserFriend
Hello,

I just wanted to ask, whether a new thread ist necessary for updating a glazed lists object within an event handler for changing the data of a NatTable object, when we are talking about good programming:

this.btnSearch.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent e) {
		Thread operationThread = new Thread() {
			public void run() {
				// time-consuming operations
				// Get requested data from Application Server
				//...
				
				display.syncExec(new Runnable() {
					public void run() {
						// UI Updating procedures go here ...
						underlyingLayer.getEventList().clear();
						underlyingLayer.getEventList().addAll(partsList);
					}
				});
			}
		};

		operationThread.start();
	}
}


Thank you very much!

Regards,
Mick
Re: New thread for updating a glazed lists object within event handler? [message #1708839 is a reply to message #1708831] Mon, 21 September 2015 13:14 Go to previous message
Eclipse UserFriend
A new thread would be necessary when the updating of the GlazedLists causes effects on the UI. For GlazedLists itself it is therefore not necessary. But for updating the NatTable it is.

In NatTable you should use the GlazedListsEventLayer to automatically react on such changes. And IIRC that layer already takes care of the UI thread execution. So it should not be necessary in your case.
Previous Topic:nattable - get all selected rows from selected range on mouse event
Next Topic: is it possible to have scrollbar inside Nattable??
Goto Forum:
  


Current Time: Mon Jun 23 09:37:29 EDT 2025

Powered by FUDForum. Page generated in 0.09559 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top