简体   繁体   中英

resize/grow jface treeviewer dynamically

Is it possible to resize/growthe Jface treeviewer dynamically ?

I mean we have a composite and treeviewer has some contents, and user is clicking on the expand button to expand the contents, now parallely can the treeviewer grow ??

Thanks, Sam

You should not "grow" the TreeViewer this way. Imagine the scenario where the TreeViewer is to large to fit on the screen.

The way to go is using a ScrolledComposite that hosts the TreeViewer . This scrolled composite can be set to a default size and will show scrollbars when the content is to large for that size.

Here is a simple example on how to use ScrolledComposite . It looks like this:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM