Dynamically generate a wizardpage

Source: Internet
Author: User

Eclipse's wizard is composed of a series of wizardpages. By default, wizarddialog will call the createcontrol () method of each wizardpage during initialization to layout these wizardpages. This is to facilitate the determination of the size of the wizarddialog window. However, if a control in a wizardpage needs to be dynamically generated, for example, you need to input an integer N in page1 and generate n text boxes based on this integer in page2, since the createcontrol () of page2 is only called once, and is called by wizarddialog before obtaining N, the centralized layout method makes it difficult to generate the page2 interface.

Compared with the problem description, the solution is much simpler, as long as the createpagecontrols () method of wizard is overwritten so that it can do nothing:

@ OverridePublic VoidCreatepagecontrols (composite pagecontainer ){//Super. createpagecontrols (pagecontainer );}

Theoretically, the problem with this operation is that the size of the wizarddialog may not be able to accommodate all the controls, but I haven't encountered it in actual applications, as long as there are not too many dynamically generated controls, or you can use the scroll mode to accommodate it.

Reference: http://dev.eclipse.org/newslists/news.eclipse.tools/msg02641.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.