2

I created a JFace wizard showing a single list where the user is supposed to make a selection. Since the page just contains a list, I would like to enable the double click selection. If the user performs a double click on a single event, the wizard should jump to the next page.

I got the following code so far:

 viewer.addDoubleClickListener(new IDoubleClickListener() {
        @Override
        public void doubleClick(DoubleClickEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            if (selection.getFirstElement() instanceof File) {
                if(canFlipToNextPage()) {
                   //perform jump to next page here.
                }
            }
        }
    });

Apparently there is no method for the programmatic execution of the next button. Thank you.

4

2 回答 2

5

您首先需要参考您想去的向导页面。如果您还没有通过其他方式获得它,您可以通过此 API 找到所有向导页面:

getWizard().getPages()

接下来,您进行以下调用:

getContainer().showPage( desiredPage )
于 2013-08-07T17:12:36.547 回答
0

您还可以访问下一页,因此更通用的解决方案是:

if (canFlipToNextPage()) {
    IWizardPage page = getNextPage();
    if (page != null) {
        getContainer().showPage(page);
    }
}
于 2020-04-28T14:13:02.603 回答