java - How to refresh the composite while filtering through text field? -


i have section , formtoolkit in 1 composite. when enter text in search box (text field) should filter based on user input , show results below. facing 1 problem while filtering data. how refresh data in composite when user enters text in text field.

i want solution same how works in

preferences -> compiler -> errors/warnings?

example:

enter image description here

if enter "null" in search box display related "null" values below.

how achieve implementation filtering/refreshing composite data?

the preference page reference composite containing controls filtered. composite uses gridlayout layout.

each control has griddata layout data. set control visible or invisible uses:

control.setvisible(visible); ((griddata)control.getlayoutdata()).exclude = !visible; 

once has been done calls:

composite.layout(true, true); 

to redo layout of composite completely.

most of code in org.eclipse.jdt.internal.ui.preference.optionsconfigurationblock

to filtering create text field filter , add modifylistener listen changes in text.

each time text changes match text of each control filter , set control visible / invisible described above. @ end of filtering layout call.