-
Book Overview & Buying
-
Table Of Contents
Eclipse Plug-in Development Beginner's Guide - Second Edition
By :
Sometimes it is necessary to write code to run in the UI thread, but when called back via a handler it's not always clear if the method is in the UI thread or not. In Eclipse 3.x, there is a Display.getDefault().syncExec() for running Runnable instances inside the UI thread immediately, or .asyncExec() for running them on the UI thread later. Eclipse 4 introduces the UISynchronize class, which is an abstract mechanism for executing code on the UI thread (it's like an interface for Display, except that Display doesn't implement it and it's not an interface). The syncExec and asyncExec methods can be used to schedule Runnable events. If a long calculation needs to update the UI after concluding, using UISynchronize allows the UI update to be scheduled on the right thread.
Button as a field in the Hello part, and attach a selection listener such that when it is pressed, it invokes setEnabled(false) on itself....
Change the font size
Change margin width
Change background colour