Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:16 Go to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 16
Registered: July 2015
Junior Member
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 17:14 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
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: Fri Mar 05 16:59:22 GMT 2021

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

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

Back to the top