java - Align a TableViewer and TreeViewer -


i creating swt application 2 treeviewers , tableviewer in between them.

the tableviewer contains images in each row indicate date in row of treeviewer.

however problem images in tableviewer not aligning rows in treeviewer. there way me ensure rows stay leveld?

thanks

added

non aligning treeviewer , tableviewer

you can change way height of row measured overriding behaviour of "measuring method", i.e. adding listener swt.measureitem. there example here. use height of icon use in treeviewer plus maybe couple of border pixels.

here important code part:

display display = new display(); shell shell = new shell(display); shell.setbounds(10,10,200,250); final table table = new table(shell, swt.none); table.setbounds(10,10,150,200); table.setlinesvisible(true); (int = 0; < 5; i++) {    new tableitem(table, swt.none).settext("item " + i); } table.addlistener(swt.measureitem, new listener() {    public void handleevent(event event) {       int clientwidth = table.getclientarea().width;       event.height = event.gc.getfontmetrics().getheight() * 2;       event.width = clientwidth * 2;    } }); shell.open(); while (!shell.isdisposed()) {    if (!display.readanddispatch()) display.sleep(); } display.dispose(); 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -